{"id":85002,"date":"2025-03-25T13:27:09","date_gmt":"2025-03-25T06:27:09","guid":{"rendered":"https:\/\/itviec1.uptech.vn\/?p=85002"},"modified":"2025-03-25T13:27:09","modified_gmt":"2025-03-25T06:27:09","slug":"bash-shell-la-gi","status":"publish","type":"post","link":"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/","title":{"rendered":"Bash Shell l\u00e0 g\u00ec? C\u00e1c t\u00ednh n\u0103ng ch\u00ednh c\u1ee7a Bash Shell"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">N\u1ed9i dung b\u00e0i vi\u1ebft<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/#Bash_Shell_la_gi\" >Bash Shell l\u00e0 g\u00ec?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/#Bash_hoat_dong_nhu_the_nao\" >Bash ho\u1ea1t \u0111\u1ed9ng nh\u01b0 th\u1ebf n\u00e0o?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/#Bash_Script_la_gi\" >Bash Script l\u00e0 g\u00ec?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/#Vi_sao_nen_su_dung_Bash\" >V\u00ec sao n\u00ean s\u1eed d\u1ee5ng Bash?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/#Phan_biet_Bash_Script_va_Shell_Script\" >Ph\u00e2n bi\u1ec7t Bash Script v\u00e0 Shell Script<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/#Cach_chay_script_Bash_Shell_co_ban\" >C\u00e1ch ch\u1ea1y script Bash Shell c\u01a1 b\u1ea3n<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/#Cau_hoi_thuong_gap_ve_Bash_Shell\" >C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 Bash Shell<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/#Tong_ket_Bash_Shell\" >T\u1ed5ng k\u1ebft Bash Shell<\/a><\/li><\/ul><\/nav><\/div>\n<p><em><strong>Bash Shell l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 quan tr\u1ecdng trong Unix\/Linux, gi\u00fap ng\u01b0\u1eddi d\u00f9ng th\u1ef1c thi l\u1ec7nh v\u00e0 qu\u1ea3n l\u00fd h\u1ec7 th\u1ed1ng th\u00f4ng qua d\u00f2ng l\u1ec7nh. Bash kh\u00f4ng ch\u1ec9 cung c\u1ea5p c\u00e1c l\u1ec7nh c\u01a1 b\u1ea3n m\u00e0 c\u00f2n h\u1ed7 tr\u1ee3 nhi\u1ec1u t\u00ednh n\u0103ng n\u00e2ng cao nh\u01b0 scripting, \u0111i\u1ec1u h\u01b0\u1edbng file, qu\u1ea3n l\u00fd ti\u1ebfn tr\u00ecnh v\u00e0 t\u1ef1 \u0111\u1ed9ng h\u00f3a t\u00e1c v\u1ee5.\u00a0<\/strong><\/em><\/p>\n<p><span style=\"font-weight: 400;\">\u0110\u1ecdc b\u00e0i vi\u1ebft n\u00e0y \u0111\u1ec3 hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Bash Shell l\u00e0 g\u00ec?<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">C\u00e1c t\u00ednh n\u0103ng c\u1ee7a Bash Shell<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">V\u00ec sao n\u00ean s\u1eed d\u1ee5ng Bash?<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Bash script l\u00e0 g\u00ec?<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Ph\u00e2n bi\u1ec7t Bash Script v\u00e0 Shell Script<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Bash_Shell_la_gi\"><\/span><b>Bash Shell l\u00e0 g\u00ec?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>Bash<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Bash (Bourne Again Shell) l\u00e0 m\u1ed9t tr\u00ecnh th\u00f4ng d\u1ecbch l\u1ec7nh v\u00e0 <\/span><strong><i>ng\u00f4n ng\u1eef scripting*<\/i><\/strong><span style=\"font-weight: 400;\"> m\u1ea1nh m\u1ebd, ph\u1ed5 bi\u1ebfn tr\u00ean <a href=\"https:\/\/itviec.com\/blog\/linux\/\" target=\"_blank\" rel=\"noopener\"><strong>Linux<\/strong><\/a>, macOS v\u00e0 c\u00e1c h\u1ec7 th\u1ed1ng Unix-like. T\u00ean g\u1ecdi &#8220;Bash&#8221; v\u1eeba l\u00e0 t\u00ean Stephen Bourne, t\u00e1c gi\u1ea3 c\u1ee7a Bourne Shell, v\u1eeba mang \u00fd ngh\u0129a &#8220;Bourne-again Shell&#8221; \u2013 m\u1ed9t phi\u00ean b\u1ea3n t\u00e1i sinh v\u00e0 m\u1edf r\u1ed9ng t\u1eeb Bourne Shell.<\/span><\/p>\n<blockquote><p><i><span style=\"font-weight: 400;\"><strong>*<\/strong> M\u1ed9t ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh th\u00f4ng th\u01b0\u1eddng (nh\u01b0 C, Java) c\u1ea7n ph\u1ea3i bi\u00ean d\u1ecbch tr\u01b0\u1edbc khi ch\u1ea1y. Ng\u01b0\u1ee3c l\u1ea1i, ng\u00f4n ng\u1eef scripting l\u00e0 lo\u1ea1i ng\u00f4n ng\u1eef m\u00e0 m\u00e3 ngu\u1ed3n \u0111\u01b0\u1ee3c th\u1ef1c thi tr\u1ef1c ti\u1ebfp th\u00f4ng qua m\u1ed9t tr\u00ecnh th\u00f4ng d\u1ecbch m\u00e0 kh\u00f4ng c\u1ea7n bi\u00ean d\u1ecbch th\u00e0nh m\u00e3 m\u00e1y tr\u01b0\u1edbc,gi\u00fap vi\u1ec7c vi\u1ebft, ki\u1ec3m th\u1eed v\u00e0 ch\u1ea1y ch\u01b0\u01a1ng tr\u00ecnh tr\u1edf n\u00ean nhanh ch\u00f3ng h\u01a1n.<\/span><\/i><\/p><\/blockquote>\n<p><span style=\"font-weight: 400;\">Bash k\u1ebf th\u1eeba c\u00e1c t\u00ednh n\u0103ng c\u1ee7a Bourne Shell, \u0111\u1ed3ng th\u1eddi t\u00edch h\u1ee3p th\u00eam nhi\u1ec1u \u0111\u1eb7c \u0111i\u1ec3m gi\u1ed1ng Korn Shell (ksh) v\u00e0 C Shell (csh). Bash c\u00f2n cung c\u1ea5p c\u00e1c t\u00ednh n\u0103ng n\u00e2ng cao nh\u01b0 ch\u1ec9nh s\u1eeda d\u00f2ng l\u1ec7nh, l\u1ecbch s\u1eed l\u1ec7nh (line editing),\u00a0 l\u1ecbch s\u1eed l\u1ec7nh (command history), tab completion, m\u1edf r\u1ed9ng c\u00fa ph\u00e1p\u00a0 (syntax expansion), gi\u00fap thao t\u00e1c nhanh h\u01a1n v\u00e0 hi\u1ec7u qu\u1ea3 h\u01a1n.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Bash tu\u00e2n th\u1ee7 ti\u00eau chu\u1ea9n shell c\u1ee7a IEEE POSIX v\u00e0 c\u00f3 m\u1ee9c \u0111\u1ed9 t\u01b0\u01a1ng th\u00edch cao v\u1edbi Bourne Shell, cho ph\u00e9p ch\u1ea1y ph\u1ea7n l\u1edbn c\u00e1c script vi\u1ebft cho Bourne Shell m\u00e0 kh\u00f4ng c\u1ea7n ch\u1ec9nh s\u1eeda.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Bash kh\u00f4ng ch\u1ec9 gi\u00fap ng\u01b0\u1eddi d\u00f9ng nh\u1eadp v\u00e0 th\u1ef1c thi l\u1ec7nh tr\u1ef1c ti\u1ebfp tr\u00ean terminal, m\u00e0 c\u00f2n cho ph\u00e9p vi\u1ebft t\u1eadp h\u1ee3p nhi\u1ec1u l\u1ec7nh v\u00e0o m\u1ed9t file (th\u01b0\u1eddng c\u00f3 \u0111u\u00f4i <\/span><span style=\"font-weight: 400;\">.sh<\/span><span style=\"font-weight: 400;\">) v\u00e0 ch\u1ea1y ch\u00fang m\u1ed9t c\u00e1ch t\u1ef1 \u0111\u1ed9ng m\u00e0 kh\u00f4ng c\u1ea7n bi\u00ean d\u1ecbch. \u0110i\u1ec1u n\u00e0y gi\u00fap Bash tr\u1edf th\u00e0nh c\u00f4ng c\u1ee5 m\u1ea1nh m\u1ebd \u0111\u1ec3 t\u1ef1 \u0111\u1ed9ng h\u00f3a c\u00f4ng vi\u1ec7c, ch\u1eb3ng h\u1ea1n nh\u01b0 sao l\u01b0u d\u1eef li\u1ec7u \u0111\u1ecbnh k\u1ef3, qu\u1ea3n l\u00fd h\u1ec7 th\u1ed1ng (c\u00e0i \u0111\u1eb7t ph\u1ea7n m\u1ec1m, ki\u1ec3m tra t\u00e0i nguy\u00ean, gi\u00e1m s\u00e1t ti\u1ebfn tr\u00ecnh) v\u00e0 ch\u1ea1y l\u1ec7nh h\u00e0ng lo\u1ea1t m\u00e0 kh\u00f4ng c\u1ea7n nh\u1eadp th\u1ee7 c\u00f4ng t\u1eebng l\u1ec7nh m\u1ed9t.<\/span><\/p>\n<h3><b>Shell<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Shell l\u00e0 ch\u01b0\u01a1ng tr\u00ecnh trung gian gi\u1eefa ng\u01b0\u1eddi d\u00f9ng (ho\u1eb7c ph\u1ea7n m\u1ec1m kh\u00e1c) v\u00e0 h\u1ec7 \u0111i\u1ec1u h\u00e0nh, cho ph\u00e9p nh\u1eadp l\u1ec7nh \u0111\u1ec3 \u0111i\u1ec1u khi\u1ec3n h\u1ec7 th\u1ed1ng. Thay v\u00ec s\u1eed d\u1ee5ng giao di\u1ec7n \u0111\u1ed3 h\u1ecda (GUI) v\u1edbi chu\u1ed9t v\u00e0 c\u1eeda s\u1ed5, shell cho ph\u00e9p t\u01b0\u01a1ng t\u00e1c tr\u1ef1c ti\u1ebfp b\u1eb1ng d\u00f2ng l\u1ec7nh (CLI \u2013 Command Line Interface).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Shell ho\u1ea1t \u0111\u1ed9ng b\u00ean ngo\u00e0i kernel (h\u1ea1t nh\u00e2n h\u1ec7 \u0111i\u1ec1u h\u00e0nh), gi\u00fap ng\u01b0\u1eddi d\u00f9ng th\u1ef1c hi\u1ec7n c\u00e1c thao t\u00e1c nh\u01b0 qu\u1ea3n l\u00fd file v\u00e0 th\u01b0 m\u1ee5c (t\u1ea1o, x\u00f3a, di chuy\u1ec3n, \u0111\u1ed5i t\u00ean), qu\u1ea3n l\u00fd ti\u1ebfn tr\u00ecnh (kh\u1edfi \u0111\u1ed9ng, d\u1eebng, ki\u1ec3m tra ch\u01b0\u01a1ng tr\u00ecnh \u0111ang ch\u1ea1y) hay t\u1ef1 \u0111\u1ed9ng h\u00f3a t\u00e1c v\u1ee5 th\u00f4ng qua scripting.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">D\u1ef1a tr\u00ean c\u00e1ch th\u1ee9c t\u01b0\u01a1ng t\u00e1c, shell \u0111\u01b0\u1ee3c chia th\u00e0nh hai lo\u1ea1i ch\u00ednh:\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Shell giao di\u1ec7n d\u00f2ng l\u1ec7nh (CLI \u2013 Command Line Interface):<\/b><span style=\"font-weight: 400;\"> Shell CLI nh\u01b0 Bash Shell, Zsh, Csh, hay Ksh cho ph\u00e9p ng\u01b0\u1eddi d\u00f9ng nh\u1eadp l\u1ec7nh tr\u1ef1c ti\u1ebfp \u0111\u1ec3 thao t\u00e1c v\u1edbi h\u1ec7 \u0111i\u1ec1u h\u00e0nh. Lo\u1ea1i shell n\u00e0y c\u00f3 \u01b0u \u0111i\u1ec3m l\u00e0 hi\u1ec7u qu\u1ea3, ti\u1ebft ki\u1ec7m t\u00e0i nguy\u00ean, t\u1ed1c \u0111\u1ed9 cao v\u00e0 cung c\u1ea5p kh\u1ea3 n\u0103ng \u0111i\u1ec1u khi\u1ec3n chi ti\u1ebft, nh\u01b0ng \u0111\u00f2i h\u1ecfi ng\u01b0\u1eddi d\u00f9ng ph\u1ea3i n\u1eafm v\u1eefng c\u00fa ph\u00e1p v\u00e0 c\u00e1c l\u1ec7nh.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Shell giao di\u1ec7n \u0111\u1ed3 h\u1ecda (GUI \u2013 Graphical User Interface):<\/b><span style=\"font-weight: 400;\"> Shell giao di\u1ec7n \u0111\u1ed3 h\u1ecda (GUI Shell) cung c\u1ea5p m\u00f4i tr\u01b0\u1eddng t\u01b0\u01a1ng t\u00e1c tr\u1ef1c quan gi\u1eefa ng\u01b0\u1eddi d\u00f9ng v\u00e0 h\u1ec7 \u0111i\u1ec1u h\u00e0nh th\u00f4ng qua c\u1eeda s\u1ed5, bi\u1ec3u t\u01b0\u1ee3ng, menu, v\u00e0 chu\u1ed9t. V\u00ed d\u1ee5, Windows Shell tr\u00ean Windows ho\u1eb7c GNOME\/KDE tr\u00ean Linux l\u00e0 c\u00e1c GUI Shell, gi\u00fap ng\u01b0\u1eddi d\u00f9ng thao t\u00e1c m\u00e0 kh\u00f4ng c\u1ea7n nh\u1eadp l\u1ec7nh. Tuy nhi\u00ean, h\u1ea7u h\u1ebft c\u00e1c h\u1ec7 \u0111i\u1ec1u h\u00e0nh c\u00f3 giao di\u1ec7n GUI v\u1eabn cung c\u1ea5p m\u1ed9t terminal ho\u1eb7c command prompt \u0111\u1ec3 h\u1ed7 tr\u1ee3 c\u00e1c t\u00e1c v\u1ee5 d\u00f2ng l\u1ec7nh cho qu\u1ea3n tr\u1ecb vi\u00ean h\u1ec7 th\u1ed1ng ho\u1eb7c ng\u01b0\u1eddi d\u00f9ng n\u00e2ng cao.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">T\u00f3m l\u1ea1i, <strong>Bash Shell l\u00e0 m\u1ed9t trong nh\u1eefng tr\u00ecnh th\u00f4ng d\u1ecbch l\u1ec7nh ph\u1ed5 bi\u1ebfn v\u00e0 m\u1ea1nh m\u1ebd<\/strong>, cung c\u1ea5p giao di\u1ec7n d\u00f2ng l\u1ec7nh \u0111\u1ec3 t\u01b0\u01a1ng t\u00e1c v\u1edbi h\u1ec7 \u0111i\u1ec1u h\u00e0nh hi\u1ec7u qu\u1ea3, cho ph\u00e9p vi\u1ebft script t\u1ef1 \u0111\u1ed9ng h\u00f3a, gi\u00fap \u0111\u01a1n gi\u1ea3n h\u00f3a c\u00e1c t\u00e1c v\u1ee5 nh\u01b0 qu\u1ea3n l\u00fd h\u1ec7 th\u1ed1ng, x\u1eed l\u00fd d\u1eef li\u1ec7u v\u00e0 th\u1ef1c hi\u1ec7n l\u1ec7nh h\u00e0ng lo\u1ea1t.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 s\u1eed d\u1ee5ng Bash, b\u1ea1n ch\u1ec9 c\u1ea7n m\u1edf terminal v\u00e0 b\u1eaft \u0111\u1ea7u nh\u1eadp l\u1ec7nh:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Tr\u00ean Linux: <\/span><span style=\"font-weight: 400;\">Ctrl + Alt + TT<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Tr\u00ean mac OS: T\u00ecm &#8220;Terminal&#8221; trong Spotlight\u00a0 ho\u1eb7c \u1ee9ng d\u1ee5ng Utilities.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Tr\u00ean Windows: S\u1eed d\u1ee5ng Windows Subsystem for Linux (WSL), Cygwin ho\u1eb7c Git Bash.<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Bash_hoat_dong_nhu_the_nao\"><\/span><b>Bash ho\u1ea1t \u0111\u1ed9ng nh\u01b0 th\u1ebf n\u00e0o?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Bash Shell ho\u1ea1t \u0111\u1ed9ng nh\u01b0 m\u1ed9t tr\u00ecnh th\u00f4ng d\u1ecbch l\u1ec7nh. Qu\u00e1 tr\u00ecnh x\u1eed l\u00fd l\u1ec7nh di\u1ec5n ra nh\u01b0 sau:<\/span><\/p>\n<h3><b>\u0110\u1ecdc l\u1ec7nh ng\u01b0\u1eddi d\u00f9ng nh\u1eadp<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Khi b\u1ea1n nh\u1eadp m\u1ed9t l\u1ec7nh v\u00e0o terminal v\u00e0 nh\u1ea5n Enter, Bash s\u1ebd nh\u1eadn to\u00e0n b\u1ed9 n\u1ed9i dung d\u00f2ng l\u1ec7nh. N\u1ebfu c\u00f3 nhi\u1ec1u l\u1ec7nh tr\u00ean c\u00f9ng m\u1ed9t d\u00f2ng, Bash s\u1ebd t\u00e1ch ch\u00fang ra d\u1ef1a v\u00e0o d\u1ea5u <\/span><span style=\"font-weight: 400;\">;<\/span><span style=\"font-weight: 400;\"> (th\u1ef1c thi tu\u1ea7n t\u1ef1) ho\u1eb7c | (pipe \u0111\u1ec3 chuy\u1ec3n \u0111\u1ea7u ra c\u1ee7a l\u1ec7nh n\u00e0y th\u00e0nh \u0111\u1ea7u v\u00e0o c\u1ee7a l\u1ec7nh kia).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Bash c\u0169ng h\u1ed7 tr\u1ee3 c\u00e1c k\u00fd hi\u1ec7u kh\u00e1c nh\u01b0 &amp;&amp; (ch\u1ec9 ch\u1ea1y l\u1ec7nh ti\u1ebfp theo n\u1ebfu l\u1ec7nh tr\u01b0\u1edbc th\u00e0nh c\u00f4ng) ho\u1eb7c || (ch\u1ec9 ch\u1ea1y l\u1ec7nh ti\u1ebfp theo n\u1ebfu l\u1ec7nh tr\u01b0\u1edbc th\u1ea5t b\u1ea1i). V\u00ed d\u1ee5:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">cmd1 &amp;&amp; cmd2\u00a0 # cmd2 ch\u1ec9 ch\u1ea1y n\u1ebfu cmd1 th\u00e0nh c\u00f4ng<\/span>\r\n\r\n<span style=\"font-weight: 400;\">cmd1 || cmd2\u00a0 # cmd2 ch\u1ec9 ch\u1ea1y n\u1ebfu cmd1 th\u1ea5t b\u1ea1i<\/span>\r\n<\/pre>\n<h3><b>Ph\u00e2n t\u00edch c\u00fa ph\u00e1p (Parsing)<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Bash ki\u1ec3m tra c\u00fa ph\u00e1p (syntax) c\u1ee7a l\u1ec7nh \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o n\u00f3 h\u1ee3p l\u1ec7. N\u1ebfu c\u00f3 l\u1ed7i c\u00fa ph\u00e1p (v\u00ed d\u1ee5: d\u1ea5u ngo\u1eb7c ho\u1eb7c d\u1ea5u nh\u00e1y kh\u00f4ng kh\u1edbp), Bash s\u1ebd b\u00e1o l\u1ed7i ngay.<\/span><\/p>\n<h3><b>M\u1edf r\u1ed9ng c\u00e1c k\u00fd hi\u1ec7u v\u00e0 bi\u1ebfn<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Bash thay th\u1ebf c\u00e1c bi\u1ebfn m\u00f4i tr\u01b0\u1eddng, alias, wildcard (<\/span><span style=\"font-weight: 400;\">*<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">?<\/span><span style=\"font-weight: 400;\">), v\u00e0 th\u1ef1c hi\u1ec7n c\u00e1c ph\u00e9p to\u00e1n tr\u00ean l\u1ec7nh. C\u00e1c b\u01b0\u1edbc m\u1edf r\u1ed9ng bao g\u1ed3m:<\/span><\/p>\n<h4><b>M\u1edf r\u1ed9ng alias (Alias Expansion)<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Alias l\u00e0 t\u00ean vi\u1ebft t\u1eaft cho m\u1ed9t l\u1ec7nh d\u00e0i. Bash s\u1ebd ki\u1ec3m tra xem b\u1ea1n c\u00f3 \u0111\u1eb7t alias n\u00e0o cho l\u1ec7nh v\u1eeba nh\u1eadp hay kh\u00f4ng. N\u1ebfu c\u00f3, Bash s\u1ebd thay th\u1ebf alias b\u1eb1ng n\u1ed9i dung g\u1ed1c tr\u01b0\u1edbc khi ti\u1ebfp t\u1ee5c x\u1eed l\u00fd l\u1ec7nh.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5:<\/span><\/p>\n<pre>alias ll='ls -la'\u00a0 # \u0110\u1ecbnh ngh\u0129a alias\u00a0\r\n\r\nll<\/pre>\n<p><span style=\"font-weight: 400;\">Khi g\u00f5 <\/span><span style=\"font-weight: 400;\">ll<\/span><span style=\"font-weight: 400;\">, Bash s\u1ebd t\u1ef1 \u0111\u1ed9ng thay th\u1ebf th\u00e0nh <\/span><span style=\"font-weight: 400;\">ls -la<\/span><span style=\"font-weight: 400;\">.<\/span><\/p>\n<h4><b>M\u1edf r\u1ed9ng bi\u1ebfn (Variable Expansion)<\/b><strong> ($HOME, $USER)<\/strong><\/h4>\n<p><span style=\"font-weight: 400;\">N\u1ebfu b\u1ea1n s\u1eed d\u1ee5ng bi\u1ebfn trong l\u1ec7nh (<\/span><span style=\"font-weight: 400;\">$VAR<\/span><span style=\"font-weight: 400;\">), Bash s\u1ebd thay bi\u1ebfn \u0111\u00f3 b\u1eb1ng gi\u00e1 tr\u1ecb th\u1ef1c t\u1ebf tr\u01b0\u1edbc khi ch\u1ea1y l\u1ec7nh. N\u1ebfu bi\u1ebfn kh\u00f4ng t\u1ed3n t\u1ea1i, n\u00f3 s\u1ebd \u0111\u1ec3 tr\u1ed1ng ho\u1eb7c hi\u1ec3n th\u1ecb l\u1ed7i.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5:\u00a0<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">name=\"Alice\"\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">echo \"Hello, $name\"<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Bash s\u1ebd thay <\/span><span style=\"font-weight: 400;\">$name<\/span><span style=\"font-weight: 400;\"> b\u1eb1ng <\/span><span style=\"font-weight: 400;\">Alice<\/span><span style=\"font-weight: 400;\">, sau \u0111\u00f3 th\u1ef1c thi l\u1ec7nh:<\/span><\/p>\n<pre>echo \"Hello, Alice\"<\/pre>\n<h4><b>M\u1edf r\u1ed9ng wildcard (Wildcard Expansion<\/b><strong>) (*.txt)<\/strong><\/h4>\n<p><span style=\"font-weight: 400;\">Bash t\u1ef1 \u0111\u1ed9ng m\u1edf r\u1ed9ng c\u00e1c k\u00fd t\u1ef1 \u0111\u1ea1i di\u1ec7n <\/span><span style=\"font-weight: 400;\">(*,<\/span> <span style=\"font-weight: 400;\">?,<\/span> <span style=\"font-weight: 400;\">[ ]<\/span><span style=\"font-weight: 400;\">) th\u00e0nh danh s\u00e1ch file c\u00f3 trong th\u01b0 m\u1ee5c hi\u1ec7n t\u1ea1i, gi\u00fap b\u1ea1n kh\u00f4ng c\u1ea7n nh\u1eadp t\u00ean file th\u1ee7 c\u00f4ng.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5:\u00a0<\/span><\/p>\n<pre>ls *.txt<\/pre>\n<p><span style=\"font-weight: 400;\">Bash s\u1ebd thay <\/span><span style=\"font-weight: 400;\">*.txt<\/span><span style=\"font-weight: 400;\"> th\u00e0nh danh s\u00e1ch t\u1ea5t c\u1ea3 c\u00e1c file <\/span><span style=\"font-weight: 400;\">.txt<\/span><span style=\"font-weight: 400;\"> trong th\u01b0 m\u1ee5c, v\u00ed d\u1ee5:<\/span><\/p>\n<pre>ls file1.txt file2.txt notes.txt<\/pre>\n<h4><b>M\u1edf r\u1ed9ng l\u1ec7nh con (Command Substitution<\/b><strong>) ($(command))<\/strong><\/h4>\n<p><span style=\"font-weight: 400;\">Khi b\u1ea1n s\u1eed d\u1ee5ng d\u1ea5u <\/span><span style=\"font-weight: 400;\">$(command)<\/span><span style=\"font-weight: 400;\"> ho\u1eb7c d\u1ea5u `command`, Bash s\u1ebd ch\u1ea1y l\u1ec7nh b\u00ean trong tr\u01b0\u1edbc, r\u1ed3i thay th\u1ebf n\u00f3 b\u1eb1ng k\u1ebft qu\u1ea3.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5:\u00a0<\/span><\/p>\n<pre>echo \"H\u00f4m nay l\u00e0: $(date)\"<\/pre>\n<p><span style=\"font-weight: 400;\">Bash s\u1ebd ch\u1ea1y l\u1ec7nh <\/span><span style=\"font-weight: 400;\">date<\/span><span style=\"font-weight: 400;\"> tr\u01b0\u1edbc, r\u1ed3i thay th\u1ebf v\u00e0o chu\u1ed7i:<\/span><\/p>\n<pre>echo \"H\u00f4m nay l\u00e0: Th\u1ee9 Hai, 04\/03\/2024\"<\/pre>\n<h3><b>Th\u1ef1c thi l\u1ec7nh system call c\u1ee7a kernel<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Sau khi x\u1eed l\u00fd xong c\u00fa ph\u00e1p v\u00e0 m\u1edf r\u1ed9ng l\u1ec7nh, Bash ki\u1ec3m tra xem l\u1ec7nh c\u00f3 ph\u1ea3i l\u00e0 built-in hay external command. N\u1ebfu l\u1ec7nh l\u00e0 m\u1ed9t ch\u01b0\u01a1ng tr\u00ecnh b\u00ean ngo\u00e0i, Bash s\u1eed d\u1ee5ng fork() \u0111\u1ec3 t\u1ea1o m\u1ed9t ti\u1ebfn tr\u00ecnh con, sau \u0111\u00f3 d\u00f9ng exec() \u0111\u1ec3 th\u1ef1c thi l\u1ec7nh.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>L\u1ec7nh built-in<\/b><span style=\"font-weight: 400;\"> (<\/span><span style=\"font-weight: 400;\">cd<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">exit<\/span><span style=\"font-weight: 400;\">): Bash th\u1ef1c thi ngay.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>L\u1ec7nh external<\/b><span style=\"font-weight: 400;\"> (<\/span><span style=\"font-weight: 400;\">ls<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">grep<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">python<\/span><span style=\"font-weight: 400;\">): Bash t\u00ecm ki\u1ebfm trong bi\u1ebfn <\/span><span style=\"font-weight: 400;\">$PATH<\/span><span style=\"font-weight: 400;\"> v\u00e0 g\u1ecdi h\u1ec7 th\u1ed1ng \u0111\u1ec3 ch\u1ea1y ch\u01b0\u01a1ng tr\u00ecnh.<\/span><\/li>\n<\/ul>\n<h3><b>Tr\u1ea3 k\u1ebft qu\u1ea3 v\u1ec1 Terminal<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Sau khi l\u1ec7nh ho\u00e0n t\u1ea5t, Bash tr\u1ea3 k\u1ebft qu\u1ea3 \u0111\u1ea7u ra v\u1ec1 terminal. N\u1ebfu c\u00f3 l\u1ed7i, Bash s\u1ebd hi\u1ec3n th\u1ecb th\u00f4ng b\u00e1o l\u1ed7i. N\u1ebfu c\u00f3 chuy\u1ec3n h\u01b0\u1edbng (redirection), k\u1ebft qu\u1ea3 c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c ghi v\u00e0o file thay v\u00ec hi\u1ec3n th\u1ecb tr\u00ean m\u00e0n h\u00ecnh.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 n\u1ebfu c\u00f3 l\u1ed7i, Bash s\u1ebd hi\u1ec3n th\u1ecb th\u00f4ng b\u00e1o l\u1ed7i nh\u01b0:<\/span><\/p>\n<pre>command not found<\/pre>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 l\u01b0u k\u1ebft qu\u1ea3 v\u00e0o file:<\/span><\/p>\n<pre>ls -l &gt; output.txt<\/pre>\n<p><span style=\"font-weight: 400;\">K\u1ebft qu\u1ea3 c\u1ee7a <\/span><span style=\"font-weight: 400;\">ls -l<\/span><span style=\"font-weight: 400;\"> s\u1ebd \u0111\u01b0\u1ee3c l\u01b0u v\u00e0o <\/span><span style=\"font-weight: 400;\">output.txt<\/span><span style=\"font-weight: 400;\"> thay v\u00ec hi\u1ec3n th\u1ecb tr\u00ean m\u00e0n h\u00ecnh<\/span><\/p>\n<h3><b>C\u00e1c t\u00ednh n\u0103ng ch\u00ednh c\u1ee7a Bash Shell<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>T\u01b0\u01a1ng th\u00edch v\u1edbi Bourne Shell (sh)<\/b><span style=\"font-weight: 400;\">: Bash k\u1ebf th\u1eeba v\u00e0 m\u1edf r\u1ed9ng c\u00e1c t\u00ednh n\u0103ng t\u1eeb Bourne Shell, \u0111\u1ed3ng th\u1eddi b\u1ed5 sung nhi\u1ec1u t\u00ednh n\u0103ng t\u1eeb Korn Shell (ksh) v\u00e0 C Shell (csh), nh\u01b0 ki\u1ec3m so\u00e1t c\u00f4ng vi\u1ec7c (job control) v\u00e0 thao t\u00e1c th\u01b0 m\u1ee5c.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>H\u1ed7 tr\u1ee3 tham s\u1ed1 d\u00f2ng l\u1ec7nh (Command Line Options)<\/b><span style=\"font-weight: 400;\">: Bash c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c kh\u1edfi \u0111\u1ed9ng b\u1eb1ng c\u00e1c t\u00f9y ch\u1ecdn ng\u1eafn (<\/span><span style=\"font-weight: 400;\">-a<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">-b<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">-c<\/span><span style=\"font-weight: 400;\">) ho\u1eb7c t\u00f9y ch\u1ecdn d\u00e0i (<\/span><span style=\"font-weight: 400;\">&#8211;debugger<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">&#8211;help<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">&#8211;login<\/span><span style=\"font-weight: 400;\">).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>T\u1ec7p kh\u1edfi \u0111\u1ed9ng (Start-up Files)<\/b><span style=\"font-weight: 400;\">: Khi kh\u1edfi \u0111\u1ed9ng, Bash \u0111\u1ecdc c\u00e1c file c\u1ea5u h\u00ecnh nh\u01b0 <\/span><span style=\"font-weight: 400;\">.bashrc<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">.profile<\/span><span style=\"font-weight: 400;\">, bash.bashrc gi\u00fap thi\u1ebft l\u1eadp m\u00f4i tr\u01b0\u1eddng l\u00e0m vi\u1ec7c.<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">.bashrc:<\/span><span style=\"font-weight: 400;\"> C\u1ea5u h\u00ecnh cho m\u1ed7i phi\u00ean terminal t\u01b0\u01a1ng t\u00e1c<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">.bash_profile<\/span><span style=\"font-weight: 400;\">: C\u1ea5u h\u00ecnh khi \u0111\u0103ng nh\u1eadp<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">\/etc\/bash.bashrc<\/span><span style=\"font-weight: 400;\">: C\u1ea5u h\u00ecnh to\u00e0n h\u1ec7 th\u1ed1ng<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>H\u1ed7 tr\u1ee3 ph\u00edm t\u1eaft ch\u1ec9nh s\u1eeda (Key Bindings):<\/b><span style=\"font-weight: 400;\"> Cho ph\u00e9p t\u00f9y ch\u1ec9nh c\u00e1c t\u1ed5 h\u1ee3p ph\u00edm \u0111\u1ec3 ch\u1ec9nh s\u1eeda l\u1ec7nh nhanh ch\u00f3ng.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>H\u1ed7 tr\u1ee3 m\u1ea3ng m\u1ed9t chi\u1ec1u (Arrays):<\/b><span style=\"font-weight: 400;\"> Bash cung c\u1ea5p m\u1ea3ng gi\u00fap d\u1ec5 d\u00e0ng thao t\u00e1c danh s\u00e1ch d\u1eef li\u1ec7u.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>C\u1ea5u tr\u00fac \u0111i\u1ec1u khi\u1ec3n (Control Structures):<\/b><span style=\"font-weight: 400;\"> Cung c\u1ea5p c\u00e1c l\u1ec7nh \u0111i\u1ec1u ki\u1ec7n (<\/span><span style=\"font-weight: 400;\">if<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">case<\/span><span style=\"font-weight: 400;\">), v\u00f2ng l\u1eb7p (<\/span><span style=\"font-weight: 400;\">for<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">while<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">until<\/span><span style=\"font-weight: 400;\">) v\u00e0 c\u1ea5u tr\u00fac select \u0111\u1ec3 t\u1ea1o menu \u0111\u1ed9ng.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Ng\u0103n x\u1ebfp th\u01b0 m\u1ee5c (Directory Stack):<\/b><span style=\"font-weight: 400;\"> L\u01b0u l\u1ecbch s\u1eed c\u00e1c th\u01b0 m\u1ee5c \u0111\u00e3 truy c\u1eadp, cho ph\u00e9p di chuy\u1ec3n qua l\u1ea1i d\u1ec5 d\u00e0ng b\u1eb1ng <\/span><span style=\"font-weight: 400;\">pushd<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">popd<\/span><span style=\"font-weight: 400;\"> v\u00e0 <\/span><span style=\"font-weight: 400;\">dirs<\/span><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Ch\u1ebf \u0111\u1ed9 h\u1ea1n ch\u1ebf (Restricted Mode):<\/b><span style=\"font-weight: 400;\"> Khi Bash ch\u1ea1y \u1edf ch\u1ebf \u0111\u1ed9 h\u1ea1n ch\u1ebf (<\/span><span style=\"font-weight: 400;\">rbash<\/span><span style=\"font-weight: 400;\"> ho\u1eb7c <\/span><span style=\"font-weight: 400;\">bash &#8211;restricted<\/span><span style=\"font-weight: 400;\">), n\u00f3 gi\u1edbi h\u1ea1n quy\u1ec1n th\u1ef1c thi l\u1ec7nh \u0111\u1ec3 t\u0103ng t\u00ednh b\u1ea3o m\u1eadt.<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Bash_Script_la_gi\"><\/span><b>Bash Script l\u00e0 g\u00ec?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Bash Script l\u00e0 m\u1ed9t t\u1eadp h\u1ee3p c\u00e1c l\u1ec7nh Bash \u0111\u01b0\u1ee3c vi\u1ebft trong m\u1ed9t file (th\u01b0\u1eddng c\u00f3 ph\u1ea7n m\u1edf r\u1ed9ng <\/span><span style=\"font-weight: 400;\">.sh<\/span><span style=\"font-weight: 400;\">) v\u00e0 th\u1ef1c thi t\u1ef1 \u0111\u1ed9ng thay v\u00ec nh\u1eadp t\u1eebng l\u1ec7nh th\u1ee7 c\u00f4ng tr\u00ean terminal.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Bash Script gi\u00fap t\u1ef1 \u0111\u1ed9ng h\u00f3a c\u00e1c t\u00e1c v\u1ee5 thay v\u00ec nh\u1eadp th\u1ee7 c\u00f4ng t\u1eebng l\u1ec7nh tr\u00ean terminal. N\u00f3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 qu\u1ea3n l\u00fd h\u1ec7 th\u1ed1ng, sao l\u01b0u d\u1eef li\u1ec7u, c\u00e0i \u0111\u1eb7t ph\u1ea7n m\u1ec1m v\u00e0 ch\u1ea1y l\u1ec7nh h\u00e0ng lo\u1ea1t.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5: M\u1ed9t Bash Script \u0111\u01a1n gi\u1ea3n \u0111\u1ec3 in ra d\u00f2ng ch\u1eef \u201cXin ch\u00e0o, Bash!\u201d:<\/span><\/p>\n<pre>#!\/bin\/bash\r\n\r\necho \"Xin ch\u00e0o, Bash!\"<\/pre>\n<p><span style=\"font-weight: 400;\">Sau khi l\u01b0u file v\u1edbi t\u00ean <\/span><span style=\"font-weight: 400;\">script.sh<\/span><span style=\"font-weight: 400;\">, b\u1ea1n c\u00f3 th\u1ec3 th\u1ef1c thi n\u00f3 b\u1eb1ng c\u00e1ch:<\/span><\/p>\n<pre>chmod +x script.sh\u00a0 # C\u1ea5p quy\u1ec1n ch\u1ea1y cho script\r\n\r\n.\/script.sh \u00a0 \u00a0 \u00a0 \u00a0 # Ch\u1ea1y script<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Vi_sao_nen_su_dung_Bash\"><\/span><b>V\u00ec sao n\u00ean s\u1eed d\u1ee5ng Bash?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>D\u1ec5 h\u1ecdc v\u00e0 d\u1ec5 s\u1eed d\u1ee5ng<\/b><span style=\"font-weight: 400;\">: Bash c\u00f3 c\u00fa ph\u00e1p \u0111\u01a1n gi\u1ea3n, d\u1ec5 hi\u1ec3u ngay c\u1ea3 v\u1edbi ng\u01b0\u1eddi m\u1edbi (v\u00ed d\u1ee5: l\u1ec7nh echo \u0111\u1ec3 in text). C\u00f3 nhi\u1ec1u t\u00e0i li\u1ec7u v\u00e0 h\u01b0\u1edbng d\u1eabn mi\u1ec5n ph\u00ed gi\u00fap b\u1ea1n nhanh ch\u00f3ng l\u00e0m quen.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Gi\u00fap c\u1ea3i thi\u1ec7n k\u1ef9 n\u0103ng l\u1eadp tr\u00ecnh<\/b><span style=\"font-weight: 400;\">: H\u1ecdc Bash gi\u00fap b\u1ea1n hi\u1ec3u r\u00f5 c\u00e1ch h\u1ec7 \u0111i\u1ec1u h\u00e0nh ho\u1ea1t \u0111\u1ed9ng, l\u00e0m quen v\u1edbi bi\u1ebfn, v\u00f2ng l\u1eb7p, \u0111i\u1ec1u ki\u1ec7n, t\u1eeb \u0111\u00f3 d\u1ec5 d\u00e0ng ti\u1ebfp c\u1eadn c\u00e1c ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh kh\u00e1c nh\u01b0 Python, JavaScript.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>T\u0103ng hi\u1ec7u su\u1ea5t l\u00e0m vi\u1ec7c<\/b><span style=\"font-weight: 400;\">: Bash gi\u00fap t\u1ef1 \u0111\u1ed9ng h\u00f3a c\u00e1c t\u00e1c v\u1ee5 nh\u01b0 sao l\u01b0u d\u1eef li\u1ec7u, qu\u1ea3n l\u00fd file, ki\u1ec3m tra h\u1ec7 th\u1ed1ng, gi\u00fap ti\u1ebft ki\u1ec7m th\u1eddi gian v\u00e0 gi\u1ea3m thao t\u00e1c l\u1eb7p l\u1ea1i.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>H\u1ed7 tr\u1ee3 l\u00e0m vi\u1ec7c v\u1edbi nhi\u1ec1u h\u1ec7 \u0111i\u1ec1u h\u00e0nh<\/b><span style=\"font-weight: 400;\">: Bash c\u00f3 m\u1eb7t tr\u00ean Linux, macOS v\u00e0 c\u00f3 th\u1ec3 d\u00f9ng tr\u00ean Windows qua Git Bash ho\u1eb7c WSL (Windows Subsystem for Linux), gi\u00fap b\u1ea1n l\u00e0m vi\u1ec7c linh ho\u1ea1t tr\u00ean nhi\u1ec1u n\u1ec1n t\u1ea3ng.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>M\u1edf r\u1ed9ng c\u01a1 h\u1ed9i ngh\u1ec1 nghi\u1ec7p<\/b><span style=\"font-weight: 400;\">: Bi\u1ebft Bash l\u00e0 m\u1ed9t l\u1ee3i th\u1ebf l\u1edbn cho l\u1eadp tr\u00ecnh vi\u00ean, DevOps, qu\u1ea3n tr\u1ecb h\u1ec7 th\u1ed1ng, v\u00ec nhi\u1ec1u c\u00f4ng vi\u1ec7c IT y\u00eau c\u1ea7u k\u1ef9 n\u0103ng shell scripting.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>H\u1ed7 tr\u1ee3 l\u00e0m vi\u1ec7c nh\u00f3m v\u00e0 qu\u1ea3n l\u00fd d\u1ef1 \u00e1n<\/b><span style=\"font-weight: 400;\">:\u00a0 Bash chu\u1ea9n h\u00f3a quy tr\u00ecnh l\u00e0m vi\u1ec7c qua script t\u00e1i s\u1eed d\u1ee5ng \u0111\u1ec3 ki\u1ec3m tra, tri\u1ec3n khai \u1ee9ng d\u1ee5ng, gi\u00fap \u0111\u1ed9i nh\u00f3m ph\u1ed1i h\u1ee3p hi\u1ec7u qu\u1ea3 h\u01a1n.<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Phan_biet_Bash_Script_va_Shell_Script\"><\/span><b>Ph\u00e2n bi\u1ec7t Bash Script v\u00e0 Shell Script<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<table>\n<tbody>\n<tr>\n<td><b>Ti\u00eau ch\u00ed<\/b><\/td>\n<td><b>Bash Script<\/b><\/td>\n<td><b>Shell Script<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">\u0110\u1ecbnh ngh\u0129a<\/span><\/td>\n<td><span style=\"font-weight: 400;\">L\u00e0 m\u1ed9t d\u1ea1ng c\u1ee7a Shell Script, nh\u01b0ng c\u00f3 nhi\u1ec1u t\u00ednh n\u0103ng n\u00e2ng cao h\u01a1n v\u00e0 ch\u1ec9 ch\u1ea1y tr\u00ean Bash Shell<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Script c\u00f3 th\u1ec3 ch\u1ea1y tr\u00ean nhi\u1ec1u lo\u1ea1i shell kh\u00e1c nhau (sh, ksh, csh, zsh&#8230;).<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">T\u00ednh ph\u1ed5 bi\u1ebfn<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Ph\u1ed5 bi\u1ebfn tr\u00ean Linux, macOS, v\u00e0 Windows (qua Git Bash).<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u0110\u01b0\u1ee3c d\u00f9ng tr\u00ean nhi\u1ec1u h\u1ec7 th\u1ed1ng Unix\/Linux v\u1edbi c\u00e1c shell kh\u00e1c nhau.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">T\u00ednh n\u0103ng<\/span><\/td>\n<td><span style=\"font-weight: 400;\">H\u1ed7 tr\u1ee3 m\u1ea3ng, to\u00e1n t\u1eed logic m\u1edf r\u1ed9ng, <\/span><span style=\"font-weight: 400;\">[[ &#8230; ]]<\/span><span style=\"font-weight: 400;\">, l\u1ecbch s\u1eed l\u1ec7nh.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00cdt t\u00ednh n\u0103ng n\u00e2ng cao h\u01a1n, ch\u1ee7 y\u1ebfu d\u1ef1a tr\u00ean Bourne Shell (sh).<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">T\u00ednh t\u01b0\u01a1ng th\u00edch<\/span><\/td>\n<td><span style=\"font-weight: 400;\">C\u00f3 th\u1ec3 ch\u1ea1y h\u1ea7u h\u1ebft c\u00e1c script c\u1ee7a Shell Script.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Kh\u00f4ng ph\u1ea3i t\u1ea5t c\u1ea3 shell \u0111\u1ec1u h\u1ed7 tr\u1ee3 Bash Script.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Shebang s\u1eed d\u1ee5ng<\/span><\/td>\n<td><span style=\"font-weight: 400;\">#!\/bin\/bash<\/span><\/td>\n<td><span style=\"font-weight: 400;\">#!\/bin\/sh<\/span><span style=\"font-weight: 400;\"> (ho\u1eb7c c\u00e1c shell kh\u00e1c nh\u01b0 <\/span><span style=\"font-weight: 400;\">#!\/bin\/ksh<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">#!\/bin\/csh<\/span><span style=\"font-weight: 400;\">).<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span class=\"ez-toc-section\" id=\"Cach_chay_script_Bash_Shell_co_ban\"><\/span><b>C\u00e1ch ch\u1ea1y script Bash Shell c\u01a1 b\u1ea3n<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">D\u01b0\u1edbi \u0111\u00e2y l\u00e0 m\u1ed9t v\u00ed d\u1ee5 Bash Script \u0111\u1ec3 hi\u1ec3n th\u1ecb l\u1eddi ch\u00e0o v\u00e0 th\u1ef1c hi\u1ec7n m\u1ed9t ph\u00e9p to\u00e1n nh\u01b0 sau:<\/span><\/p>\n<pre>#!\/bin\/bash\r\n\r\n# Hi\u1ec3n th\u1ecb l\u1eddi ch\u00e0o\r\necho \"Xin ch\u00e0o! \u0110\u00e2y l\u00e0 m\u1ed9t script Bash \u0111\u01a1n gi\u1ea3n.\"\r\n\r\n# Nh\u1eadp t\u00ean t\u1eeb ng\u01b0\u1eddi d\u00f9ng\r\necho \"Nh\u1eadp t\u00ean c\u1ee7a b\u1ea1n:\"\r\nread name\r\n\r\n# Hi\u1ec3n th\u1ecb t\u00ean ng\u01b0\u1eddi d\u00f9ng\r\necho \"Ch\u00e0o, $name! Ch\u00fac b\u1ea1n m\u1ed9t ng\u00e0y t\u1ed1t l\u00e0nh.\"\r\n\r\n# Nh\u1eadp hai s\u1ed1 v\u00e0 t\u00ednh t\u1ed5ng\r\necho \"Nh\u1eadp s\u1ed1 th\u1ee9 nh\u1ea5t:\"\r\nread num1\r\necho \"Nh\u1eadp s\u1ed1 th\u1ee9 hai:\"\r\nread num2\r\n\r\n# T\u00ednh t\u1ed5ng v\u00e0 hi\u1ec3n th\u1ecb k\u1ebft qu\u1ea3\r\nsum=$((num1 + num2))\r\necho \"T\u1ed5ng c\u1ee7a $num1 v\u00e0 $num2 l\u00e0: $sum\"<\/pre>\n<p><span style=\"font-weight: 400;\">C\u00e1ch ch\u1ea1y script:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>L\u01b0u file: <\/b><span style=\"font-weight: 400;\">v\u1edbi \u0111u\u00f4i <\/span><span style=\"font-weight: 400;\">.sh<\/span><span style=\"font-weight: 400;\">, v\u00ed d\u1ee5: <\/span><span style=\"font-weight: 400;\">hello.sh<\/span><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>C\u1ea5p quy\u1ec1n th\u1ef1c thi cho script:<\/b><\/li>\n<\/ol>\n<pre>chmod +x hello.sh<b><\/b><\/pre>\n<ul>\n<li aria-level=\"1\"><b>Ch\u1ea1y script:<\/b><\/li>\n<\/ul>\n<pre>.\/hello.sh<\/pre>\n<p><span style=\"font-weight: 400;\">Gi\u1ea3i th\u00edch:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">echo<\/span>: Hi\u1ec3n th\u1ecb n\u1ed9i dung ra terminal.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">read<\/span> <span style=\"font-weight: 400;\">name<\/span>: Nh\u1eadp d\u1eef li\u1ec7u t\u1eeb ng\u01b0\u1eddi d\u00f9ng.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">$name<\/span>: Bi\u1ebfn l\u01b0u t\u00ean ng\u01b0\u1eddi d\u00f9ng.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">read<\/span> <span style=\"font-weight: 400;\">num1<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">read<\/span> <span style=\"font-weight: 400;\">num2<\/span>: Nh\u1eadp hai s\u1ed1 t\u1eeb b\u00e0n ph\u00edm.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">sum=$((num1 + num2))<\/span>: T\u00ednh t\u1ed5ng hai s\u1ed1.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">echo<\/span>: In k\u1ebft qu\u1ea3 ra m\u00e0n h\u00ecnh.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Cau_hoi_thuong_gap_ve_Bash_Shell\"><\/span><b>C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 Bash Shell<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>Bash l\u00e0 shell hay terminal?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Bash l\u00e0 shell \u2013 tr\u00ecnh th\u00f4ng d\u1ecbch l\u1ec7nh gi\u00fap ng\u01b0\u1eddi d\u00f9ng g\u1eedi c\u00e1c l\u1ec7nh \u0111\u1ebfn h\u1ec7 \u0111i\u1ec1u h\u00e0nh, kh\u00f4ng ph\u1ea3i l\u00e0 terminal. Terminal l\u00e0 \u1ee9ng d\u1ee5ng cung c\u1ea5p giao di\u1ec7n \u0111\u1ec3 b\u1ea1n t\u01b0\u01a1ng t\u00e1c v\u1edbi shell, v\u00ed d\u1ee5 nh\u01b0 terminal tr\u00ean Linux ho\u1eb7c Command Prompt tr\u00ean Windows. Khi m\u1edf terminal, b\u1ea1n c\u00f3 th\u1ec3 ch\u1ea1y Bash b\u00ean trong \u0111\u00f3, nh\u01b0ng ch\u00fang kh\u00f4ng ph\u1ea3i l\u00e0 m\u1ed9t.<\/span><\/p>\n<h3><b>Bash Shell c\u00f3 ph\u1ea3i l\u00e0 Terminal kh\u00f4ng?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Kh\u00f4ng, Bash Shell kh\u00f4ng ph\u1ea3i l\u00e0 terminal. Bash l\u00e0 c\u00f4ng c\u1ee5 d\u00f2ng l\u1ec7nh (command interpreter) ch\u1ea1y b\u00ean trong terminal, trong khi terminal ch\u1ec9 l\u00e0 giao di\u1ec7n hi\u1ec3n th\u1ecb v\u00e0 nh\u1eadp l\u1ec7nh.\u00a0<\/span><\/p>\n<h3><b>C\u00f3 th\u1ec3 d\u00f9ng Bash tr\u00ean Windows kh\u00f4ng?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">C\u00f3, b\u1ea1n c\u00f3 th\u1ec3 d\u00f9ng Bash tr\u00ean Windows th\u00f4ng qua c\u00e1c c\u00f4ng c\u1ee5 nh\u01b0 Git Bash ho\u1eb7c Windows Subsystem for Linux (WSL). Nh\u1eefng c\u00f4ng c\u1ee5 n\u00e0y cung c\u1ea5p m\u00f4i tr\u01b0\u1eddng Bash \u0111\u1ec3 ch\u1ea1y c\u00e1c l\u1ec7nh t\u01b0\u01a1ng t\u1ef1 nh\u01b0 tr\u00ean Linux v\u00e0 macOS.<\/span><\/p>\n<h3><b>Bash c\u00f3 gi\u1ed1ng CLI (Command Line Interface) kh\u00f4ng?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Bash cung c\u1ea5p giao di\u1ec7n CLI (Command Line Interface), nh\u01b0ng CLI l\u00e0 thu\u1eadt ng\u1eef chung \u0111\u1ec3 ch\u1ec9 b\u1ea5t k\u1ef3 giao di\u1ec7n d\u00f2ng l\u1ec7nh n\u00e0o. N\u00f3i c\u00e1ch kh\u00e1c, Bash l\u00e0 m\u1ed9t v\u00ed d\u1ee5 c\u1ee5 th\u1ec3 c\u1ee7a CLI, nh\u01b0ng kh\u00f4ng ph\u1ea3i t\u1ea5t c\u1ea3 c\u00e1c CLI \u0111\u1ec1u l\u00e0 Bash.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Tong_ket_Bash_Shell\"><\/span><b>T\u1ed5ng k\u1ebft Bash Shell<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Bash kh\u00f4ng ch\u1ec9 l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 h\u1ed7 tr\u1ee3 th\u1ef1c thi l\u1ec7nh m\u00e0 c\u00f2n l\u00e0 n\u1ec1n t\u1ea3ng quan tr\u1ecdng trong qu\u1ea3n tr\u1ecb h\u1ec7 th\u1ed1ng v\u00e0 ph\u00e1t tri\u1ec3n ph\u1ea7n m\u1ec1m. V\u1edbi kh\u1ea3 n\u0103ng k\u1ebft h\u1ee3p nhi\u1ec1u l\u1ec7nh, x\u1eed l\u00fd d\u1eef li\u1ec7u v\u00e0 t\u1ef1 \u0111\u1ed9ng h\u00f3a c\u00f4ng vi\u1ec7c, Bash gi\u00fap ti\u1ebft ki\u1ec7m th\u1eddi gian v\u00e0 t\u0103ng hi\u1ec7u su\u1ea5t l\u00e0m vi\u1ec7c.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bash Shell l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 quan tr\u1ecdng trong Unix\/Linux, gi\u00fap ng\u01b0\u1eddi d\u00f9ng th\u1ef1c thi l\u1ec7nh v\u00e0 qu\u1ea3n l\u00fd h\u1ec7 th\u1ed1ng th\u00f4ng qua d\u00f2ng l\u1ec7nh. Bash kh\u00f4ng ch\u1ec9 cung c\u1ea5p c\u00e1c l\u1ec7nh c\u01a1 b\u1ea3n m\u00e0 c\u00f2n h\u1ed7 tr\u1ee3 nhi\u1ec1u t\u00ednh n\u0103ng n\u00e2ng cao nh\u01b0 scripting, \u0111i\u1ec1u h\u01b0\u1edbng file, qu\u1ea3n l\u00fd ti\u1ebfn tr\u00ecnh v\u00e0 t\u1ef1 \u0111\u1ed9ng [&hellip;]<\/p>\n","protected":false},"author":209,"featured_media":85261,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_gspb_post_css":"","footnotes":""},"categories":[109],"tags":[],"class_list":["post-85002","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chuyen-mon-it"],"blocksy_meta":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.8 (Yoast SEO v27.8) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Bash Shell l\u00e0 g\u00ec? C\u00e1c t\u00ednh n\u0103ng ch\u00ednh c\u1ee7a Bash Shell - ITviec Blog<\/title>\n<meta name=\"description\" content=\"T\u00ecm hi\u1ec3u Bash Shell l\u00e0 g\u00ec, c\u00e1ch ho\u1ea1t \u0111\u1ed9ng, t\u00ednh n\u0103ng v\u00e0 v\u00ec sao n\u00ean s\u1eed d\u1ee5ng Bash \u0111\u1ec3 qu\u1ea3n l\u00fd h\u1ec7 th\u1ed1ng v\u00e0 t\u1ef1 \u0111\u1ed9ng h\u00f3a t\u00e1c v\u1ee5.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bash Shell l\u00e0 g\u00ec? C\u00e1c t\u00ednh n\u0103ng ch\u00ednh c\u1ee7a Bash Shell\" \/>\n<meta property=\"og:description\" content=\"Bash Shell l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 quan tr\u1ecdng trong Unix\/Linux, gi\u00fap ng\u01b0\u1eddi d\u00f9ng th\u1ef1c thi l\u1ec7nh v\u00e0 qu\u1ea3n l\u00fd h\u1ec7 th\u1ed1ng th\u00f4ng qua d\u00f2ng l\u1ec7nh. Bash kh\u00f4ng ch\u1ec9 cung c\u1ea5p c\u00e1c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/\" \/>\n<meta property=\"og:site_name\" content=\"ITviec Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ITviec\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-25T06:27:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/bash-shell-vippro-scaled.png\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"337\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"M\u1ef9 Duy\u00ean\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ITviec\" \/>\n<meta name=\"twitter:site\" content=\"@ITviec\" \/>\n<meta name=\"twitter:label1\" content=\"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi\" \/>\n\t<meta name=\"twitter:data1\" content=\"M\u1ef9 Duy\u00ean\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 ph\u00fat\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Bash Shell l\u00e0 g\u00ec? C\u00e1c t\u00ednh n\u0103ng ch\u00ednh c\u1ee7a Bash Shell - ITviec Blog","description":"T\u00ecm hi\u1ec3u Bash Shell l\u00e0 g\u00ec, c\u00e1ch ho\u1ea1t \u0111\u1ed9ng, t\u00ednh n\u0103ng v\u00e0 v\u00ec sao n\u00ean s\u1eed d\u1ee5ng Bash \u0111\u1ec3 qu\u1ea3n l\u00fd h\u1ec7 th\u1ed1ng v\u00e0 t\u1ef1 \u0111\u1ed9ng h\u00f3a t\u00e1c v\u1ee5.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/","og_locale":"vi_VN","og_type":"article","og_title":"Bash Shell l\u00e0 g\u00ec? C\u00e1c t\u00ednh n\u0103ng ch\u00ednh c\u1ee7a Bash Shell","og_description":"Bash Shell l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 quan tr\u1ecdng trong Unix\/Linux, gi\u00fap ng\u01b0\u1eddi d\u00f9ng th\u1ef1c thi l\u1ec7nh v\u00e0 qu\u1ea3n l\u00fd h\u1ec7 th\u1ed1ng th\u00f4ng qua d\u00f2ng l\u1ec7nh. Bash kh\u00f4ng ch\u1ec9 cung c\u1ea5p c\u00e1c","og_url":"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/","og_site_name":"ITviec Blog","article_publisher":"https:\/\/www.facebook.com\/ITviec","article_published_time":"2025-03-25T06:27:09+00:00","og_image":[{"width":640,"height":337,"url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/bash-shell-vippro-scaled.png","type":"image\/png"}],"author":"M\u1ef9 Duy\u00ean","twitter_card":"summary_large_image","twitter_creator":"@ITviec","twitter_site":"@ITviec","twitter_misc":{"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi":"M\u1ef9 Duy\u00ean","\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"14 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/#article","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/"},"author":{"name":"M\u1ef9 Duy\u00ean","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/73733c0725c7e39e696a896bd1abe2d7"},"headline":"Bash Shell l\u00e0 g\u00ec? C\u00e1c t\u00ednh n\u0103ng ch\u00ednh c\u1ee7a Bash Shell","datePublished":"2025-03-25T06:27:09+00:00","mainEntityOfPage":{"@id":"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/"},"wordCount":3726,"publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"image":{"@id":"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/bash-shell-vippro-scaled.png","articleSection":["Chuy\u00ean m\u00f4n IT"],"inLanguage":"vi"},{"@type":"WebPage","@id":"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/","url":"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/","name":"Bash Shell l\u00e0 g\u00ec? C\u00e1c t\u00ednh n\u0103ng ch\u00ednh c\u1ee7a Bash Shell - ITviec Blog","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/#primaryimage"},"image":{"@id":"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/bash-shell-vippro-scaled.png","datePublished":"2025-03-25T06:27:09+00:00","description":"T\u00ecm hi\u1ec3u Bash Shell l\u00e0 g\u00ec, c\u00e1ch ho\u1ea1t \u0111\u1ed9ng, t\u00ednh n\u0103ng v\u00e0 v\u00ec sao n\u00ean s\u1eed d\u1ee5ng Bash \u0111\u1ec3 qu\u1ea3n l\u00fd h\u1ec7 th\u1ed1ng v\u00e0 t\u1ef1 \u0111\u1ed9ng h\u00f3a t\u00e1c v\u1ee5.","breadcrumb":{"@id":"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itviec.com\/blog\/bash-shell-la-gi\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/#primaryimage","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/bash-shell-vippro-scaled.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/bash-shell-vippro-scaled.png","width":640,"height":337,"caption":"bash shell - itviec blog"},{"@type":"BreadcrumbList","@id":"https:\/\/itviec.com\/blog\/bash-shell-la-gi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Chuy\u00ean m\u00f4n IT","item":"https:\/\/itviec.com\/blog\/chuyen-mon-it\/"},{"@type":"ListItem","position":2,"name":"Bash Shell l\u00e0 g\u00ec? C\u00e1c t\u00ednh n\u0103ng ch\u00ednh c\u1ee7a Bash Shell"}]},{"@type":"WebSite","@id":"https:\/\/itviec.com\/blog\/#website","url":"https:\/\/itviec.com\/blog\/","name":"ITviec Blog","description":"IT Jobs &amp; People in Vietnam","publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itviec.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"vi"},{"@type":"Organization","@id":"https:\/\/itviec.com\/blog\/#organization","name":"ITviec","url":"https:\/\/itviec.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","width":1800,"height":1800,"caption":"ITviec"},"image":{"@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ITviec","https:\/\/x.com\/ITviec","https:\/\/www.linkedin.com\/company\/itviec","https:\/\/www.youtube.com\/channel\/UCYthAQ3bcGr57M_ag5gHDvQ"]},{"@type":"Person","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/73733c0725c7e39e696a896bd1abe2d7","name":"M\u1ef9 Duy\u00ean","image":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/Author_Duyen-Tran-120x120.jpg","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/Author_Duyen-Tran-120x120.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/Author_Duyen-Tran-120x120.jpg","caption":"M\u1ef9 Duy\u00ean"},"url":"https:\/\/itviec.com\/blog\/author\/my-duyen\/"}]}},"_links":{"self":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/85002","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/users\/209"}],"replies":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/comments?post=85002"}],"version-history":[{"count":0,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/85002\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media\/85261"}],"wp:attachment":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media?parent=85002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/categories?post=85002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/tags?post=85002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}