{"id":225,"date":"2024-09-10T06:03:40","date_gmt":"2024-09-10T06:03:40","guid":{"rendered":"https:\/\/www.mhtechin.com\/support\/?p=225"},"modified":"2024-09-10T06:03:40","modified_gmt":"2024-09-10T06:03:40","slug":"basic-linux-commands","status":"publish","type":"post","link":"https:\/\/www.mhtechin.com\/support\/basic-linux-commands\/","title":{"rendered":"Basic Linux Commands"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong><code>ls<\/code><\/strong><br>Lists all files and directories in the current directory.<br>Example: <code>ls<\/code> will show files and directories like <code>Documents<\/code>, <code>Downloads<\/code>, etc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>cd<\/code><\/strong><br>Changes the current directory.<br>Example: <code>cd Documents<\/code> will move you into the &#8220;Documents&#8221; directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>pwd<\/code><\/strong><br>Prints the current working directory.<br>Example: <code>pwd<\/code> will output something like <code>\/home\/diksha\/Documents<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>touch<\/code><\/strong><br>Creates an empty file.<br>Example: <code>touch file.txt<\/code> will create a new empty file named <code>file.txt<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>mkdir<\/code><\/strong><br>Creates a new directory.<br>Example: <code>mkdir new_folder<\/code> will create a directory named <code>new_folder<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>rm<\/code><\/strong><br>Removes files or directories.<br>Example: <code>rm file.txt<\/code> will delete <code>file.txt<\/code>.<br>To remove a directory and its contents, use <code>rm -r directory_name<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>cp<\/code><\/strong><br>Copies files or directories.<br>Example: <code>cp source.txt destination.txt<\/code> will copy <code>source.txt<\/code> to <code>destination.txt<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>mv<\/code><\/strong><br>Moves or renames files or directories.<br>Example: <code>mv oldname.txt newname.txt<\/code> will rename the file, or <code>mv file.txt \/path\/to\/destination\/<\/code> will move it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>cat<\/code><\/strong><br>Displays the contents of a file.<br>Example: <code>cat file.txt<\/code> will show the text inside <code>file.txt<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>chmod<\/code><\/strong><br>Changes file permissions.<br>Example: <code>chmod 755 file.sh<\/code> gives read, write, and execute permissions to the owner, and read and execute permissions to others.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>ps<\/code><\/strong><br>Displays currently running processes.<br>Example: <code>ps<\/code> will show a list of processes along with their process IDs (PIDs).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>kill<\/code><\/strong><br>Terminates a process by its PID.<br>Example: <code>kill 1234<\/code> will terminate the process with PID 1234.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>sudo<\/code><\/strong><br>Runs a command with superuser (admin) privileges.<br>Example: <code>sudo apt-get update<\/code> updates the package list with root permissions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>df<\/code><\/strong><br>Shows disk space usage.<br>Example: <code>df -h<\/code> displays the available and used disk space in human-readable format.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>top<\/code><\/strong><br>Displays real-time information about system processes.<br>Example: <code>top<\/code> will show a live view of CPU, memory usage, and running processes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>man<\/code><\/strong><br>Displays the manual for a command.<br>Example: <code>man ls<\/code> will show the manual page for the <code>ls<\/code> command.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>lsLists all files and directories in the current directory.Example: ls will show files and directories like Documents, Downloads, etc. cdChanges the current directory.Example: cd Documents will move you into the &#8220;Documents&#8221; directory. pwdPrints the current working directory.Example: pwd will output something like \/home\/diksha\/Documents. touchCreates an empty file.Example: touch file.txt will create a new empty file [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-225","post","type-post","status-publish","format-standard","hentry","category-support"],"_links":{"self":[{"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/posts\/225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/comments?post=225"}],"version-history":[{"count":1,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/posts\/225\/revisions"}],"predecessor-version":[{"id":227,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/posts\/225\/revisions\/227"}],"wp:attachment":[{"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/media?parent=225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/categories?post=225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/tags?post=225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}