Linux Commands

Linux uses a command-line interface (CLI) for system management, file operations, and network administration. Below are essential Linux commands for beginners.

File & Directory Commands

CommandDescriptionExample
lsLists files in a directoryls /home
ls -lLists files in detaills -l
cdChanges directorycd Documents
cd ..Moves up one levelcd ..
pwdDisplays current directorypwd
mkdirCreates a new directorymkdir NewFolder
rmdirDeletes an empty directoryrmdir OldFolder
rm -rDeletes a directory & filesrm -r FolderName

File Management Commands

CommandDescriptionExample
touchCreates an empty filetouch file.txt
cpCopies a filecp file1.txt /backup/
mvMoves or renames a filemv file1.txt Documents/
rmDeletes a filerm file.txt
catDisplays file contentcat file.txt
nanoOpens file in Nano editornano file.txt
headDisplays first 10 lines of a filehead file.txt
tailShows last 10 lines of a filetail file.txt

User & Permission Commands

CommandDescriptionExample
whoLists logged-in userswho
idDisplays user ID (UID, GID)id
chmodChanges file permissionschmod 755 file.sh
chownChanges file ownershipchown user:group file.txt
passwdChanges user passwordpasswd

Process Management Commands

CommandDescriptionExample
psShows running processesps aux
topDisplays system resource usagetop
killKills a processkill PID
pkillKills a process by namepkill firefox
htopInteractive process managerhtop (install required)