blog bg

November 21, 2025

USEFUL LINUX COMMANDS

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 COMMANDS
CommandDescription
hostnamectlCheck the Linux version (e.g., on CentOS).
du -hView the overall Disk Usage in human-readable format.
du -sh *View the size of directories and files in the current directory.
du -chsView the total size of a specified folder or file.
df -hShows the remaining disk space and disk usage across all mounted filesystems.
lsList the contents of the current directory (the "list view").
ls -lView the long list format of the directory contents, showing permissions, owner, size, and date.
ls -lhView the long list format with sizes displayed in Human Readable units (e.g., GB, MB).
sudo -iElevate user privileges to the root user with a full environment.
sudo du -h --max-depth=1 -xView what is taking up space in the server's current directory, limited to one level deep.
topShows the memory and CPU operations currently running (processes, memory usage).
free -mhShows the memory in use and free in a human-readable format (MB, GB).
rm -rf dirnameRemove a directory and all its contents without prompting for confirmation (-r for recursive, -f for force).
rm -f filename.extensionForce delete a file without prompting for confirmation.
sudo passwd rootCreate or change the password for the root user.
sudo systemctl status sshCheck the Status of the SSH service.
lsb_release -aDisplays LSB (Linux Standard Base) and distribution-specific information (useful for checking distro name and version).

 

 

72 views

Please Login to create a Question