The Top 100 Linux Commands

Linux has become the backbone of modern technology. From powering the vast majority of servers on the internet to being the operating system behind Android devices, Linux is everywhere. It’s the choice OS for developers, sysadmins, and cloud engineers alike, and for good reason.

But why should you learn Linux? Here are a few compelling reasons:

  • Versatility: Linux can run on anything from a supercomputer to a humble Raspberry Pi.
  • Open Source: You can view, modify, and distribute Linux as you see fit, with thousands of distributions tailored to specific needs.
  • Security: Linux’s architecture is designed with security in mind, making it a trusted choice for critical systems.
  • Community: A vast, supportive community is ready to help you troubleshoot issues, learn new skills, and contribute to projects.
  • Career Growth: In a world dominated by cloud computing, proficiency in Linux is a significant asset, with many high-paying jobs requiring Linux skills.

Now, let’s dive into the commands that will make you a Linux power user.


The Top 100 Linux Commands You Need to Know

1. ls

  • When to use it: Anytime you want to view the contents of a directory.
  • Why it’s useful: It’s the most basic command for navigating the filesystem, allowing you to see files and directories.

2. cd

  • When to use it: To change your current directory.
  • Why it’s useful: Efficient navigation of the filesystem is key to working effectively in Linux.

3. pwd

  • When to use it: To find out your current directory.
  • Why it’s useful: It’s easy to get lost in complex directory structures; pwd keeps you oriented.

4. mkdir

  • When to use it: To create a new directory.
  • Why it’s useful: Organizing files into directories is fundamental to keeping your system tidy.

5. rm

  • When to use it: To delete files or directories.
  • Why it’s useful: Cleaning up unnecessary files keeps your system running smoothly.

6. rmdir

  • When to use it: To remove empty directories.
  • Why it’s useful: It’s a safer way to delete directories without the risk of removing important files.

7. touch

  • When to use it: To create an empty file or update the timestamp of an existing file.
  • Why it’s useful: It’s quick and easy for creating placeholders or testing file operations.

8. cp

  • When to use it: To copy files or directories.
  • Why it’s useful: Data duplication and backup are essential for safeguarding your work.

9. mv

  • When to use it: To move or rename files and directories.
  • Why it’s useful: It’s a versatile command for reorganizing your filesystem.

10. cat

  • When to use it: To display the contents of a file.
  • Why it’s useful: Quick file previews make it easier to verify file contents.

11. less

  • When to use it: To view large text files one page at a time.
  • Why it’s useful: It’s more efficient than cat for handling extensive files.

12. grep

  • When to use it: To search text using patterns.
  • Why it’s useful: It’s indispensable for finding specific information in files or command outputs.

13. find

  • When to use it: To search for files and directories.
  • Why it’s useful: Locating files by name, type, or other criteria saves time in large filesystems.

14. chmod

  • When to use it: To change file permissions.
  • Why it’s useful: Managing access controls is crucial for system security.

15. chown

  • When to use it: To change file ownership.
  • Why it’s useful: Assigning the correct user and group ownership ensures proper access rights.

16. ps

  • When to use it: To display currently running processes.
  • Why it’s useful: Monitoring active processes helps diagnose system issues.

17. top

  • When to use it: To monitor system performance in real-time.
  • Why it’s useful: It provides a dynamic view of CPU and memory usage.

18. kill

  • When to use it: To terminate a process by its PID.
  • Why it’s useful: Stopping runaway processes can prevent system crashes.

19. df

  • When to use it: To display disk space usage.
  • Why it’s useful: Keeping an eye on disk space prevents system slowdowns.

20. du

  • When to use it: To check disk usage by file or directory.
  • Why it’s useful: It helps identify what’s taking up space on your system.

21. tar

  • When to use it: To create or extract archive files.
  • Why it’s useful: It’s the go-to command for compressing and decompressing files.

22. zip/unzip

  • When to use it: To compress or decompress files.
  • Why it’s useful: Handling compressed files is essential for efficient data transfer.

23. wget

  • When to use it: To download files from the web.
  • Why it’s useful: Automated downloads are a staple of scripts and cron jobs.

24. curl

  • When to use it: To transfer data to or from a server.
  • Why it’s useful: It’s incredibly versatile, handling HTTP requests, APIs, and more.

25. nano

  • When to use it: To edit files in the terminal.
  • Why it’s useful: It’s a simple, user-friendly text editor.

26. vi/vim

  • When to use it: To edit files with more advanced features.
  • Why it’s useful: Vi(m) is powerful, though it has a steeper learning curve than nano.

27. echo

  • When to use it: To display a line of text or variable value.
  • Why it’s useful: It’s commonly used in scripting to output information.

28. man

  • When to use it: To access the manual page for a command.
  • Why it’s useful: Understanding command options is key to using them effectively.

29. alias

  • When to use it: To create shortcuts for commands.
  • Why it’s useful: It speeds up your workflow by reducing typing.

30. ssh

  • When to use it: To connect to remote servers securely.
  • Why it’s useful: Secure Shell (SSH) is the standard for remote system management.

31. scp

  • When to use it: To copy files between hosts over SSH.
  • Why it’s useful: Secure file transfer is essential in networked environments.

32. rsync

  • When to use it: To sync files and directories between locations.
  • Why it’s useful: It’s fast, efficient, and minimizes data transfer.

33. hostname

  • When to use it: To display or set the system’s hostname.
  • Why it’s useful: It’s crucial for network identification.

34. ifconfig/ip

  • When to use it: To configure network interfaces.
  • Why it’s useful: Managing network settings is fundamental for connectivity.

35. ping

  • When to use it: To test network connectivity.
  • Why it’s useful: It’s the simplest tool for checking if a server is reachable.

36. netstat

  • When to use it: To display network connections and routing tables.
  • Why it’s useful: It helps diagnose network issues and monitor traffic.

37. traceroute

  • When to use it: To trace the path packets take to a destination.
  • Why it’s useful: It’s great for identifying network bottlenecks.

38. iptables

  • When to use it: To set up firewall rules.
  • Why it’s useful: Security is a top priority; iptables controls traffic flow.

39. systemctl

  • When to use it: To manage system services.
  • Why it’s useful: Controlling services is crucial for managing what runs on your system.

40. journalctl

  • When to use it: To view logs from the systemd journal.
  • Why it’s useful: It’s essential for troubleshooting issues and monitoring events.

41. crontab

  • When to use it: To schedule recurring tasks.
  • Why it’s useful: Automating tasks saves time and ensures regular maintenance.

42. at

  • When to use it: To schedule a one-time task.
  • Why it’s useful: It’s useful for tasks that don’t need to be repeated.

43. htop

  • When to use it: As an alternative to top for monitoring system resources.
  • Why it’s useful: It offers a more user-friendly and colorful interface.

44. uname

  • When to use it: To display system information.
  • Why it’s useful: Knowing your kernel version and OS details can be important for compatibility.

45. df -h

  • When to use it: To check disk space usage with human-readable output.
  • Why it’s useful: The -h flag makes it easier to interpret space usage.

46. du -sh

  • When to use it: To get the total size of a directory.
  • Why it’s useful: It quickly reveals how much space a directory is consuming.

47. free -h

  • When to use it: To check memory usage.
  • Why it’s useful: Monitoring RAM is critical for performance management.

48. uptime

  • When to use it: To check how long the system has been running.
  • Why it’s useful: It also gives you a quick look at system load.

49. whoami

  • When to use it: To display the current user.
  • Why it’s useful: It’s helpful in multi-user environments to verify your identity.

50. history

  • When to use it: To view the command history.
  • Why it’s useful: Reusing past commands saves time and effort.

51. passwd

  • When to use it: To change a user’s password.
  • Why it’s useful: Keeping passwords secure is a fundamental security practice.

52. useradd

  • When to use it: To create a new user.
  • Why it’s useful: User management is essential in multi-user systems.

53. usermod

  • When to use it: To modify user accounts.
  • Why it’s useful: Adjusting user privileges and settings is crucial for system administration.

54. userdel

  • When to use it: To delete a user account.
  • Why it’s useful: Cleaning up unused accounts reduces security risks.

55. groupadd

  • When to use it: To create a new group.
  • Why it’s useful: Groups make it easier to manage permissions for multiple users.

56. chmod

  • When to use it: To change file or directory permissions.
  • Why it’s useful: It’s key to enforcing access control.

57. chown

  • When to use it: To change the ownership of files or directories.
  • Why it’s useful: Proper ownership is critical for security and collaboration.

58. mount

  • When to use it: To mount a filesystem.
  • Why it’s useful: Accessing external drives or partitions requires mounting.

59. umount

  • When to use it: To unmount a filesystem.
  • Why it’s useful: Safely disconnecting filesystems prevents data corruption.

60. df

  • When to use it: To check disk space usage.
  • Why it’s useful: It’s important for monitoring disk usage and avoiding full drives.

61. du

  • When to use it: To estimate file and directory space usage.
  • Why it’s useful: Identifying large files helps manage storage efficiently.

62. reboot

  • When to use it: To restart the system.
  • Why it’s useful: Rebooting is necessary after some updates or configurations.

63. shutdown

  • When to use it: To power off or restart the system.
  • Why it’s useful: Safe shutdowns prevent data loss and corruption.

64. yum/apt-get

  • When to use it: To install, update, or remove packages.
  • Why it’s useful: Package management is central to maintaining a healthy system.

65. dpkg/rpm

  • When to use it: To manage packages on Debian/RPM-based systems.
  • Why it’s useful: Directly installing and managing packages gives you more control.

66. locate

  • When to use it: To find files by name.
  • Why it’s useful: It’s faster than find for quick file searches.

67. alias

  • When to use it: To create command shortcuts.
  • Why it’s useful: Aliases can simplify complex commands and save time.

68. echo $PATH

  • When to use it: To view the system’s executable search path.
  • Why it’s useful: Understanding PATH helps resolve issues with command availability.

69. env

  • When to use it: To view or modify the environment variables.
  • Why it’s useful: Managing environment variables is essential for configuring the system behavior.

70. export

  • When to use it: To set environment variables.
  • Why it’s useful: Persisting environment changes across sessions is often necessary.

71. xargs

  • When to use it: To build and execute commands from standard input.
  • Why it’s useful: It’s powerful for chaining commands together.

72. sed

  • When to use it: To perform basic text transformations on an input stream.
  • Why it’s useful: sed is indispensable for automating edits in text files.

73. awk

  • When to use it: To manipulate data and generate reports.
  • Why it’s useful: It’s perfect for processing and analyzing text files.

74. cut

  • When to use it: To remove sections from each line of files.
  • Why it’s useful: It’s useful for extracting specific data from files.

75. sort

  • When to use it: To sort lines of text files.
  • Why it’s useful: Organizing data is crucial for readability and analysis.

76. uniq

  • When to use it: To report or omit repeated lines.
  • Why it’s useful: It’s great for filtering out duplicates in data.

77. diff

  • When to use it: To compare files line by line.
  • Why it’s useful: It’s essential for code reviews and version control.

78. tee

  • When to use it: To read from standard input and write to standard output and files.
  • Why it’s useful: It allows for capturing output while still displaying it.

79. head

  • When to use it: To display the first few lines of a file.
  • Why it’s useful: Quickly previewing file content saves time.

80. tail

  • When to use it: To display the last few lines of a file.
  • Why it’s useful: It’s commonly used to monitor log files in real-time.

81. wc

  • When to use it: To count words, lines, and characters in a file.
  • Why it’s useful: It’s great for quick statistics on text files.

82. ln

  • When to use it: To create hard or symbolic links.
  • Why it’s useful: Linking files allows for flexible file management.

83. alias

  • When to use it: To create shortcuts for frequently used commands.
  • Why it’s useful: It saves time and reduces repetitive typing.

84. grep

  • When to use it: To search for text within files.
  • Why it’s useful: It’s a powerful tool for filtering and searching large amounts of text.

85. ps

  • When to use it: To list running processes.
  • Why it’s useful: It helps in monitoring system activity and managing processes.

86. bg

  • When to use it: To resume a suspended job in the background.
  • Why it’s useful: It allows multitasking without blocking the terminal.

87. fg

  • When to use it: To bring a background job to the foreground.
  • Why it’s useful: It lets you interact with a background process directly.

88. jobs

  • When to use it: To list background jobs.
  • Why it’s useful: It’s useful for tracking and managing processes.

89. kill

  • When to use it: To terminate a process.
  • Why it’s useful: Stopping malfunctioning or unnecessary processes is crucial for system stability.

90. killall

  • When to use it: To kill processes by name.
  • Why it’s useful: It’s faster when dealing with multiple instances of a process.

91. service

  • When to use it: To manage system services.
  • Why it’s useful: Controlling services is essential for maintaining system health.

92. ip

  • When to use it: To show or manipulate routing, devices, and tunnels.
  • Why it’s useful: Network configuration and troubleshooting depend on this command.

93. nmcli

  • When to use it: To manage NetworkManager from the command line.
  • Why it’s useful: It’s handy for configuring network interfaces.

94. systemctl

  • When to use it: To control the systemd system and service manager.
  • Why it’s useful: Managing services and system states are integral

95. systemctl

  • When to use it: To control the systemd system and service manager.
  • Why it’s useful: systemctl is a powerful tool for managing system services and the state of the system. Whether you need to start, stop, restart, or check the status of a service, systemctl provides a unified way to manage these tasks. It’s integral to modern Linux systems running systemd.

96. journalctl

  • When to use it: To query and display messages from the journal.
  • Why it’s useful: journalctl interacts with the systemd journal, giving you access to comprehensive logs for troubleshooting and monitoring. It’s a more modern alternative to traditional log files and offers a detailed, centralized view of system activity.

97. top

  • When to use it: To monitor system processes and performance.
  • Why it’s useful: top provides a real-time, dynamic view of system processes, including CPU and memory usage. It’s invaluable for identifying resource-hogging processes and managing system performance.

98. htop

  • When to use it: As an interactive process viewer.
  • Why it’s useful: htop is an enhanced version of top with a more user-friendly, ncurses-based interface. It allows for easier process management, such as sorting and killing processes, and provides a more intuitive visualization of system performance metrics.

99. lsof

  • When to use it: To list open files and their associated processes.
  • Why it’s useful: lsof (List Open Files) helps you identify which files are open and which processes are using them. It’s particularly useful for debugging file system issues or managing system resources, especially when troubleshooting why a file cannot be accessed or is locked.

100. strace

  • When to use it: To trace system calls and signals.
  • Why it’s useful: strace is a diagnostic tool used for debugging and analyzing the interactions between programs and the Linux kernel. By tracing system calls, it helps you understand how programs behave and can assist in identifying issues related to system resources or permissions.

By becoming proficient with these commands, you not only gain practical skills for everyday tasks but also position yourself at the forefront of technology that drives the modern digital landscape.

Whether you’re aiming to enhance your career prospects or simply explore the depths of Linux, understanding these commands is a crucial step towards becoming a proficient Linux user.

So dive in, experiment with these commands, and discover the vast capabilities of Linux. It’s not just about learning commands—it’s about embracing a powerful tool that can shape and transform how you interact with technology.

Happy exploring!

Need more help, check these books.

  • The Linux Command Line: A Complete Introduction by William Shotts
  • Linux Basics for Hackers: Getting Started with Networking, Scripting, and Security in Kali by OccupyTheWeb
  • How Linux Works: What Every Superuser Should Know by Brian Ward
  • The Art of UNIX Programming by Eric S. Raymond
  • Linux Command Line and Shell Scripting Bible by Richard Blum and Christine Bresnahan