
Share what you learn in this blog to prepare for your interview, create your forever-free profile now, and explore how to monetize your valuable knowledge.
USEFUL LINUX COMMANDSCommand Description hostnamectl Check the Linux version (e.g., on CentOS). du -h View the overall Disk Usage in human-readable format. du -sh * View the size of directories and files in the current directory. du -chs View the total size of a specified folder or file. df -h Shows the remaining disk space and disk usage across all mounted filesystems. ls List the contents of the current directory (the "list view"). ls -l View the long list format of the directory contents, showing permissions, owner, size, and date. ls -lh View the long list format with sizes displayed in Human Readable units (e.g., GB, MB). sudo -i Elevate user privileges to the root user with a full environment. sudo du -h --max-depth=1 -x View what is taking up space in the server's current directory, limited to one level deep. top Shows the memory and CPU operations currently running (processes, memory usage). free -mh Shows the memory in use and free in a human-readable format (MB, GB). rm -rf dirname Remove a directory and all its contents without prompting for confirmation (-r for recursive, -f for force). rm -f filename.extension Force delete a file without prompting for confirmation. sudo passwd root Create or change the password for the root user. sudo systemctl status ssh Check the Status of the SSH service. lsb_release -a Displays LSB (Linux Standard Base) and distribution-specific information (useful for checking distro name and version).
| Command | Description |
| hostnamectl | Check the Linux version (e.g., on CentOS). |
| du -h | View the overall Disk Usage in human-readable format. |
| du -sh * | View the size of directories and files in the current directory. |
| du -chs | View the total size of a specified folder or file. |
| df -h | Shows the remaining disk space and disk usage across all mounted filesystems. |
| ls | List the contents of the current directory (the "list view"). |
| ls -l | View the long list format of the directory contents, showing permissions, owner, size, and date. |
| ls -lh | View the long list format with sizes displayed in Human Readable units (e.g., GB, MB). |
| sudo -i | Elevate user privileges to the root user with a full environment. |
| sudo du -h --max-depth=1 -x | View what is taking up space in the server's current directory, limited to one level deep. |
| top | Shows the memory and CPU operations currently running (processes, memory usage). |
| free -mh | Shows the memory in use and free in a human-readable format (MB, GB). |
| rm -rf dirname | Remove a directory and all its contents without prompting for confirmation (-r for recursive, -f for force). |
| rm -f filename.extension | Force delete a file without prompting for confirmation. |
| sudo passwd root | Create or change the password for the root user. |
| sudo systemctl status ssh | Check the Status of the SSH service. |
| lsb_release -a | Displays LSB (Linux Standard Base) and distribution-specific information (useful for checking distro name and version). |

72 views
Please Login to create a Question
