{"id":240,"date":"2016-07-30T13:23:01","date_gmt":"2016-07-30T10:23:01","guid":{"rendered":"https:\/\/community.virtono.com\/?p=240"},"modified":"2016-07-30T13:23:01","modified_gmt":"2016-07-30T10:23:01","slug":"15-most-basic-linux-commands","status":"publish","type":"post","link":"https:\/\/www.virtono.com\/community\/knowledgebase\/15-most-basic-linux-commands\/","title":{"rendered":"15 Most Basic Linux commands"},"content":{"rendered":"<p>Linux is different, I know you already know that, and if are on this article you\u2019ve taken your first step into the amazin world of Linux OS (little exaggeration).<\/p>\n<p>Here I am going to provide a common command list most commonly used in Linux with their brief introduction.<\/p>\n<p><strong># 1: cd<\/strong><\/p>\n<p>The \u201cChange Directory\u201d command enables you to navigate to another directory.<\/p>\n<p>The cd command is THE most important command there is in linux I think. As the command suggests, it enables the user to change \/ jump to a directory.<\/p>\n<p>pi@raspberrypi: ~$\u00a0cd \/home\/pi<\/p>\n<p>pi@raspberrypi ~$pwd<\/p>\n<p>\/home\/pi<\/p>\n<p>note: After you have typed cd and entering the first or two letters of the directory you can press the TAB key to autocomplete the directory! so\u2026 cd\u00a0 Do (press tabkey) will autocomplete it to Downloads. i use this a lot &lt;\u2013<\/p>\n<p><strong>#2: man<\/strong><\/p>\n<p>The man command shows the users the \u201cmanual\u201d of the command. In some situation you might need to get more information about the command you are using. The man command shows you this information about the command.<\/p>\n<p>pi@raspberrypi: man cp<\/p>\n<p>This will open up the \u201ccp\u201d manual document for us in the shell. The manual shows us the parameters available for the commands.<\/p>\n<p>Note: To close the manual simply press \u201cQ\u201d.<\/p>\n<p><strong>#3: ls<\/strong><\/p>\n<p>In the absolute top 15 there\u2019s no way the ls command is missing. On the third place, the ls command. The ls command is used to list the files\/directories within a directory.<\/p>\n<p>pi@raspberrypi: ~$ ls<\/p>\n<p>Desktop python_games<\/p>\n<p>pi@raspberrypi: ~$<\/p>\n<p><strong>#4: cp<\/strong><\/p>\n<p>The cp command is available for us to \u201cCopy\u201d things. This might be usefull for duplicating files f.e.<\/p>\n<p>pi@raspberrypi: ~$ cd pifun<\/p>\n<p>[pi@raspberrypi pifun]$ cp pi pi2<\/p>\n<p>[pi@raspberrypi pifun]$ ls<\/p>\n<p>pi pi2 raspberry<\/p>\n<p>[pi@raspberrypi pifun]$<\/p>\n<p>note: file is on this case the file the user wants to be copied\u2026 file2 is the name of the copied file. It\u2019s that simple.<\/p>\n<p><strong>#5 mv<\/strong><\/p>\n<p>The mv command is used for \u201cMove\u201d operations. The mv commands enables the users to move a file\/directory to a specified location.<\/p>\n<p>pi@raspberrypi: ~$ cd pifun<\/p>\n<p>[pi@raspberrypi pifun]$ mv\u00a0pi pi2<\/p>\n<p>[pi@raspberrypi pifun]$ ls<\/p>\n<p>pi2 raspberry<\/p>\n<p>[pi@raspberrypi pifun]$<\/p>\n<p>note: the first part of the command is the file that has to be moved. The second part (after the whitespace) is the target directory. Make sure you type in the full path using this command!<\/p>\n<p><strong>#6 mkdir<\/strong><\/p>\n<p>This command is used to \u201cmake\u201d directories, NOT Files.. (thit is possible with another command which i will bring up later in this tutorial)<\/p>\n<p>pi@raspberrypi: ~$ mkdir pifun<\/p>\n<p>pi@raspberrypi: ~$ mkdir pifun<\/p>\n<p>mkdir: cannot create directory &#8216;pifun&#8217;: File exists<\/p>\n<p>pi@raspberrypi: ~$<\/p>\n<p>note: The name of the directory is case sensitive which means that Testdirectory is a complete different directory as testdirectory.<\/p>\n<p><strong>#7 rmdir<\/strong><\/p>\n<p>When you are able to make directories, you also want to know how to remove them. Removing directories is done by the rmdir command and belongs to the absolute basic commands in shell bashing.<\/p>\n<p>[pi@raspberrypi pifun]$ rmdir moarpi2<\/p>\n<p>[pi@raspberrypi pifun]$ rm moarpi<\/p>\n<p>rm: cannot remove &#8216;moarpi&#8217;: Is a directory<\/p>\n<p>[pi@raspberrypi pifun]$<\/p>\n<p>note: When the directory is not empty the command will prompt an error message:<\/p>\n<p>rmdir: failed to remove `fiets\u2019: Directory not empty<\/p>\n<p>So make sure it\u2019s completely empty before removing it.<\/p>\n<p><strong>#8 touch<\/strong><\/p>\n<p>Now we know how to make directories and deleting them, i now want to use the touch command. The touch command is used to make files.<\/p>\n<p>pi@raspberrypi: ~$ touch raspberry<\/p>\n<p>pi@raspberrypi: ~$ touch pi<\/p>\n<p>pi@raspberrypi: ~$ ls<\/p>\n<p>Desktop pi python_games raspberry<\/p>\n<p>pi@raspberrypi: ~$<\/p>\n<p>This will create the file vogel for us in the directory.<\/p>\n<p><strong>#9 rm<\/strong><\/p>\n<p>The rm command stand for remove. The rm command is used in order the delete files instead of directories.<\/p>\n<p>[pi@raspberrypi pifun]$ rm moarpi<\/p>\n<p>rm: cannot remove &#8216;moarpi&#8217;: Is a directory<\/p>\n<p>[pi@raspberrypi pifun]$<\/p>\n<p>note: To remove files you must have the right permission bits set on the specific file.<\/p>\n<p><strong>#10 tar<\/strong><\/p>\n<p>Sometimes you have to archive files. Archiving files is a way to pack a set of files to one single file. The operation is done by the tar command.<\/p>\n<p>[pi@raspberrypi pifun]$ tar -cvf test.tar test (Creating a tar file from directory or file test)<\/p>\n<p>&nbsp;<\/p>\n<p>[pi@raspberrypi pifun]$ tar -xvf test.tar myexctractfolder (Extracts the particular tar file in the current working directory)<\/p>\n<p>In the example i used parameters. These parameters are telling the tar command how to behave and how to execute.\u00a0 After the parameters i entered the name of the file which is test.tar. The second part is the source directory\/file of the tar file. In this situation a directory called test.<\/p>\n<p><strong>#11 pwd<\/strong><\/p>\n<p>Sometimes you really wonder where you are in the system. PWD is the solution for that problem.<\/p>\n<p>PWD stands for Path Working Directory.<\/p>\n<p>pi@raspberrypi: ~$ pwd<\/p>\n<p>\/home\/pi<\/p>\n<p>pi@raspberrypi ~$<\/p>\n<p><strong>#12 ifconfig<\/strong><\/p>\n<p>ifconfig is a command showing you information about the ethernet adapters on your system. It contains very usefull information like gateway, ip,\u00a0 and packet statistics. For the average user this command is rarely used, but i think it\u2019s worth knowing it.<\/p>\n<p>pi@raspberrypi: ifconfig<\/p>\n<p>note: To gain information about the wireless adapters on your system type iwconfig.<\/p>\n<p><strong>#13 locate<\/strong><\/p>\n<p>Locate is an extremely fast seaching command. It shows the directories or files each on a new line.<\/p>\n<p>pi@raspberrypi: locate syslog<\/p>\n<p>&nbsp;<\/p>\n<p>pi@raspberrypi: locate syslog | more (Piping structure used to invert the data from locate to the more command)<\/p>\n<p>note: Some keywords returns enormous ammounts of hits. Use MORE to\u00a0 (see example)\u00a0 clear things up a bit.<\/p>\n<p><strong>#14 ping<\/strong><\/p>\n<p>Ping is used as a network diagnostic command by professionals. Ping offers information about the network we are on and if the other system responds to us. In cases of troubleshooting network related problems, ping can do a great job to determine the domain of the problem.<\/p>\n<p>pi@raspberrypi: ping www.google.com<\/p>\n<p>The command returns the interval and % of loss during the test.<\/p>\n<p>note: You can stop ping bij pressing crtl-c at the same time.<\/p>\n<p><strong>#15 chmod<\/strong><\/p>\n<p>The chmod command. The chmod command comes from \u201cChange Mode\u201d back to the unix times. It\u2019s a great command to restrict access to directories or files. But before i show you an example on how to use it, some theory.<\/p>\n<p>Chmod is qiet an advanced command to use. So therefore you really need to understand how it works.<br \/>\nchmod works with so called persmission bits. These bits can be set to a certain level of restrictions.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux is different, I know you already know that, and if are on this article you\u2019ve taken your first step into the amazin world of Linux OS (little exaggeration). Here I am going to provide a common command list most commonly used in Linux with their brief introduction. # 1:<\/p>\n","protected":false},"author":3,"featured_media":242,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5],"tags":[],"class_list":["post-240","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledgebase"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/07\/unzip-cento.png?fit=505%2C250&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7ISfL-3S","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1795,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/10-linux-basic-commands-every-user-should-know\/","url_meta":{"origin":240,"position":0},"title":"10 Linux Basic Commands Every User Should Know","author":"Shreyash Sharma","date":"July 31, 2020","format":false,"excerpt":"Linux can be daunting to some, especially if you have seen people working only through the terminal. Trust me, its not as complicated as it seems neither is it that hard to learn. The only issue is manufacturers do not Linux with their systems. What is Linux? The entire family\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/07\/7rQQixjPnrQv.png?fit=640%2C363&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/07\/7rQQixjPnrQv.png?fit=640%2C363&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/07\/7rQQixjPnrQv.png?fit=640%2C363&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3472,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-maven-on-centos-7\/","url_meta":{"origin":240,"position":1},"title":"How to install Apache Maven on CentOS 7","author":"George B.","date":"June 8, 2023","format":false,"excerpt":"We will walk you through the process of installing Apache Maven on CentOS Linux. We will cover the installation of the necessary packages, configuring the environment variables, and demonstrate how to build projects using Maven. Apache Maven is a powerful build automation tool that plays a crucial role in managing\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-install-Apache-Maven-on-CentOS-7.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-install-Apache-Maven-on-CentOS-7.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-install-Apache-Maven-on-CentOS-7.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3432,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-django-on-linux\/","url_meta":{"origin":240,"position":2},"title":"How to Install Django on Linux","author":"George B.","date":"May 31, 2023","format":false,"excerpt":"If you're a Linux user and want to dive into Django development, this step-by-step guide will walk you through the installation of Django on Linux process. Django is a powerful and popular web framework for building robust and scalable web applications. By the end, you'll have Django up and running\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-Django-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-Django-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-Django-on-Linux.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3225,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-find-the-largest-files-in-linux\/","url_meta":{"origin":240,"position":3},"title":"How to find the largest files in Linux","author":"George B.","date":"April 12, 2023","format":false,"excerpt":"When you have a server with 1TB of disk space and your storage is 80% full, it is important to find out which files(largest files) are taking up the most space on your system. This can be done by identifying the biggest files on your system and deleting or moving\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-find-largest-files-linux.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-find-largest-files-linux.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-find-largest-files-linux.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3875,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/linux-how-to-search-text-in-a-pdf-file-via-command-line\/","url_meta":{"origin":240,"position":4},"title":"Linux: How to search text in a PDF file via Command Line","author":"George B.","date":"September 15, 2023","format":false,"excerpt":"In this tutorial, we will explain how to search text in a PDF file using Linux command-line options. One of Linux's many advantages is its command-line interface (CLI), which allows users to complete difficult tasks using short, text-based commands. Linux Basics It's essential to understand what a PDF file is\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/How-to-search-text-in-a-PDF-file-via-Command-Line.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":527,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/host-your-own-speedtest-server-on-centos-7-vps\/","url_meta":{"origin":240,"position":5},"title":"HOST YOUR OWN SPEEDTEST SERVER ON CENTOS 7 VPS","author":"Daniel Draga","date":"August 25, 2016","format":false,"excerpt":"\u00a0 SpeedTest.net has been recently being a global standard for broadband speed test. Many users use their service to test how fast their internet connection is. You know that you can even host your own Speedtest webapp using its Mini version? Well, you can! Simply follow very easy steps below:\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/maxresdefault.jpg?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/maxresdefault.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/maxresdefault.jpg?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/maxresdefault.jpg?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/maxresdefault.jpg?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/comments?post=240"}],"version-history":[{"count":1,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/240\/revisions"}],"predecessor-version":[{"id":243,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/240\/revisions\/243"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media\/242"}],"wp:attachment":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media?parent=240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/categories?post=240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/tags?post=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}