September 27, 2026
Terminal Most Usefull Commands
Navigation & File Management

By Alkeribru
3 min read
Navigation & File Management
pwd
Print the current working directory.
ls
List directory contents (commonly used with -a for hidden and -l for details).
cd
Change directory.
mkdir
Create a new directory.
rmdir
only removes empty directories. Correct as written.
touch
Create an empty file (or update a timestamp).
cp
Copy files or directories (-r for recursive folder copying).
mv
Move or rename files and directories.
rm
Remove files or directories (-r to remove folders with contents).
ln
Create file links (use -s to create soft/symbolic shortcuts).
file
Determine the type of data inside a file.
find
Search for files by name, type, or attributes across directories.
Viewing & Editing Text
cat
Output file contents directly to the screen.
less
View text files interactively one page at a time.
head
Display only the first few lines of a file.
tail
Display only the last few lines of a file.
nano
Open a simple, built-in terminal text editor.
vim
Open an advanced terminal text editor.
shred
Securely overwrite and delete a file so it cannot be recovered.
zip / unzip
Compress files into an archive, or extract an existing archive.
Text Processing & Redirection
echo
Print text to the console, or write it to a file using redirects (>).
grep
Search for a specific word or text pattern within files or outputs.
sort
Sort lines of text alphabetically.
uniq
Filter out duplicate lines from text output.
awk
Extract specific columns or patterns of data from text streams.
cmp
Compare two files to see if and where they differ.
diff
Compare two files to see the exact content differences.
tee
Send command output to both the screen and a file simultaneously.
Users & Permissions
sudo
Execute a command with root/administrative privileges.
su
Switch to another user account.
whoami
Tell you your current logged-in username.
adduser / useradd
Create a new user account on the system.
passwd
Change a user's password.
chmod
Change file permissions (e.g., +x to make a script executable).
chown
Change the owner of a file or directory.
finger
Inspect the details of another user account.
System Information & Monitoring
date
Print the current time and date.
cal / ncal
Display a quick calendar in the terminal.
uname
Display system hardware and kernel information (-a for all details).
neofetch
Display pretty system specifications alongside a stylized OS logo.
free
Check available and used system memory (RAM).
df
Check available disk space (use -h for human-readable format).
history
View a list of your previously entered terminal commands.
printenv
List all environment variables for the shell session.
Process & Service Management
ps
View running processes (commonly used with -aux).
top
View a live-updating list of resource-heavy processes.
htop
A prettier, more interactive alternative to top.
kill
Force a process to stop using its Process ID (PID).
pkill
Force a process to stop using its name (no PID required).
systemctl
Start, stop, restart, or check the status of system background services.
service
The older command equivalent to systemctl on legacy Linux machines.
Networking
ssh
Connect remotely to another machine securely.
ip address
Show network interfaces and IPs (modern replacement for ifconfig).
ifconfig
Show network interfaces and IPs (older utility).
ping
Send packets to a website or IP to check if it is online.
traceroute
Trace the network hops taken to reach a remote host.
netstat
View open ports and active connections.
ss
The modern, faster replacement for checking network statistics.
resolvectl status
Check the system's current DNS settings.
wget
Download files directly from the internet via URL.
curl
Transfer data from or to a server (great for downloading or API calls).
System Operations & Help
apt / yum
Package managers used to install, update, or remove software.
ufw
Uncomplicated Firewall; used to easily open or block network ports.
iptables
Advanced firewall utility that ufw is built upon.
reboot
Restart the system immediately.
shutdown
Turn off the system (e.g., shutdown -h now).
man
Open the comprehensive manual page for a command.
whatis
Print a fast, one-line summary of what a command does.
which
Find the exact path where a command's binary is stored.
whereis
Locate the binary, source code, and manual page for a command.
type
Tell you if a command is a built-in function, alias, or external binary.
alias / unalias
Create custom shortcut commands, or remove them.
bc
A basic terminal calculator.
clear
Wipe the terminal screen clean of previous output.
exit
Close the terminal window or end a remote SSH session.