Skip to content

Common CLI Utilities

While there are a lot of command line utilities to be aware of and explore, there are a list of ones that are considered essential. These are mostly common in Unix-based operating systems, like Linux and Mac.

  1. awk
  2. A versatile language for working with files and filtering data.
  3. Eg: awk '{print $1}' file.txt
  4. Docs
  5. cat
  6. Concatenate files and print on the standard output.
  7. Eg: cat file.txt
  8. Docs
  9. cd
  10. Change the current directory.
  11. Eg: cd /path/to/directory
  12. Docs
  13. chmod
  14. Change file mode bits (permissions).
  15. Eg: chmod 755 file.txt
  16. Docs
  17. chown
  18. Change file owner and group.
  19. Eg: chown user:group file.txt
  20. Docs
  21. cp
  22. Copy files and directories.
  23. Eg: cp file.txt /path/to/directory
  24. Docs
  25. curl
  26. Call a URL.
  27. Eg: curl https://example.com
  28. Docs
  29. df
  30. Report estimate of total filesystem disk space usage.
  31. Eg: df -h
  32. Docs
  33. du
  34. Estimate file space usage for a given path.
  35. Eg: du -sh /path/to/directory
  36. Docs
  37. echo
    • Display a line of text/string that is passed as an argument.
    • Eg: echo "Hello, World!"
    • Docs
  38. env
    • Print or set the environment variables.
    • Eg: env | grep PATH
    • Docs
  39. export
    • Set or export the environment variable.
    • Eg: export PATH=$PATH:/usr/local/bin
    • Docs
  40. find
    • Search for files in a directory hierarchy.
    • Eg: find /path/to/directory -name "*.txt"
    • Docs
  41. grep
    • Print lines matching a pattern.
    • Eg: grep "pattern" file.txt
    • Docs
  42. head
    • Output the first part of files.
    • Eg: head file.txt
    • Docs
  43. kill
    • Send a signal to a process, usually to stop the process.
    • Eg: kill -9 1234
    • Docs
  44. less
    • Opposite of more.
    • Eg: less file.txt
    • Docs
  45. ln
    • Create a symbolic link to a file.
    • Eg: ln -s /path/to/file link
    • Docs
  46. ls
    • List directory contents.
    • Eg: ls -l
    • Docs
  47. man
    • Format and display the on-line manual pages.
    • Eg: man ls
    • Docs
  48. mkdir
    • Make directories.
    • Eg: mkdir directory
    • Docs
  49. mv
    • Move files.
    • Eg: mv file.txt /path/to/directory
    • Docs
  50. netstat
    • Show network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.
    • Eg: netstat -an
    • Docs
  51. ps
    • Report a snapshot of the current processes.
    • Eg: ps aux
    • Docs
  52. pwd
    • Print name of current/working directory.
    • Eg: pwd
    • Docs
  53. rm
    • Remove files or directories.
    • Eg: rm file.txt
    • Docs
  54. sed
    • Stream editor for filtering and transforming text.
    • Eg: sed 's/old/new/g' file.txt
    • Docs
  55. sort
    • Sort lines of text files.
    • Eg: sort file.txt
    • Docs
  56. tail
    • Output the last part of files.
    • Eg: tail file.txt
    • Docs
  57. tar
    • The GNU version of the tar archiving utility.
    • Eg: tar -czvf archive.tar.gz /path/to/directory
    • Docs
  58. top
    • Display Linux processes. It provides a dynamic real-time view of the running system.
    • Eg: top
    • Docs
  59. touch
    • Change file timestamps.
    • Eg: touch file.txt
    • Docs
  60. uname
    • Print system information.
    • Eg: uname -a
    • Docs
  61. wget
    • The non-interactive network downloader.
    • Eg: wget https://example.com
    • Docs
  62. which
    • Show the full path of commands.
    • Eg: which ls
    • Docs
  63. who
    • Show who is logged on.
    • Eg: who
    • Docs
  64. xargs
    • Build and execute command lines from standard input.
    • Eg: find /path/to/directory -name "*.txt" | xargs grep "pattern"
    • Docs