{"id":6335,"date":"2019-03-12T09:45:47","date_gmt":"2019-03-12T14:45:47","guid":{"rendered":"https:\/\/www.poweradmin.com\/blog\/?p=6335"},"modified":"2019-03-05T15:05:34","modified_gmt":"2019-03-05T21:05:34","slug":"essential-shell-commands-for-linux","status":"publish","type":"post","link":"https:\/\/www.poweradmin.com\/blog\/essential-shell-commands-for-linux\/","title":{"rendered":"Essential Shell Commands for Linux"},"content":{"rendered":"<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"color: #000000;\"><strong><span style=\"font-family: 'Arial',sans-serif;\">By Des Nnochiri<\/span><\/strong><\/span><\/p>\n<p>\u00a0<\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">Even if the Linux distribution that you\u2019re using has a GUI (Graphical User Interface), it\u2019s likely that the bulk of your work will involve shell commands, entered via a command line terminal. Basic shell programming, application development, and the more complex aspects of network monitoring and administration will all proceed from the foundation of Linux shell commands, which are used to perform a wide range of functions.<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">In this article, we\u2019ve assembled a core set of the essential commands that you\u2019re likely to need in the Linux environment.<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<h2><span style=\"font-family: 'Arial',sans-serif;\">The Linux Command Line Interface (CLI)<\/span><\/h2>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">To access the Linux shell, you must first open the terminal before entering the command line interface (CLI). <\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">If you\u2019re working in Ubuntu, press Ctrl+Alt+T or press Alt+F2, type in gnome-terminal, and press Enter. In the Raspberry Pi environment, type in lxterminal. <\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">Note that the <a href=\"https:\/\/www.quora.com\/What-are-the-topics-on-Linux\/answer\/Narasimha-Prasanna-HN\" rel=\"nofollow\" target=\"_blank\">command line environments<img class=\"extlink-icon\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/plugins\/external-links-nofollow-open-in-new-tab-favicon\/images\/extlink.png\"><\/a> of all Linux operating systems function in lower case. This stems from the core principle of making Linux as easy to use as possible. File, folder, and directory names created by a user may contain upper case (capital) letters, but the underlying system itself responds to lower case command line syntax.<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">This restriction has consequences if you\u2019re in the habit of using mixed upper and lower case lettering in file names. Unless you specify the qualifier -i (the \u201cnegate case lock\u201d parameter), file names containing capital letters won\u2019t show up in any file or directory listings that you call for. For example, the command:<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">locate sunsetthunder.mp3<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">won\u2019t locate the file SunsetThunder.mp3 unless you use -i:<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">locate -i sunsetthunder.mp3<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<h2><span style=\"font-family: 'Arial',sans-serif;\">Consulting the Manual (man)<\/span><\/h2>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\"> <a href=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/manual-page.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6338\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/manual-page-300x181.jpg\" alt=\"\" width=\"450\" height=\"271\" srcset=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/manual-page-300x181.jpg 300w, https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/manual-page.jpg 722w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\"><\/a><\/span><\/p>\n<p>\u00a0<\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">(Image source: <a href=\"https:\/\/maker.pro\/linux\/tutorial\/basic-linux-commands-for-beginners\" rel=\"nofollow\" target=\"_blank\">Maker Pro<img class=\"extlink-icon\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/plugins\/external-links-nofollow-open-in-new-tab-favicon\/images\/extlink.png\"><\/a>)<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\"><a href=\"http:\/\/www.informit.com\/blogs\/blog.aspx?uk=The-10-Most-Important-Linux-Commands\" rel=\"nofollow\" target=\"_blank\">Described by some<img class=\"extlink-icon\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/plugins\/external-links-nofollow-open-in-new-tab-favicon\/images\/extlink.png\"><\/a><\/span><span style=\"font-family: 'Arial',sans-serif;\"> as \u201cthe meta command of the Linux CLI\u201d, the manual (or man) command displays information about the Linux command that you specify, essentially displaying a reference manual for that chosen command. For example, entering:<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">man cd<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">will display information concerning the cd command described below.<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<h2><span style=\"font-family: 'Arial',sans-serif;\">The List Command<\/span><\/h2>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">Used for viewing files, folders, and directories, the list command (ls) will display all of the major directories filed under a given file system. E.g.:<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\"><a href=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/list-command.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6341\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/list-command-300x32.jpg\" alt=\"\" width=\"450\" height=\"47\" srcset=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/list-command-300x32.jpg 300w, https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/list-command.jpg 722w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\"><\/a>\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">(Image source: <a href=\"https:\/\/geek-university.com\/linux\/essential-linux-commands\/\" rel=\"nofollow\" target=\"_blank\">Geek University<img class=\"extlink-icon\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/plugins\/external-links-nofollow-open-in-new-tab-favicon\/images\/extlink.png\"><\/a>)<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">will return all the folders stored in the overall applications folder. If no directory has been specified, the command will display the contents of the working directory.<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<h2><span style=\"font-family: 'Arial',sans-serif;\">Changing Directory (cd)<\/span><\/h2>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">The cd command allows the user to switch or change between different file directories. The screenshot below illustrates an example of using this syntax in Ubuntu.<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\"><a href=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/changing-directory.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6343\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/changing-directory-300x68.jpg\" alt=\"\" width=\"450\" height=\"103\" srcset=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/changing-directory-300x68.jpg 300w, https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/changing-directory.jpg 723w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\"><\/a>\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">(Image source: <a href=\"https:\/\/geek-university.com\/linux\/essential-linux-commands\/\" rel=\"nofollow\" target=\"_blank\">Geek University<img class=\"extlink-icon\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/plugins\/external-links-nofollow-open-in-new-tab-favicon\/images\/extlink.png\"><\/a>)<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">To change the current working directory, you have to specify the path of the directory that you would like to access. <\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<h2><span style=\"font-family: 'Arial',sans-serif;\">Creating a New Directory (mkdir)<\/span><\/h2>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">The \u201cmake directory\u201d or mkdir command does exactly what it says. To create a new directory, you must specify its name. If you don\u2019t specify a path, the new directory will be created inside the working directory. The screenshot below illustrates the use of the mkdir command in conjunction with the list command (ls).<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\"> <a href=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/creating-new-directory.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6345\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/creating-new-directory-300x40.jpg\" alt=\"\" width=\"450\" height=\"60\" srcset=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/creating-new-directory-300x40.jpg 300w, https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/creating-new-directory.jpg 722w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\"><\/a><\/span><\/p>\n<p>\u00a0<\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">(Image source: <a href=\"https:\/\/geek-university.com\/linux\/essential-linux-commands\/\" rel=\"nofollow\" target=\"_blank\">Geek University<img class=\"extlink-icon\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/plugins\/external-links-nofollow-open-in-new-tab-favicon\/images\/extlink.png\"><\/a>)<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<h2><span style=\"font-family: 'Arial',sans-serif;\">Creating Files (touch)<\/span><\/h2>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">The touch command is used to create a new file. It may be used for files of all kinds \u2013 the file type must therefore be specified in the syntax. For example:<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\"> <a href=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/creating-files.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6346\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/creating-files-300x31.jpg\" alt=\"\" width=\"450\" height=\"47\" srcset=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/creating-files-300x31.jpg 300w, https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/creating-files.jpg 723w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\"><\/a><\/span><\/p>\n<p>\u00a0<\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">(Image source: <a href=\"https:\/\/maker.pro\/linux\/tutorial\/basic-linux-commands-for-beginners\" rel=\"nofollow\" target=\"_blank\">Maker Pro<img class=\"extlink-icon\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/plugins\/external-links-nofollow-open-in-new-tab-favicon\/images\/extlink.png\"><\/a>)<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">will create a new (blank) text file, named new.txt.<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<h2><span style=\"font-family: 'Arial',sans-serif;\">Locating Files (locate)<\/span><\/h2>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">As seen previously, the locate command may be used to search for specific files within a folder or directory. In addition to the -i parameter (which tells Linux to search for the file, irrespective of its combination of lower case and capital letters), you may use asterisks (*) as wildcards to widen your search criteria.<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\"><a href=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/locating-files.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6350\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/locating-files-300x32.jpg\" alt=\"\" width=\"450\" height=\"48\" srcset=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/locating-files-300x32.jpg 300w, https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/locating-files.jpg 723w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\"><\/a>\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">(Image source: <a href=\"https:\/\/maker.pro\/linux\/tutorial\/basic-linux-commands-for-beginners\" rel=\"nofollow\" target=\"_blank\">Maker Pro<img class=\"extlink-icon\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/plugins\/external-links-nofollow-open-in-new-tab-favicon\/images\/extlink.png\"><\/a>)<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<h2><span style=\"font-family: 'Arial',sans-serif;\">Moving Files (mv)<\/span><\/h2>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">The mv or \u201cmove\u201d command is the Linux CLI equivalent of a drag-and-drop operation in Windows or macOS. It lets you move a file to another folder or directory. <\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">The first part of the command identifies the file or application to be moved, while the second specifies the destination directory for the application or file. <\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\"> <a href=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/moving-files.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6352\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/moving-files-300x39.jpg\" alt=\"\" width=\"450\" height=\"58\" srcset=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/moving-files-300x39.jpg 300w, https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/moving-files.jpg 723w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\"><\/a><\/span><\/p>\n<p>\u00a0<\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">(Image source: <a href=\"https:\/\/maker.pro\/linux\/tutorial\/basic-linux-commands-for-beginners\" rel=\"nofollow\" target=\"_blank\">Maker Pro<img class=\"extlink-icon\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/plugins\/external-links-nofollow-open-in-new-tab-favicon\/images\/extlink.png\"><\/a>)<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<h2><span style=\"font-family: 'Arial',sans-serif;\">Removing Files and Directories (rm)<\/span><\/h2>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">Used without a modifier, the rm or \u201cremove\u201d command deletes the specified folder or directory, and all the files that it contains. The syntax \u201crm -r\u201d must be used to delete only the directory.<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\"> <a href=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/removing-files-and-directories.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6354\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/removing-files-and-directories-300x62.jpg\" alt=\"\" width=\"450\" height=\"94\" srcset=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/removing-files-and-directories-300x62.jpg 300w, https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/removing-files-and-directories.jpg 721w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\"><\/a><\/span><\/p>\n<p>\u00a0<\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">(Image source: <a href=\"https:\/\/maker.pro\/linux\/tutorial\/basic-linux-commands-for-beginners\" rel=\"nofollow\" target=\"_blank\">Maker Pro<img class=\"extlink-icon\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/plugins\/external-links-nofollow-open-in-new-tab-favicon\/images\/extlink.png\"><\/a>)<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<h2><span style=\"font-family: 'Arial',sans-serif;\">Removing Empty Folders (rmdir)<\/span><\/h2>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">A less powerful variant of the \u201cremove\u201d command, rmdir is used to remove directories with no files or applications in them. <\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<h2><span style=\"font-family: 'Arial',sans-serif;\">The pwd Command<\/span><\/h2>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">You can invoke the pwd command to find out where in the Linux environment you currently are. \u201cpwd\u201d stands for \u201cprint working directory\u201d, <\/span><span style=\"font-family: 'Arial',sans-serif;\">and the command output displays the name of the current working directory.<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\"><a href=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/pwd-command.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6357\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/pwd-command-300x23.jpg\" alt=\"\" width=\"450\" height=\"35\" srcset=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/pwd-command-300x23.jpg 300w, https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/pwd-command.jpg 722w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\"><\/a>\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">(Image source: <a href=\"https:\/\/geek-university.com\/linux\/essential-linux-commands\/\" rel=\"nofollow\" target=\"_blank\">Geek University<img class=\"extlink-icon\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/plugins\/external-links-nofollow-open-in-new-tab-favicon\/images\/extlink.png\"><\/a>)<\/span><\/p>\n<h2><span style=\"font-family: 'Arial',sans-serif;\">Specifying Text Output (echo)<\/span><\/h2>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">Used to output text to the screen, the echo command can also assist in moving (usually text-based) data into a file. <\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\"> <a href=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/echo-text-output.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6358\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/echo-text-output-300x23.jpg\" alt=\"\" width=\"450\" height=\"35\" srcset=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/echo-text-output-300x23.jpg 300w, https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/echo-text-output.jpg 722w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\"><\/a><\/span><\/p>\n<p>\u00a0<\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">(Image source: <a href=\"https:\/\/geek-university.com\/linux\/essential-linux-commands\/\" rel=\"nofollow\" target=\"_blank\">Geek University<img class=\"extlink-icon\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/plugins\/external-links-nofollow-open-in-new-tab-favicon\/images\/extlink.png\"><\/a>)<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">To create a new text file or add to an existing one, type echo, followed by the text string that you wish to append. E.g.:<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">echo hello, today is tuesday &gt;&gt; new.txt<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">The two triangular brackets (&gt;&gt;) are used to indicate the end of your text string.<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<h2><span style=\"font-family: 'Arial',sans-serif;\">Displaying User Information (whoami)<\/span><\/h2>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">To discover and display the identity of the currently logged in user, the whoami command may be invoked. <\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\"> <a href=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/whoami-command.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6360\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/whoami-command-300x25.jpg\" alt=\"\" width=\"450\" height=\"38\" srcset=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/whoami-command-300x25.jpg 300w, https:\/\/www.poweradmin.com\/blog\/wp-content\/uploads\/2019\/03\/whoami-command.jpg 726w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\"><\/a><\/span><\/p>\n<p>\u00a0<\/p>\n<p style=\"margin-bottom: .0001pt; text-align: center; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">(Image source: <a href=\"https:\/\/geek-university.com\/linux\/essential-linux-commands\/\" rel=\"nofollow\" target=\"_blank\">Geek University<img class=\"extlink-icon\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/plugins\/external-links-nofollow-open-in-new-tab-favicon\/images\/extlink.png\"><\/a>)<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<h2><span style=\"font-family: 'Arial',sans-serif;\">Clearing the Screen (clear)<\/span><\/h2>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">If your command line display is becoming cluttered\u2014or you simply want to start over with a fresh slate\u2014typing \u201cclear\u201d will wipe the screen and take you back to the start prompt of whichever directory you are currently working in.<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\"><span style=\"font-family: 'Arial',sans-serif;\">If you\u2019d like to delve deeper into the world of the Linux command line, the Search Data Center at TechTarget has a resource that it calls <a href=\"https:\/\/searchdatacenter.techtarget.com\/tutorial\/77-Linux-commands-and-utilities-youll-actually-use\" rel=\"nofollow\" target=\"_blank\">80 Linux commands you\u2019ll actually use<img class=\"extlink-icon\" src=\"https:\/\/www.poweradmin.com\/blog\/wp-content\/plugins\/external-links-nofollow-open-in-new-tab-favicon\/images\/extlink.png\"><\/a>, which includes all of the above commands and numerous others.<\/span><\/p>\n<p style=\"margin-bottom: .0001pt; line-height: normal; text-autospace: none;\">\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By Des Nnochiri \u00a0 Even if the Linux distribution that you\u2019re using has a GUI (Graphical User Interface), it\u2019s likely that the bulk of your work will involve shell commands, entered via a command line terminal. Basic shell programming, application development, and the more complex aspects of network monitoring and administration will all proceed from [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":6363,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,9],"tags":[548,530,532,534,547,398,526,529,538,426,420,533,525,537,541,536,535,539,542,545,546,531,543,544,527,528,540,462],"class_list":["post-6335","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general-it","category-technical","tag-clear","tag-cli","tag-command-line-environment","tag-command-line-syntax","tag-echo","tag-linux","tag-linux-command","tag-linux-command-line-interface","tag-linux-directory","tag-linux-interface","tag-linux-network","tag-linux-operating-system","tag-linux-shell","tag-list-command","tag-locate","tag-man","tag-manual-page","tag-mkdir","tag-mv","tag-pwd","tag-pwd-command","tag-raspberry-pi","tag-rm","tag-rmdir","tag-shell-command","tag-shell-programming","tag-touch","tag-ubuntu"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.poweradmin.com\/blog\/wp-json\/wp\/v2\/posts\/6335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.poweradmin.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.poweradmin.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.poweradmin.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.poweradmin.com\/blog\/wp-json\/wp\/v2\/comments?post=6335"}],"version-history":[{"count":5,"href":"https:\/\/www.poweradmin.com\/blog\/wp-json\/wp\/v2\/posts\/6335\/revisions"}],"predecessor-version":[{"id":6364,"href":"https:\/\/www.poweradmin.com\/blog\/wp-json\/wp\/v2\/posts\/6335\/revisions\/6364"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.poweradmin.com\/blog\/wp-json\/wp\/v2\/media\/6363"}],"wp:attachment":[{"href":"https:\/\/www.poweradmin.com\/blog\/wp-json\/wp\/v2\/media?parent=6335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.poweradmin.com\/blog\/wp-json\/wp\/v2\/categories?post=6335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.poweradmin.com\/blog\/wp-json\/wp\/v2\/tags?post=6335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}