DEV Community

Alexand
Alexand

Posted on

50 Linux Commands That Make You Look Like a Red Hat Guru

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Moves you to the Documents folder. Want to go back?

cd ..
Enter fullscreen mode Exit fullscreen mode

This takes you one directory up.

4. mkdir – Create Directories

Use case: Make new folders instantly.

mkdir new_folder
Enter fullscreen mode Exit fullscreen mode

Boom! A new folder appears.

5. rm – Delete Files and Folders

Use case: Remove files (carefully!).

rm myfile.txt
Enter fullscreen mode Exit fullscreen mode

Want to delete a whole folder?

rm -rf my_folder
Enter fullscreen mode Exit fullscreen mode

⚠️ Be careful! This command permanently deletes everything in the folder.

6. touch – Create Empty Files

Use case: Need a blank file?

touch myfile.txt
Enter fullscreen mode Exit fullscreen mode

Instantly creates myfile.txt.

7. cp – Copy Files and Directories

Use case: Make a duplicate of a file.

cp file1.txt file2.txt
Enter fullscreen mode Exit fullscreen mode

Want to copy an entire folder?

cp -r folder1 folder2
Enter fullscreen mode Exit fullscreen mode

Adds folder1’s contents to folder2.

8. mv – Move or Rename Files

Use case: Shift files or rename them.

mv oldname.txt newname.txt
Enter fullscreen mode Exit fullscreen mode

Want to move a file to another directory?

mv myfile.txt /home/user/Documents/
Enter fullscreen mode Exit fullscreen mode

Puts myfile.txt inside Documents.

9. find – Search for Files

Use case: Hunt down files anywhere.

find /home -name "myfile.txt"
Enter fullscreen mode Exit fullscreen mode

Searches /home for files named myfile.txt.

10. grep – Find Text Inside Files

Use case: Searching inside files for keywords.

grep "error" mylog.txt
Enter fullscreen mode Exit fullscreen mode

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:

  1. echo "hello" – Print text to the screen.
  2. cat file.txt – Display a file's contents.
  3. nano file.txt – Edit a file easily.
  4. vi file.txt – Open file in vi (advanced editor).
  5. tar -cvf archive.tar folder/ – Compress folder.
  6. tar -xvf archive.tar – Extract archive.
  7. zip file.zip file.txt – Create a zip file.
  8. unzip file.zip – Extract a zip file.
  9. wget URL – Download files from the internet.
  10. curl URL – Fetch a webpage's content.
  11. df -h – Check disk space usage.
  12. du -sh folder/ – Show folder size.
  13. free -m – Show memory usage.
  14. top – Monitor system processes.
  15. ps aux – List running processes.
  16. kill PID – Kill a process.
  17. pkill firefox – Kill by process name.
  18. history – Show command history.
  19. uptime – Show how long the system has been running.
  20. whoami – Display your username.
  21. chmod 755 file.sh – Change file permissions.
  22. chown user:user file.txt – Change file ownership.
  23. useradd newuser – Add a user.
  24. passwd newuser – Change password.
  25. sudo command – Run a command as superuser.
  26. crontab -e – Schedule tasks.
  27. service apache2 restart – Restart a service.
  28. systemctl status apache2 – Check a service's status.
  29. journalctl -xe – View system logs.
  30. ssh user@server – Remote login.
  31. scp file.txt user@server:/path/ – Copy files via SSH.
  32. rsync -av folder/ user@server:/path/ – Sync files remotely.
  33. hostnamectl – Change system hostname.
  34. ip a – Show network interfaces.
  35. netstat -tulpn – List open ports.
  36. ping google.com – Test internet connection.
  37. curl ifconfig.me – Get public IP address.
  38. firewall-cmd --list-all – Show firewall rules.
  39. yum install package – Install software.
  40. 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)