Most useful commands in Linux
Discover the essential Linux commands every user should know. Whether you’re a beginner or a pro, these must-use commands will boost your productivity and make your life easier.
Linux Commands | Description |
touch | Create a new empty file |
cat | Displays the contents of a file |
cp | Copy files or directories |
mkdir | Create a new directory |
pwd | Print working directory |
cd | Change directory |
ll | List files and directories (alias for ls -l) |
clear or ctrl+l | Clear screen |
ls | List files and directories |
whoami | Display current user |
who | Display logged-in users |
which | Display path of a command |
uptime | Display system uptime |
w | Display logged-in users |
uname | Display system information |
last | Display recent login history |
mv | Move or rename files or directories |
rm | Remove files or directories |
rmdir | Remove empty directories |
vim | Text editor |
grep | Search for patterns in files |
find | Search for files based on criteria |
locate | Search for files by name |
tail | Displays the last 10 lines of a file |
head | Displays the first 10 lines of a file |
less | Displays a file one page at a time, allowing scrolling and searching |
wc | Counts the lines, words, and characters in a file |
more | Displays a file one page at a time, allowing scrolling |
ip | Manage network settings |
ifconfig | Configure network interfaces |
ping | Test network connectivity |
telnet | Connect to remote hosts |
route | Manage network routes |
traceroute | Trace network routes |
nmap | Scan network ports |
ssh | Securely connect to remote hosts |
scp | Securely copy files over network |
rsync | Synchronize files over network |
nslookup | Perform DNS lookups |
dig | Perform DNS lookups |
cal | Display calendar |
date | Display current date and time |
hostname | Display system hostname |
hostnamectl | Control system hostname |
useradd | Add new users |
su | Switch user accounts |
finger | Display user information |
adduser | Add new users (alternative to useradd) |
chmod | Change file permissions |
chown | Change file ownership |
groupadd | Add new groups |
passwd | Change user passwords |
userdel | Delete users |
usermod | Modify user accounts |
chattr | Change file attributes |
sudo | Execute commands with elevated privileges |
id | Display user and group information |
crontab | Schedule tasks |
ss | Display socket statistics |
lsof | List open files |
yum | Manage packages (RPM-based) |
rpm | Manage packages (RPM-based) |
dnf | Manage packages (RPM-based, replacement for yum) |
apt-get | Manage packages (DEB-based) |
dpkg | Manage packages (DEB-based) |
fdisk | Manipulates disk partitions |
parted | Manages disk partitions and file systems |
df | Displays disk space usage and availability |
du | Estimates file space usage |
mount | Attaches a file system to a directory |
lsblk | Lists information about block devices (disks and partitions) |
free | Displays memory and disk space usage |
tree | Display directory tree |
curl | Transfer files over network |
wget | Download files over network |
systemctl | Manage system services |
service | Manage system services (deprecated) |
tar | Archive files |
zip | Compress files |
unzip | Decompress files |
watch | Execute a command repeatedly |
top | Display system processes |
fg | Bring a background job to the foreground |
kill | Terminate processes |
ps | Display system processes |
hdparm | Manage disk settings |
dmidecode | Display hardware information |
iostat | Display I/O statistics |
tcpdump | Capture network traffic |
dmesg | Display system messages |
setfacl | Set file access control lists |
getfacl | Get file access control lists |
cut | Extracts specific columns or fields from a file |
sed | Used to find and change text in files |
awk | Searching and manipulating text in files |
echo | Prints text to the terminal or a file |
i/o redirection | Redirects input/output streams to/from files or commands |
softlink | Creates a symbolic link to a file or directory |
Hardlink | Creates a duplicate entry for a file on the file system |
man | Displays the manual for a command |
help | Displays brief help information for a command |