Want to flex your Linux skills like a pro? Whether you're a newbie or already knee-deep in the terminal, mastering these 50 Linux commands will have people thinking you're a Red Hat guru in no time. No fluff—just straight-up useful commands and how to use them!
1. ls
– List Files Like a Boss
Use case: Need to see what’s inside a directory?
ls -lah
This lists everything, including hidden files, in a human-readable format (sizes in KB/MB/GB instead of bytes).
2. pwd
– Find Out Where You Are
Use case: Lost in the terminal? Run this:
pwd
It prints the full path of the directory you're in.
3. cd
– Move Between Directories
Use case: Navigate like a ninja.
cd /home/user/Documents
Moves you to the Documents folder. Want to go back?
cd ..
This takes you one directory up.
4. mkdir
– Create Directories
Use case: Make new folders instantly.
mkdir new_folder
Boom! A new folder appears.
5. rm
– Delete Files and Folders
Use case: Remove files (carefully!).
rm myfile.txt
Want to delete a whole folder?
rm -rf my_folder
⚠️ Be careful! This command permanently deletes everything in the folder.
6. touch
– Create Empty Files
Use case: Need a blank file?
touch myfile.txt
Instantly creates myfile.txt.
7. cp
– Copy Files and Directories
Use case: Make a duplicate of a file.
cp file1.txt file2.txt
Want to copy an entire folder?
cp -r folder1 folder2
Adds folder1’s contents to folder2.
8. mv
– Move or Rename Files
Use case: Shift files or rename them.
mv oldname.txt newname.txt
Want to move a file to another directory?
mv myfile.txt /home/user/Documents/
Puts myfile.txt inside Documents.
9. find
– Search for Files
Use case: Hunt down files anywhere.
find /home -name "myfile.txt"
Searches /home for files named myfile.txt.
10. grep
– Find Text Inside Files
Use case: Searching inside files for keywords.
grep "error" mylog.txt
Lists all lines in mylog.txt that contain the word error.
… And 40 More Essential Commands!
Linux has tons of useful commands, and mastering them will take your terminal game to the next level.
Here are 40 more that every Red Hat pro should know:
-
echo "hello"
– Print text to the screen. -
cat file.txt
– Display a file's contents. -
nano file.txt
– Edit a file easily. -
vi file.txt
– Open file in vi (advanced editor). -
tar -cvf archive.tar folder/
– Compress folder. -
tar -xvf archive.tar
– Extract archive. -
zip file.zip file.txt
– Create a zip file. -
unzip file.zip
– Extract a zip file. -
wget URL
– Download files from the internet. -
curl URL
– Fetch a webpage's content. -
df -h
– Check disk space usage. -
du -sh folder/
– Show folder size. -
free -m
– Show memory usage. -
top
– Monitor system processes. -
ps aux
– List running processes. -
kill PID
– Kill a process. -
pkill firefox
– Kill by process name. -
history
– Show command history. -
uptime
– Show how long the system has been running. -
whoami
– Display your username. -
chmod 755 file.sh
– Change file permissions. -
chown user:user file.txt
– Change file ownership. -
useradd newuser
– Add a user. -
passwd newuser
– Change password. -
sudo command
– Run a command as superuser. -
crontab -e
– Schedule tasks. -
service apache2 restart
– Restart a service. -
systemctl status apache2
– Check a service's status. -
journalctl -xe
– View system logs. -
ssh user@server
– Remote login. -
scp file.txt user@server:/path/
– Copy files via SSH. -
rsync -av folder/ user@server:/path/
– Sync files remotely. -
hostnamectl
– Change system hostname. -
ip a
– Show network interfaces. -
netstat -tulpn
– List open ports. -
ping google.com
– Test internet connection. -
curl ifconfig.me
– Get public IP address. -
firewall-cmd --list-all
– Show firewall rules. -
yum install package
– Install software. -
yum update
– Update all packages.
Conclusion
Mastering these 50 Linux commands will make you look like a true Red Hat expert. Whether you're navigating files, managing services, or troubleshooting issues, these commands are essential for any Linux user.
Next time someone asks, “Hey, do you know Linux?”—you can reply confidently:
“I live in the terminal.” 😎
Top comments (0)