{"id":2914,"date":"2023-07-31T19:27:30","date_gmt":"2023-07-31T13:57:30","guid":{"rendered":"https:\/\/smarttech101.com\/?p=2914"},"modified":"2024-02-22T21:18:44","modified_gmt":"2024-02-22T15:48:44","slug":"bash-commands-in-linux-with-examples","status":"publish","type":"post","link":"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/","title":{"rendered":"Bash Commands in Linux With Examples"},"content":{"rendered":"\n<p class=\"\">Welcome to our guide on &#8220;Bash Commands in Linux.&#8221; In this article, I&#8217;ll introduce you to some important tools you can use in the Linux terminal. We&#8217;ll explore variables in bash, and some basic operations used along with bash like copying files, displaying text, moving and deleting files, listing directories, and searching for specific words. These commands will  boost your productivity. So, welcome aboard as we embark on an exciting journey into the world of Bash commands in Linux! Let&#8217;s get started!<\/p>\n\n\n\n<p class=\"\">Bash is a shell in Linux. It is default shell in most of the Linux based distros. Until now, even Mac used it as default shell. Using it you can execute any command.<\/p>\n\n\n\n<p class=\"\">It is a POSIX compliant shell so whatever commands I teach you here most of them will be applicable in other POSIX compliant shells like dash, zsh, etc.<\/p>\n\n\n\n<p class=\"\"><strong>\ud83d\udcdd Note<\/strong>: These commands have been tasted on Linux. But they should work with any Unix based system such as Mac and Windows Subsystem for Linux.<\/p>\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_69_1 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 \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/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:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#Variables_in_bash_commands_in_Linux\" title=\"Variables in bash commands in Linux\">Variables in bash commands in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#Output_of_a_variable_in_bash_shell_in_Linux\" title=\"Output of a variable in bash shell in Linux\">Output of a variable in bash shell in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#Some_important_tools_used_with_bash_command_in_Linux\" title=\"Some important tools used with bash command in Linux\">Some important tools used with bash command in Linux<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#copy_command_in_Linux\" title=\"copy command in Linux\">copy command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#echo_command_in_Linux\" title=\"echo command in Linux\">echo command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#pwd_command_in_Linux\" title=\"pwd command in Linux\">pwd command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#cd_command_in_Linux\" title=\"cd command in Linux\">cd command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#Moving_and_Renaming_Files_with_mv\" title=\"Moving and Renaming Files with mv\">Moving and Renaming Files with mv<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#touch_command_in_Linux\" title=\"touch command in Linux\">touch command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#rm_command_in_Linux\" title=\"rm command in Linux\">rm command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#ls_command_in_Linux\" title=\"ls command in Linux\">ls command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#grep_command_in_Linux\" title=\"grep command in Linux\">grep command in Linux<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#Conclusion\" title=\"Conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Variables_in_bash_commands_in_Linux\"><\/span>Variables in bash commands in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"\">To learn about <a href=\"https:\/\/smarttech101.com\/how-to-create-shell-scripts-in-linux-unix\/#variables_and_basic_commands_in_bash_shell_in_linux\">what are variables, how to define them, put a value inside a variable and get a value out of variable, look at this article<\/a>.<\/p>\n\n\n\n<p class=\"\">Here, I am going to describe these in short.<\/p>\n\n\n\n<p class=\"\">Variables are defined in the following way:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ variable=value<\/code><\/pre>\n\n\n\n<p class=\"\"><strong>Examples for Integer<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ x=3<\/code><\/pre>\n\n\n\n<p class=\"\"><strong>Examples for String:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ y=\"ajay_yadav\"<\/code><\/pre>\n\n\n\n<p class=\"\">It is good to always <strong>use quotes around your values,<\/strong> otherwise, you might get errors caused by &#8220;splitting&#8221;, or &#8220;substitution&#8221;. They are not errors per se. These splitting and substitution have a special application. I will talk about them in later articles.. Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ y=\"ajay yadav\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Output_of_a_variable_in_bash_shell_in_Linux\"><\/span>Output of a variable in bash shell in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"\">To get the value of a variable, prepend <code>$<\/code> just before it. For example, to get the value of x, use <code>$x<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ x=3\n&#091;ajay@legion ~]$ echo \"$x\"\n3<\/code><\/pre>\n\n\n\n<p class=\"\"><a href=\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/\" target=\"_blank\" rel=\"noreferrer noopener\">Another useful bash feature is brash expansion. Have a look about that in this article.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Some_important_tools_used_with_bash_command_in_Linux\"><\/span>Some important tools used with bash command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"\">Commands like <code>pwd<\/code>, <code>cd<\/code>, <code>mv<\/code>, <code>cp<\/code>, <code>touch<\/code>, <code>rm<\/code>, <code>echo<\/code>, <code>ls<\/code>, <code>grep<\/code> etc. are very useful basic commands in Linux. They are not part of <code>bash<\/code> per se. But they are used very often. So, please learn them as you learn bash. I am going to give you short description of each.<\/p>\n\n\n\n<p class=\"\"><strong>\ud83d\ude04 Note:<\/strong> Most of these commands like <code>mv<\/code>, <code>cp<\/code>, <code>rm<\/code> works in the same way. You will see as I describe all of them below.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"copy_command_in_Linux\"><\/span>copy command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"\">Here are the few copy command <code>cp<\/code> I use while working with bash commands in Linux. <a href=\"https:\/\/smarttech101.com\/copy-command-cp-in-linux-unix\/\">To learn about the <code>cp<\/code> command in detail, look at this article<\/a>.<\/p>\n\n\n\n<p class=\"\">To copy <code>file1<\/code>&#8216;s content into <code>file2<\/code> execute:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ cp file1 file2<\/code><\/pre>\n\n\n\n<p class=\"\">If <code>file2<\/code> exists, its contents are replaced. If you use directory name at the place of <code>file2<\/code>, <code>file1<\/code> will be copied to that directory.<\/p>\n\n\n\n<p class=\"\">For verbose output, use <code>-v<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ cp -v ~\/Downloads\/10th.pdf .\n'\/home\/ajay\/Downloads\/10th.pdf' -&gt; '.\/10th.pdf'<\/code><\/pre>\n\n\n\n<p class=\"\">For <code>cp<\/code> in interactive mode, use <code>-i<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ cp -v ~\/Downloads\/10th.pdf .\n'\/home\/ajay\/Downloads\/10th.pdf' -&gt; '.\/10th.pdf'\n\n&#091;ajay@legion ~]$ cp -i ~\/Downloads\/10th.pdf .\ncp: overwrite '.\/10th.pdf'? y<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ cp -vi ~\/Downloads\/10th.pdf .\n'\/home\/ajay\/Downloads\/10th.pdf' -&gt; '.\/10th.pdf'\n\n&#091;ajay@legion ~]$ cp -vi ~\/Downloads\/10th.pdf .\ncp: overwrite '.\/10th.pdf'? y\n'\/home\/ajay\/Downloads\/10th.pdf' -&gt; '.\/10th.pdf'<\/code><\/pre>\n\n\n\n<p class=\"\">To copy one directory into another, use <code>-r<\/code> or <code>--recursive<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ cp -r \/tmp\/from\/ \/tmp\/to\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"echo_command_in_Linux\"><\/span>echo command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"\"><a href=\"https:\/\/smarttech101.com\/echo-with-examples\/\">To learn about the <code>echo<\/code> in detail, look at this article on echo<\/a>.<\/p>\n\n\n\n<p class=\"\">The <code>echo<\/code> command in Linux is used to display text or output messages to the terminal. It is a simple and versatile command that comes in handy while writing bash scripts.<\/p>\n\n\n\n<p class=\"\">To display a message, just use <code>echo<\/code> followed by the text you want to show:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ echo \"Hello, World!\"\nHello, World!<\/code><\/pre>\n\n\n\n<p class=\"\">The <code>echo<\/code> command can also be used to print the values of variables:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ name=\"Alice\"\n$ echo \"Hello, $name!\"\nHello, Alice!<\/code><\/pre>\n\n\n\n<p class=\"\">Moreover, you can <strong>redirect<\/strong> the output of <code>echo<\/code> to a file using the <code>&gt;<\/code> operator:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ echo \"This will be saved in a file.\" &gt; output.txt<\/code><\/pre>\n\n\n\n<p class=\"\">The text &#8220;This will be saved in a file.&#8221; will be written to a file named <code>output.txt<\/code>.<\/p>\n\n\n\n<p class=\"\"><code>echo<\/code> is often used in bash scripts to provide information to users, display status messages, or generate program output. It is a fundamental command that simplifies displaying text and variables in the terminal.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"pwd_command_in_Linux\"><\/span>pwd command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"\">Another useful command in Linux is <code>pwd<\/code>, which stands for &#8220;Print Working Directory.&#8221; When you run the <code>pwd<\/code> command, it displays the full path of your current working directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ pwd\n\/home\/ajay<\/code><\/pre>\n\n\n\n<p class=\"\">This is particularly handy when you&#8217;re navigating through different directories and want to know your current location. For instance, if you move to a subdirectory like <code>Documents<\/code>, the <code>pwd<\/code> command will show:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ cd Documents\n&#091;ajay@legion Documents]$ pwd\n\/home\/ajay\/Documents<\/code><\/pre>\n\n\n\n<p class=\"\">The <code>pwd<\/code> command becomes essential when dealing with complex file structures, or whenever you need to reference your current location in the bash scripts. It provides a clear and concise way to keep track of your working directory and facilitates smooth navigation within the Linux environment.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"cd_command_in_Linux\"><\/span>cd command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"\">Let&#8217;s explore another fundamental command in the Linux terminal \u2013 <code>cd<\/code>, which stands for &#8220;Change Directory.&#8221;<\/p>\n\n\n\n<p class=\"\">With the <code>cd<\/code> command, you can navigate through the file system and switch between different directories effortlessly. To change the working directory to a specific location, simply type <code>cd<\/code> followed by the desired directory path:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ cd Documents<\/code><\/pre>\n\n\n\n<p class=\"\">After executing the above command, you will find yourself in the &#8220;Documents&#8221; directory. To go back to the previous directory, you can use <code>cd<\/code> with the <code>..<\/code> notation, like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion Documents]$ cd ..\n&#091;ajay@legion ~]$<\/code><\/pre>\n\n\n\n<p class=\"\">This takes you back to your home directory. If you ever need to return to the home directory from anywhere else, just type <code>cd<\/code> with no arguments:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion Downloads]$ cd\n&#091;ajay@legion ~]$<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Moving_and_Renaming_Files_with_mv\"><\/span>Moving and Renaming Files with <code>mv<\/code><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"\">The <code>mv<\/code> command in Linux is used to move or rename files and directories. It allows you to change the location or name of a file within the file system. Here&#8217;s how you can use the <code>mv<\/code> command:<\/p>\n\n\n\n<p class=\"\">To move a file or directory from one location to another:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv source_path destination_path<\/code><\/pre>\n\n\n\n<p class=\"\">For example, to move a file named <code>file1.txt<\/code> from the current directory to the <code>Documents<\/code> directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv file1.txt Documents\/<\/code><\/pre>\n\n\n\n<p class=\"\">This will move <code>file1.txt<\/code> to the <code>Documents<\/code> directory.<\/p>\n\n\n\n<p class=\"\">To rename a file or directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv old_name new_name<\/code><\/pre>\n\n\n\n<p class=\"\">For instance, if you want to rename <code>file1.txt<\/code> to <code>new_file.txt<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv file1.txt new_file.txt<\/code><\/pre>\n\n\n\n<p class=\"\">This will rename the file to <code>new_file.txt<\/code>.<\/p>\n\n\n\n<p class=\"\">If a file with the same name exists in the destination directory while moving, <code>mv<\/code> will overwrite it. To avoid accidental overwrites, use the <code>-i<\/code> (interactive) option:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv -i source_path destination_path<\/code><\/pre>\n\n\n\n<p class=\"\">This will prompt you before overwriting any existing files.<\/p>\n\n\n\n<p class=\"\">For a more verbose output, you can use the <code>-v<\/code> (verbose) option:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv -v source_path destination_path<\/code><\/pre>\n\n\n\n<p class=\"\">This will display each action taken by <code>mv<\/code>, providing you with more details.<\/p>\n\n\n\n<p class=\"\">Keep in mind that if the destination path is a directory, the source will be moved into that directory. However, if the destination path is a non-existing directory, <code>mv<\/code> will rename the source file to the new name.<\/p>\n\n\n\n<p class=\"\">Using the <code>mv<\/code> command, you can easily organize and manage your files and directories in the bash script.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"touch_command_in_Linux\"><\/span>touch command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"\">Another useful tool is <code>touch<\/code> used with bash commands in Linux. If you&#8217;re interested in a <a href=\"https:\/\/smarttech101.com\/touch-command-in-linux-unix-with-examples\/\" target=\"_blank\" rel=\"noreferrer noopener\">detailed explanation of the <code>touch<\/code> command, you can refer to this informative article<\/a>.<\/p>\n\n\n\n<p class=\"\">The <code>touch<\/code> command in Linux is a versatile utility used primarily to create new, empty files or update the timestamp of existing files. It is particularly useful when you need to create a new file quickly or modify the last access and modification times of a file.<\/p>\n\n\n\n<p class=\"\">To create a new empty file, simply type <code>touch<\/code> followed by the desired file name:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ touch new_file.txt<\/code><\/pre>\n\n\n\n<p class=\"\">This command will generate a new file named <code>new_file.txt<\/code> in your current working directory. If the file already exists, the <code>touch<\/code> command will update its modification timestamp to the current time without altering the file&#8217;s content.<\/p>\n\n\n\n<p class=\"\">Moreover, <code>touch<\/code> allows you to set specific timestamps for files using the <code>-t<\/code> option. The following example shows how to set a custom timestamp for a file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ touch -t 202207221030 custom_timestamp.txt<\/code><\/pre>\n\n\n\n<p class=\"\">In this case, the <code>custom_timestamp.txt<\/code> file will have a timestamp of July 22, 2022, at 10:30 AM.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"rm_command_in_Linux\"><\/span>rm command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"\">The <code>rm<\/code> command, which stands for &#8220;remove,&#8221; is a powerful and potentially dangerous tool used to delete files and directories in the Linux terminal. It allows you to permanently remove files from the file system, and it&#8217;s essential to exercise caution while using this command, as deleted files cannot be easily recovered.<\/p>\n\n\n\n<p class=\"\">To delete a single file, use the <code>rm<\/code> command followed by the file name:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ rm unwanted_file.txt<\/code><\/pre>\n\n\n\n<p class=\"\">Once executed, the file <code>unwanted_file.txt<\/code> will be deleted, and it cannot be retrieved from the system&#8217;s trash or recycle bin.<\/p>\n\n\n\n<p class=\"\">To remove multiple files simultaneously, you can specify them as arguments with space separation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ rm file1.txt file2.txt file3.txt<\/code><\/pre>\n\n\n\n<p class=\"\">The <code>rm<\/code> command also supports the use of wildcard characters, such as <code>*<\/code>, to remove files based on specific patterns:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ rm *.txt<\/code><\/pre>\n\n\n\n<p class=\"\">In this example, all files with the <code>.txt<\/code> extension in the current directory will be deleted.<\/p>\n\n\n\n<p class=\"\">If you want to remove directories, you can use the <code>-r<\/code> or <code>--recursive<\/code> option with <code>rm<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ rm -r unwanted_directory\/<\/code><\/pre>\n\n\n\n<p class=\"\">The <code>-r<\/code> option ensures that all files and subdirectories within the specified directory are recursively removed.<\/p>\n\n\n\n<p class=\"\">To minimize the risk of accidental deletions, you can use the <code>-i<\/code> or <code>--interactive<\/code> option, which prompts you for confirmation before removing each file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ rm -i sensitive_file.txt\nrm: remove regular file 'sensitive_file.txt'? y<\/code><\/pre>\n\n\n\n<p class=\"\">Always double-check the files and directories you are about to delete, especially when using the <code>-r<\/code> or <code>-i<\/code> options.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"ls_command_in_Linux\"><\/span>ls command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"\">The <code>ls<\/code> command is one of the most basic and frequently used with bash commands in Linux. It stands for &#8220;list&#8221; and is used to display the contents of a directory. By default, when you run the <code>ls<\/code> command without any arguments, it lists the files and directories in your current working directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ ls\nDesktop    Documents    Downloads    Music    Pictures    Videos<\/code><\/pre>\n\n\n\n<p class=\"\">The output displays the names of the files and subdirectories present in the current directory.<\/p>\n\n\n\n<p class=\"\">To list the contents of a specific directory, simply provide the directory path as an argument to the <code>ls<\/code> command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ ls \/path\/to\/directory\nfile1.txt   file2.txt   subdirectory1   subdirectory2<\/code><\/pre>\n\n\n\n<p class=\"\">The <code>ls<\/code> command also offers several useful options to customize the listing output. For example, you can use the <code>-l<\/code> option to obtain detailed information about the files and directories, such as permissions, owner, size, and modification date:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ ls -l\n-rw-r--r-- 1 ajay users  4096 Jul 28 10:15 file1.txt\n-rw-r--r-- 1 ajay users  2048 Jul 28 10:20 file2.txt\ndrwxr-xr-x 2 ajay users  4096 Jul 28 10:30 subdirectory1\ndrwxr-xr-x 3 ajay users  4096 Jul 28 10:35 subdirectory2<\/code><\/pre>\n\n\n\n<p class=\"\">For a more human-readable file size representation, use the <code>-h<\/code> (human-readable) option:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ ls -lh\n-rw-r--r-- 1 ajay users 4.0K Jul 28 10:15 file1.txt\n-rw-r--r-- 1 ajay users 2.0K Jul 28 10:20 file2.txt\ndrwxr-xr-x 2 ajay users 4.0K Jul 28 10:30 subdirectory1\ndrwxr-xr-x 3 ajay users 4.0K Jul 28 10:35 subdirectory2<\/code><\/pre>\n\n\n\n<p class=\"\">You can also use the <code>-a<\/code> (all) option to display hidden files (those starting with a dot):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ ls -a\n.        ..        .config   .bashrc   file1.txt    file2.txt<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"grep_command_in_Linux\"><\/span>grep command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"\">let&#8217;s explore the <code>grep<\/code> command in Linux. <a href=\"https:\/\/smarttech101.com\/grep-command-in-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">For a more comprehensive understanding of the <code>grep<\/code> command, you can refer to this informative article<\/a>.<\/p>\n\n\n\n<p class=\"\">The <code>grep<\/code> command is a powerful text search tool used in Linux to find patterns or specific strings within files or streams of text. It stands for &#8220;Global Regular Expression Print,&#8221; and it&#8217;s one of the most versatile commands for text processing and filtering.<\/p>\n\n\n\n<p class=\"\">The basic usage of <code>grep<\/code> is as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ grep pattern file.txt<\/code><\/pre>\n\n\n\n<p class=\"\">In this example, <code>pattern<\/code> represents the text you want to search for, and <code>file.txt<\/code> is the file you want to search within. The <code>grep<\/code> command will then display all lines in <code>file.txt<\/code> that contain the specified pattern.<\/p>\n\n\n\n<p class=\"\">For example, let&#8217;s say we have a file named <code>sample.txt<\/code> with the following content:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Hello, this is a sample text file.\nThis file contains some sample data.\nPlease search for the word \"sample\".\nThis is fourth line<\/code><\/pre>\n\n\n\n<p class=\"\">To find all occurrences of the word &#8220;sample&#8221; in <code>sample.txt<\/code>, you would run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ grep \"sample\" sample.txt\nHello, this is a sample text file.\nThis file contains some sample data.\nPlease search for the word \"sample\".<\/code><\/pre>\n\n\n\n<p class=\"\">By default, <code>grep<\/code> is case-sensitive. However, you can use the <code>-i<\/code> option to perform a case-insensitive search:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ grep -i \"hello\" sample.txt\nHello, this is a sample text file.<\/code><\/pre>\n\n\n\n<p class=\"\"><code>grep<\/code> is highly flexible and supports regular expressions, allowing you to perform complex pattern matching. For example, using regular expressions, you can search for lines starting with a specific word:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ grep \"^Hello\" sample.txt\nHello, this is a sample text file.<\/code><\/pre>\n\n\n\n<p class=\"\">To count the number of occurrences of a pattern, use the <code>-c<\/code> option:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ grep -c \"sample\" sample.txt\n3<\/code><\/pre>\n\n\n\n<p class=\"\">In this case, <code>grep<\/code> returns the number &#8220;3,&#8221; indicating that the word &#8220;sample&#8221; appears thrice in the <code>sample.txt<\/code> file.<\/p>\n\n\n\n<p class=\"\">The <code>grep<\/code> command is an invaluable tool for searching and extracting information from text files efficiently. It is widely used in scripting, log analysis, and various data processing tasks, making it a must-know command for Linux users.<\/p>\n\n\n\n<p class=\"\">Another most widely<a href=\"https:\/\/smarttech101.com\/printf-command-in-linux-with-examples-and-their-outputs\/\"> used command in bash is printf &#8211; learn about it here.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"\">That&#8217;s all about folks. Most of these tools are used frequently with bash commands in Linux. So learn more and more about them. If you have any suggestions\/queries, read the man page at <code>man bash<\/code>, <code>man ls<\/code>, <code>man cp<\/code> and other relavant commands related to bash. Or, you put them in the command section below. If you are not satisfied with the features provided by the bash, you can look at <a href=\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/\">another POSIX compliant shell but much powerful than the bash &#8211; zsh<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p> In this article, I&#8217;ll introduce you to some important tools you can use in the Linux terminal. We&#8217;ll explore variables in bash, and some basic operations used along with bash like copying files, displaying text, moving and deleting files, listing directories, and searching for specific words. These commands will  boost your productivity. So, welcome aboard as we embark on an exciting journey into the world of Bash commands in Linux! Let&#8217;s get started!<\/p>\n","protected":false},"author":2,"featured_media":2926,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[58],"tags":[18,35],"class_list":["post-2914","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash","tag-command-line-tools","tag-core-linux-utilities"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Bash Commands in Linux With Examples | SmartTech101<\/title>\n<meta name=\"description\" content=\"Master Bash commands in Linux: variables, output, copy, echo, pwd, cd, mv, touch, rm, ls, and grep. Boost productivity in the terminal.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bash Commands in Linux With Examples | SmartTech101\" \/>\n<meta property=\"og:description\" content=\"Master Bash commands in Linux: variables, output, copy, echo, pwd, cd, mv, touch, rm, ls, and grep. Boost productivity in the terminal.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/\" \/>\n<meta property=\"og:site_name\" content=\"SmartTech101\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-31T13:57:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-22T15:48:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/smarttech101.com\/wp-content\/uploads\/2023\/07\/Bash-Commands-in-Linux-With-Examples.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ajay\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ajay_yadav\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ajay\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/\"},\"author\":{\"name\":\"Ajay\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334\"},\"headline\":\"Bash Commands in Linux With Examples\",\"datePublished\":\"2023-07-31T13:57:30+00:00\",\"dateModified\":\"2024-02-22T15:48:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/\"},\"wordCount\":1873,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/07\/Bash-Commands-in-Linux-With-Examples.png?fit=1280%2C720&ssl=1\",\"keywords\":[\"Command Line Tools\",\"core linux utilities\"],\"articleSection\":[\"bash\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/\",\"url\":\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/\",\"name\":\"Bash Commands in Linux With Examples | SmartTech101\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/07\/Bash-Commands-in-Linux-With-Examples.png?fit=1280%2C720&ssl=1\",\"datePublished\":\"2023-07-31T13:57:30+00:00\",\"dateModified\":\"2024-02-22T15:48:44+00:00\",\"description\":\"Master Bash commands in Linux: variables, output, copy, echo, pwd, cd, mv, touch, rm, ls, and grep. Boost productivity in the terminal.\",\"breadcrumb\":{\"@id\":\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/07\/Bash-Commands-in-Linux-With-Examples.png?fit=1280%2C720&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/07\/Bash-Commands-in-Linux-With-Examples.png?fit=1280%2C720&ssl=1\",\"width\":1280,\"height\":720,\"caption\":\"bash commands in Linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/smarttech101.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bash Commands in Linux With Examples\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/smarttech101.com\/#website\",\"url\":\"https:\/\/smarttech101.com\/\",\"name\":\"SmartTech101\",\"description\":\"Do Everything in Linux\",\"publisher\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/smarttech101.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\",\"name\":\"Ajay Yadav\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1\",\"width\":180,\"height\":60,\"caption\":\"Ajay Yadav\"},\"logo\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334\",\"name\":\"Ajay\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g\",\"caption\":\"Ajay\"},\"sameAs\":[\"https:\/\/x.com\/ajay_yadav\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bash Commands in Linux With Examples | SmartTech101","description":"Master Bash commands in Linux: variables, output, copy, echo, pwd, cd, mv, touch, rm, ls, and grep. Boost productivity in the terminal.","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:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/","og_locale":"en_US","og_type":"article","og_title":"Bash Commands in Linux With Examples | SmartTech101","og_description":"Master Bash commands in Linux: variables, output, copy, echo, pwd, cd, mv, touch, rm, ls, and grep. Boost productivity in the terminal.","og_url":"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/","og_site_name":"SmartTech101","article_published_time":"2023-07-31T13:57:30+00:00","article_modified_time":"2024-02-22T15:48:44+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/smarttech101.com\/wp-content\/uploads\/2023\/07\/Bash-Commands-in-Linux-With-Examples.png","type":"image\/png"}],"author":"Ajay","twitter_card":"summary_large_image","twitter_creator":"@ajay_yadav","twitter_misc":{"Written by":"Ajay","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#article","isPartOf":{"@id":"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/"},"author":{"name":"Ajay","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334"},"headline":"Bash Commands in Linux With Examples","datePublished":"2023-07-31T13:57:30+00:00","dateModified":"2024-02-22T15:48:44+00:00","mainEntityOfPage":{"@id":"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/"},"wordCount":1873,"commentCount":0,"publisher":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633"},"image":{"@id":"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/07\/Bash-Commands-in-Linux-With-Examples.png?fit=1280%2C720&ssl=1","keywords":["Command Line Tools","core linux utilities"],"articleSection":["bash"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/","url":"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/","name":"Bash Commands in Linux With Examples | SmartTech101","isPartOf":{"@id":"https:\/\/smarttech101.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#primaryimage"},"image":{"@id":"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/07\/Bash-Commands-in-Linux-With-Examples.png?fit=1280%2C720&ssl=1","datePublished":"2023-07-31T13:57:30+00:00","dateModified":"2024-02-22T15:48:44+00:00","description":"Master Bash commands in Linux: variables, output, copy, echo, pwd, cd, mv, touch, rm, ls, and grep. Boost productivity in the terminal.","breadcrumb":{"@id":"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#primaryimage","url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/07\/Bash-Commands-in-Linux-With-Examples.png?fit=1280%2C720&ssl=1","contentUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/07\/Bash-Commands-in-Linux-With-Examples.png?fit=1280%2C720&ssl=1","width":1280,"height":720,"caption":"bash commands in Linux"},{"@type":"BreadcrumbList","@id":"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/smarttech101.com\/"},{"@type":"ListItem","position":2,"name":"Bash Commands in Linux With Examples"}]},{"@type":"WebSite","@id":"https:\/\/smarttech101.com\/#website","url":"https:\/\/smarttech101.com\/","name":"SmartTech101","description":"Do Everything in Linux","publisher":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/smarttech101.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633","name":"Ajay Yadav","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/","url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1","contentUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1","width":180,"height":60,"caption":"Ajay Yadav"},"logo":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/"}},{"@type":"Person","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334","name":"Ajay","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g","caption":"Ajay"},"sameAs":["https:\/\/x.com\/ajay_yadav"]}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/07\/Bash-Commands-in-Linux-With-Examples.png?fit=1280%2C720&ssl=1","_links":{"self":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2914"}],"collection":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/comments?post=2914"}],"version-history":[{"count":5,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2914\/revisions"}],"predecessor-version":[{"id":3320,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2914\/revisions\/3320"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media\/2926"}],"wp:attachment":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media?parent=2914"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/categories?post=2914"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/tags?post=2914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}