UNIX Commands Cheat Sheet
ls
Lists files and directories in the current location.
ls -l
Displays detailed information about files and directories.
ls -a
Shows hidden files in the directory.
pwd
Prints the current working directory path.
cd directory
Changes to the specified directory.
cd ..
Moves up one directory level.
mkdir directory
Creates a new directory.
rmdir directory
Deletes an empty directory.
rm filename
Deletes the specified file.
rm -r directory
Deletes a directory and all its contents.
touch filename
Creates a new empty file.
cp source destination
Copies a file from source to destination.
mv oldname newname
Renames or moves a file or directory.
find /path -name filename
Searches for a file by name in a directory.
grep 'text' filename
Searches for a specific text inside a file.
cat filename
Displays the content of a file.
more filename
Displays file content page by page.
head filename
Shows the first 10 lines of a file.
tail filename
Shows the last 10 lines of a file.
chmod 777 filename
Grants all permissions to a file.
chown user:group filename
Changes file ownership.
ps
Shows active processes.
top
Displays system resource usage and active processes.
kill PID
Terminates a process by its ID.
whoami
Displays the current logged-in user.
uname -a
Shows system information.
df -h
Displays disk usage in human-readable format.
du -sh directory
Shows the size of a directory.
echo 'text'
Prints text to the terminal.
history
Shows previously executed commands.
clear
Clears the terminal screen.