{"id":425,"date":"2020-10-24T20:01:05","date_gmt":"2020-10-24T18:01:05","guid":{"rendered":"http:\/\/hentati.org\/?p=425"},"modified":"2021-02-12T15:53:17","modified_gmt":"2021-02-12T14:53:17","slug":"linux-in-5-minutes","status":"publish","type":"post","link":"https:\/\/hentati.org\/index.php\/2020\/10\/24\/linux-in-5-minutes\/","title":{"rendered":"Linux in 5 minutes"},"content":{"rendered":"<p><span style=\"color: #000000;\">Linux in 5 minutes, I have made this resume to make Linux more easy to learn and apply,<\/span><\/p>\n<p><span style=\"color: #000000;\">I hope you find it helpfull !<\/span><\/p>\n<h3><span style=\"color: #000000;\">Chapters:<\/span><\/h3>\n<ol>\n<li><span style=\"color: #000000;\"><strong>Hardware Information<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Searching<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>File Commands<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Directory Navigation<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>File Compression<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>File Transfer<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Users<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Package Installation<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Process Related<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>System Information<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Disk Usage<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>SSH Login<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>File Permission<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Network<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Linux Keyboard Shortcuts<\/strong><\/span><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000000;\"><strong>1. Hardware Information<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\">Show\u00a0<strong>bootup messages<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">dmesg<\/span><\/pre>\n<p><span style=\"color: #000000;\">See\u00a0<strong>CPU information<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">cat \/proc\/cpuinfo<\/span><\/pre>\n<p><span style=\"color: #000000;\">Display\u00a0<strong>free and used memory<\/strong>\u00a0with:<\/span><\/p>\n<pre><span style=\"color: #000000;\">free -h<\/span><\/pre>\n<p><span style=\"color: #000000;\">List<strong>\u00a0hardware configuration<\/strong>\u00a0information:<\/span><\/p>\n<pre><span style=\"color: #000000;\">lshw<\/span><\/pre>\n<p><span style=\"color: #000000;\">See information about\u00a0<strong>block devices<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">lsblk<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show\u00a0<strong>PCI devices<\/strong>\u00a0in a tree-like diagram:<\/span><\/p>\n<pre><span style=\"color: #000000;\">lspci -tv<\/span><\/pre>\n<p><span style=\"color: #000000;\">Display\u00a0<strong>USB devices<\/strong>\u00a0in a tree-like diagram:<\/span><\/p>\n<pre><span style=\"color: #000000;\">lsusb -tv<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show\u00a0<strong>hardware information<\/strong>\u00a0from the BIOS:<\/span><\/p>\n<pre><span style=\"color: #000000;\">dmidecode<\/span><\/pre>\n<p><span style=\"color: #000000;\">Display\u00a0<strong>disk data<\/strong>\u00a0information:<\/span><\/p>\n<pre><span style=\"color: #000000;\">hdparm -i \/dev\/disk<\/span><\/pre>\n<p><span style=\"color: #000000;\">Conduct a\u00a0<strong>read-speed test<\/strong>\u00a0on device\/disk:<\/span><\/p>\n<pre><span style=\"color: #000000;\">hdparm -tT \/dev\/[device]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Test for\u00a0<strong>unreadable blocks<\/strong>\u00a0on device\/disk:<\/span><\/p>\n<pre><span style=\"color: #000000;\">badblocks -s \/dev\/[device]<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000000;\"><strong>2. Searching<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\">Search for a specific pattern\u00a0in a file with:<\/span><\/p>\n<pre><span style=\"color: #000000;\">grep [pattern] [file_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Recursively search for a pattern<\/strong>\u00a0in a directory:<\/span><\/p>\n<pre><span style=\"color: #000000;\">grep -r [pattern] [directory_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Find all\u00a0<strong>files and directories related to a particular name<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">locate [name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">List names that\u00a0<strong>begin with a specified character<\/strong>\u00a0<strong>[a]<\/strong>\u00a0in a specified location\u00a0<strong>[\/folder\/location]<\/strong>\u00a0by using the\u00a0<strong>find<\/strong>\u00a0command:<\/span><\/p>\n<pre><span style=\"color: #000000;\">find [\/folder\/location] -name [a]<\/span><\/pre>\n<p><span style=\"color: #000000;\">See\u00a0<strong>files larger than a specified size<\/strong>\u00a0<strong>[+100M]<\/strong>\u00a0in a folder:<\/span><\/p>\n<pre><span style=\"color: #000000;\">find [\/folder\/location] -size [+100M]<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000000;\"><strong>3. File Commands<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\"><strong>List files<\/strong>\u00a0in the directory:<\/span><\/p>\n<pre><span style=\"color: #000000;\">ls<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>List all files<\/strong>\u00a0(shows hidden files):<\/span><\/p>\n<pre><span style=\"color: #000000;\">ls -a<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Show directory<\/strong>\u00a0you are currently working in:<\/span><\/p>\n<pre><span style=\"color: #000000;\">pwd<\/span><\/pre>\n<p><span style=\"color: #000000;\">Create a new directory:<\/span><\/p>\n<pre><span style=\"color: #000000;\">mkdir [directory]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Remove a file:<\/span><\/p>\n<pre><span style=\"color: #000000;\">rm [file_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Remove a directory<\/strong>\u00a0recursively:<\/span><\/p>\n<pre><span style=\"color: #000000;\">rm -r [directory_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Recursively remove a directory<\/strong>\u00a0without requiring confirmation:<\/span><\/p>\n<pre><span style=\"color: #000000;\">rm -rf [directory_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Copy the contents of one file\u00a0to another file:<\/span><\/p>\n<pre><span style=\"color: #000000;\">cp [file_name1] [file_name2]<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Recursively copy the contents of one file<\/strong>\u00a0to a second file:<\/span><\/p>\n<pre><span style=\"color: #000000;\">cp -r [directory_name1] [directory_name2]<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Rename<\/strong>\u00a0<strong>[file_name1]<\/strong>\u00a0to\u00a0<strong>[file_name2]<\/strong>\u00a0with the command:<\/span><\/p>\n<pre><span style=\"color: #000000;\">mv [file_name1] [file_name2]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Create a symbolic link\u00a0to a file:<\/span><\/p>\n<pre><span style=\"color: #000000;\">ln -s \/path\/to\/[file_name] [link_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Create a\u00a0<strong>new file<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">touch [file_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Show the contents<\/strong>\u00a0of a file:<\/span><\/p>\n<pre><span style=\"color: #000000;\">more [file_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">or use the\u00a0<strong>cat<\/strong>\u00a0command:<\/span><\/p>\n<pre><span style=\"color: #000000;\">cat [file_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Append file contents to another file:<\/span><\/p>\n<pre><span style=\"color: #000000;\">cat [file_name1] &gt;&gt; [file_name2]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Display the\u00a0<strong>first 10 lines<\/strong>\u00a0of a file with:<\/span><\/p>\n<pre><span style=\"color: #000000;\">head [file_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show the\u00a0<strong>last 10 lines<\/strong>\u00a0of a file:<\/span><\/p>\n<pre><span style=\"color: #000000;\">tail [file_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Encrypt<\/strong>\u00a0a file:<\/span><\/p>\n<pre><span style=\"color: #000000;\">gpg -c [file_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Decrypt<\/strong>\u00a0a file:<\/span><\/p>\n<pre><span style=\"color: #000000;\">gpg [file_name.gpg]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show the\u00a0<strong>number of words, lines, and bytes<\/strong>\u00a0in a file:<\/span><\/p>\n<pre><span style=\"color: #000000;\">wc<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000000;\"><strong>4. Directory Navigation<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\">Move\u00a0<strong>up one level<\/strong>\u00a0in the directory tree structure:<\/span><\/p>\n<pre><span style=\"color: #000000;\">cd ..<\/span><\/pre>\n<p><span style=\"color: #000000;\">Change\u00a0<strong>directory to<\/strong>\u00a0<strong>$HOME<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">cd<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Change location<\/strong>\u00a0to a specified directory:<\/span><\/p>\n<pre><span style=\"color: #000000;\">cd \/chosen\/directory<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000000;\"><strong>5. File Compression<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\"><strong>Archive an existing file<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">tar cf [compressed_file.tar] [file_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Extract an archived file:<\/span><\/p>\n<pre><span style=\"color: #000000;\">tar xf [compressed_file.tar]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Create a\u00a0<strong>gzip compressed tar file<\/strong>\u00a0by running:<\/span><\/p>\n<pre><span style=\"color: #000000;\">tar czf [compressed_file.tar.gz]<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Compress<\/strong>\u00a0a file with the\u00a0<strong>.gz<\/strong>\u00a0extension:<\/span><\/p>\n<pre><span style=\"color: #000000;\">gzip [file_name]<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000000;\"><strong>6. File Transfer<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\">Copy a file to a server\u00a0directory securely:<\/span><\/p>\n<pre><span style=\"color: #000000;\">scp [file_name.txt] [server\/tmp]<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Synchronize<\/strong>\u00a0the contents of a directory\u00a0<strong>with a backup directory<\/strong>\u00a0using the\u00a0rsync command:<\/span><\/p>\n<pre><span style=\"color: #000000;\">rsync -a [\/your\/directory] [\/backup\/]<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000000;\"><strong>7. Users<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\">See details about the\u00a0<strong>active users<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">id<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show<strong>\u00a0last system logins<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">last<\/span><\/pre>\n<p><span style=\"color: #000000;\">Display who is<strong>\u00a0currently logged into the system<\/strong>\u00a0with the command:<\/span><\/p>\n<pre><span style=\"color: #000000;\">who<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show which users are<strong>\u00a0logged in<\/strong>\u00a0and\u00a0<strong>their activity<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">w<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Add a new group<\/strong>\u00a0by typing:<\/span><\/p>\n<pre><span style=\"color: #000000;\">groupadd [group_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Add a<strong>\u00a0new user<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">adduser [user_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Add a\u00a0<strong>user to a group<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">usermod -aG [group_name] [user_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Temporarily\u00a0<strong>elevate user privileges<\/strong>\u00a0to superuser or root using the\u00a0sudo command:<\/span><\/p>\n<pre><span style=\"color: #000000;\">sudo [command_to_be_executed_as_superuser]<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Delete<\/strong>\u00a0a user:<\/span><\/p>\n<pre><span style=\"color: #000000;\">userdel [user_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Modify<\/strong>\u00a0user information with:<\/span><\/p>\n<pre><span style=\"color: #000000;\">usermod<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000000;\"><strong>8. Package Installation<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\">List all installed packages with\u00a0<strong>yum<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">yum list installed<\/span><\/pre>\n<p><span style=\"color: #000000;\">Find a package by a\u00a0<strong>related keyword<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">yum search [keyword]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show<strong>\u00a0package information and summary<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">yum info [package_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Install a package using the\u00a0<strong>YUM package manager<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">yum install [package_name.rpm]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Install a package using the\u00a0<strong>DNF package manager<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">dnf install [package_name.rpm]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Install a package\u00a0using the\u00a0<strong>APT package manager<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">apt-get install [package_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Install<\/strong>\u00a0an\u00a0<strong>.rpm<\/strong>\u00a0package from a local file:<\/span><\/p>\n<pre><span style=\"color: #000000;\">rpm -i\u00a0 [package_name.rpm]<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Remove<\/strong>\u00a0an\u00a0<strong>.rpm<\/strong>\u00a0package:<\/span><\/p>\n<pre><span style=\"color: #000000;\">rpm -e [package_name.rpm]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Install software from\u00a0<strong>source code<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">tar zxvf [source_code.tar.gz]<\/span>\r\n\r\n<span style=\"color: #000000;\">cd [source_code]<\/span>\r\n\r\n<span style=\"color: #000000;\">.\/configure<\/span>\r\n\r\n<span style=\"color: #000000;\">make<\/span>\r\n\r\n<span style=\"color: #000000;\">make install<\/span><\/pre>\n<h2><span style=\"color: #000000;\">\u00a0<\/span><\/h2>\n<h2><span style=\"color: #000000;\"><strong>9. Process Related<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\">See a\u00a0<strong>snapshot of active processes<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">ps<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show\u00a0<strong>processes in a tree-like diagram<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">pstree<\/span><\/pre>\n<p><span style=\"color: #000000;\">Display a\u00a0<strong>memory usage map<\/strong>\u00a0of processes:<\/span><\/p>\n<pre><span style=\"color: #000000;\">pmap<\/span><\/pre>\n<p><span style=\"color: #000000;\">See\u00a0<strong>all running processes<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">top<\/span><\/pre>\n<p><span style=\"color: #000000;\">Terminate a Linux process\u00a0under a<strong>\u00a0given ID<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">kill [process_id]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Terminate a process under a\u00a0<strong>specific name<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">pkill [proc_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Terminate all processes\u00a0<strong>labelled<\/strong>\u00a0<strong>\u201cproc\u201d<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">killall [proc_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>List and resume stopped jobs<\/strong>\u00a0in the background:<\/span><\/p>\n<pre><span style=\"color: #000000;\">bg<\/span><\/pre>\n<p><span style=\"color: #000000;\">Bring the most\u00a0<strong>recently suspended job to the<\/strong>\u00a0<strong>foreground<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">fg<\/span><\/pre>\n<p><span style=\"color: #000000;\">Bring a\u00a0<strong>particular job to the<\/strong>\u00a0<strong>foreground<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">fg [job]<\/span><\/pre>\n<p><span style=\"color: #000000;\">List\u00a0<strong>files opened by running processes<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">lsof<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000000;\"><strong>10. System Information<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\">Show\u00a0<strong>system information<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">uname -r<\/span><\/pre>\n<p><span style=\"color: #000000;\">See\u00a0kernel release information:<\/span><\/p>\n<pre><span style=\"color: #000000;\">uname -a<\/span><\/pre>\n<p><span style=\"color: #000000;\">Display\u00a0<strong>how long the system has been running<\/strong>, including load average:<\/span><\/p>\n<pre><span style=\"color: #000000;\">uptime<\/span><\/pre>\n<p><span style=\"color: #000000;\">See system\u00a0<strong>hostname<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">hostname<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show the<strong>\u00a0IP address<\/strong>\u00a0of the system:<\/span><\/p>\n<pre><span style=\"color: #000000;\">hostname -i<\/span><\/pre>\n<p><span style=\"color: #000000;\">List system\u00a0<strong>reboot history<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">last reboot<\/span><\/pre>\n<p><span style=\"color: #000000;\">See current<strong>\u00a0time and date<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">date<\/span><\/pre>\n<p><span style=\"color: #000000;\">Query and\u00a0<strong>change the system clock<\/strong>\u00a0with:<\/span><\/p>\n<pre><span style=\"color: #000000;\">timedatectl<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show current\u00a0<strong>calendar<\/strong>\u00a0(month and day):<\/span><\/p>\n<pre><span style=\"color: #000000;\">cal<\/span><\/pre>\n<p><span style=\"color: #000000;\">List\u00a0<strong>logged in users<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">w<\/span><\/pre>\n<p><span style=\"color: #000000;\">See which\u00a0<strong>user you are using<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">whoami<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show\u00a0<strong>information about a particular user<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">finger [username]<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000000;\"><strong>11. Disk Usage<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\">You can use the df and du commands to\u00a0check disk space in Linux.<\/span><\/p>\n<p><span style=\"color: #000000;\">See\u00a0<strong>free and used space<\/strong>\u00a0on mounted systems:<\/span><\/p>\n<pre><span style=\"color: #000000;\">df -h<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show\u00a0<strong>free inodes<\/strong>\u00a0on mounted filesystems:<\/span><\/p>\n<pre><span style=\"color: #000000;\">df -i<\/span><\/pre>\n<p><span style=\"color: #000000;\">Display\u00a0<strong>disk partitions, sizes, and types<\/strong>\u00a0with the command:<\/span><\/p>\n<pre><span style=\"color: #000000;\">fdisk -l<\/span><\/pre>\n<p><span style=\"color: #000000;\">See\u00a0<strong>disk usage<\/strong>\u00a0for all files and directory:<\/span><\/p>\n<pre><span style=\"color: #000000;\">du -ah<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show<strong>\u00a0disk usage of the directory<\/strong>\u00a0you are currently in:<\/span><\/p>\n<pre><span style=\"color: #000000;\">du -sh<\/span><\/pre>\n<p><span style=\"color: #000000;\">Display<strong>\u00a0target mount point<\/strong>\u00a0for all filesystem:<\/span><\/p>\n<pre><span style=\"color: #000000;\">findmnt<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Mount a device<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">mount [device_path] [mount_point]<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000000;\"><strong>12. SSH Login<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\"><strong>Connect to host<\/strong>\u00a0as user:<\/span><\/p>\n<pre><span style=\"color: #000000;\">ssh user@host<\/span><\/pre>\n<p><span style=\"color: #000000;\">Securely\u00a0<strong>connect to host via SSH<\/strong>\u00a0default port 22:<\/span><\/p>\n<pre><span style=\"color: #000000;\">ssh host<\/span><\/pre>\n<p><span style=\"color: #000000;\">Connect to host\u00a0<strong>using a particular port<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">ssh -p [port] user@host<\/span><\/pre>\n<p><span style=\"color: #000000;\">Connect to host\u00a0<strong>via telnet default port 23<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">telnet host<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000000;\"><strong>13. File Permission<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\">Chown command in Linux\u00a0changes file and directory ownership.<\/span><\/p>\n<p><span style=\"color: #000000;\">Assign\u00a0<strong>read, write, and execute permission<\/strong>\u00a0to everyone:<\/span><\/p>\n<pre><span style=\"color: #000000;\">chmod 777 [file_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Give\u00a0<strong>read, write, and execute permission to owner<\/strong>, and r<strong>ead and execute permission to group and others<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">chmod 755 [file_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Assign\u00a0<strong>full permission to owner<\/strong>, and\u00a0<strong>read and write permission to group and others<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">chmod 766 [file_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Change the\u00a0<strong>ownership of a file<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">chown [user] [file_name]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Change the\u00a0<strong>owner and group ownership of a file<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">chown [user]:[group] [file_name]<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000000;\"><strong>14. Network<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\">List IP addresses\u00a0and\u00a0<strong>network interfaces<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">ip addr show<\/span><\/pre>\n<p><span style=\"color: #000000;\">Assign an\u00a0<strong>IP address to interface eth0<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">ip address add [IP_address]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Display\u00a0<strong>IP addresses of all network interfaces<\/strong>\u00a0with:<\/span><\/p>\n<pre><span style=\"color: #000000;\">ifconfig<\/span><\/pre>\n<p><span style=\"color: #000000;\">See\u00a0<strong>active (listening) ports<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">netstat -pnltu<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show\u00a0<strong>tcp<\/strong>\u00a0and\u00a0<strong>udp<\/strong>\u00a0<strong>ports<\/strong>\u00a0and their programs:<\/span><\/p>\n<pre><span style=\"color: #000000;\">netstat -nutlp<\/span><\/pre>\n<p><span style=\"color: #000000;\">Display more\u00a0<strong>information about a domain<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">whois [domain]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show\u00a0<strong>DNS information\u00a0<\/strong>about a domain using the\u00a0dig command:<\/span><\/p>\n<pre><span style=\"color: #000000;\">dig [domain]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Do a\u00a0<strong>reverse lookup<\/strong>\u00a0<strong>on domain<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">dig -x host<\/span><\/pre>\n<p><span style=\"color: #000000;\">Do\u00a0<strong>reverse lookup of an IP address<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">dig -x [ip_address]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Perform an\u00a0<strong>IP lookup for a domain<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">host [domain]<\/span><\/pre>\n<p><span style=\"color: #000000;\">Show the\u00a0<strong>local IP address<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">hostname -I<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Download a file<\/strong>\u00a0from a domain using the\u00a0<strong>wget<\/strong>\u00a0command:<\/span><\/p>\n<pre><span style=\"color: #000000;\">wget [file_name]<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000000;\"><strong>15. Linux Keyboard Shortcuts<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\"><strong>Kill process<\/strong>\u00a0running in the terminal:<\/span><\/p>\n<pre><span style=\"color: #000000;\">Ctrl + C<\/span><\/pre>\n<p><span style=\"color: #000000;\">Stop<strong>\u00a0current process<\/strong>:<\/span><\/p>\n<pre><span style=\"color: #000000;\">Ctrl + Z<\/span><\/pre>\n<p><span style=\"color: #000000;\">The process can be\u00a0<strong>resumed<\/strong>\u00a0in the\u00a0<strong>foreground<\/strong>\u00a0with\u00a0<strong>fg<\/strong>\u00a0or in the\u00a0<strong>background<\/strong>\u00a0with\u00a0<strong>bg<\/strong>.<\/span><\/p>\n<p><span style=\"color: #000000;\">Cut\u00a0<strong>one word before the cursor<\/strong>\u00a0and add it to clipboard:<\/span><\/p>\n<pre><span style=\"color: #000000;\">Ctrl + W<\/span><\/pre>\n<p><span style=\"color: #000000;\">Cut\u00a0<strong>part of the line before the cursor<\/strong>\u00a0and add it to clipboard:<\/span><\/p>\n<pre><span style=\"color: #000000;\">Ctrl + U<\/span><\/pre>\n<p><span style=\"color: #000000;\">Cut\u00a0<strong>part of the line after the cursor<\/strong>\u00a0and add it to clipboard:<\/span><\/p>\n<pre><span style=\"color: #000000;\">Ctrl + K<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Paste<\/strong>\u00a0from clipboard:<\/span><\/p>\n<pre><span style=\"color: #000000;\">Ctrl + Y<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Recall last command<\/strong>\u00a0that matches the provided characters:<\/span><\/p>\n<pre><span style=\"color: #000000;\">Ctrl + R<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Run<\/strong>\u00a0the previously recalled command:<\/span><\/p>\n<pre><span style=\"color: #000000;\">Ctrl + O<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Exit command history<\/strong>\u00a0without running a command:<\/span><\/p>\n<pre><span style=\"color: #000000;\">Ctrl + G<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Run the last command<\/strong>\u00a0again:<\/span><\/p>\n<pre><span style=\"color: #000000;\">!!<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Log out<\/strong>\u00a0of current session:<\/span><\/p>\n<pre><span style=\"color: #000000;\">exit<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux in 5 minutes, I have made this resume to make Linux more easy to learn and apply, I hope you find it helpfull ! Chapters: Hardware Information Searching File &#8230;<\/p>\n","protected":false},"author":1,"featured_media":435,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[],"_links":{"self":[{"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/posts\/425"}],"collection":[{"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/comments?post=425"}],"version-history":[{"count":12,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/posts\/425\/revisions"}],"predecessor-version":[{"id":868,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/posts\/425\/revisions\/868"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/media\/435"}],"wp:attachment":[{"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/media?parent=425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/categories?post=425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/tags?post=425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}