go backBack to blog

Basic Terminal Commands

Published on Jan 22 2023

Last updated on Apr 23 2024

Photo by Sarah Dorweiler on Unsplash
No translation available.
Add translation

Terminal commands are essential tools for developers, allowing them to interact with their operating systems and execute various tasks more efficiently. The command-line interface provides a streamlined and powerful way to manage and manipulate files, directories, and processes on your system.

In this post, we'll cover more than 90 most commonly used and helpful terminal commands for web developers using VS Code and Linux. These commands are suitable for both back-end and front-end development and include powerful tools such as grep, awk, sed, lsof, curl, wget, tail, head, less, find, ssh, kill, and dig.

  1. cd - Change directory: allows you to change your current working directory.

  2. ls - List files: displays the contents of the current directory.

  3. mkdir - Make directory: creates a new directory.

  4. touch - Create a new file: creates a new file with the specified name.

  5. mv - Move file: moves or renames a file.

  6. cp - Copy file: copies a file to a new location.

  7. rm - Remove file: deletes a file.

  8. cat - Concatenate files: displays the contents of one or more files.

  9. echo - Print text: displays text on the terminal.

  10. pwd - Print working directory: displays the current working directory.

  11. clear - Clear the terminal: clears the terminal screen.

  12. chmod - Change file permissions: changes the permissions of a file or directory.

  13. chown - Change file ownership: changes the owner of a file or directory.

  14. sudo - Superuser do: executes a command with elevated privileges.

  15. df - Disk free: displays information about available disk space.

  16. du - Disk usage: displays information about disk usage for a file or directory.

  17. tar - Archive files: creates or extracts a compressed archive.

  18. top - Display running processes: displays a list of running processes.

  19. ps - Process status: displays information about running processes.

  20. kill - Stop a process: stops a running process.

  21. ping - Test network connectivity: tests network connectivity to a specified host.

  22. ifconfig - Network interface configuration: displays network interface configuration information.

  23. netstat - Network statistics: displays network connection information.

  24. traceroute - Trace network route: traces the network route between two hosts.

  25. ssh - Secure shell: connects to a remote host using SSH.

  26. scp - Secure copy: copies files between hosts over SSH.

  27. grep - Search for text: searches for a specified pattern in a file.

  28. awk - Text processing: processes text files using pattern matching.

  29. sed - Stream editor: performs text transformations on a stream of text.

  30. lsof - List open files: displays information about open files and processes.

  31. curl - Transfer data from or to a server: transfers data from or to a server using various protocols.

  32. wget - Retrieve files from the web: retrieves files from the web using HTTP, HTTPS, or FTP.

  33. tail - Display end of file: displays the end of a file.

  34. head - Display beginning of file: displays the beginning of a file.

  35. less - Page through file: allows you to page through a file.

  36. find - Search for files: searches for files based on various criteria.

  37. diff - Compare files: compares two files and displays the differences.

  38. unzip - Extract compressed files: extracts files from a compressed archive.

  39. zip - Compress files: compresses files into a zip archive.

  40. rsync - Remote synchronization: synchronizes files and directories between two hosts.

  41. ssh-keygen - Generate SSH keys: generates public and private SSH keys.

  42. ssh-copy-id - Copy SSH keys: copies your public SSH key to a remote host.

  43. htop - Process monitor: displays a list of running processes and their resource usage.

  44. nc - Netcat: a versatile networking tool that can be used for various tasks such as port scanning, file transfers, and network debugging.

  45. nmap - Network mapper: a powerful tool for network exploration and security auditing.

  46. dig - DNS lookup: performs a DNS lookup for a specified domain.

  47. host - DNS lookup: performs a DNS lookup for a specified domain.

  48. curlftpfs - Mount FTP server: mounts an FTP server as a local file system.

  49. sshfs - Mount SSH server: mounts an SSH server as a local file system.

  50. screen - Terminal multiplexer: allows you to run multiple terminal sessions within a single window.

  51. tmux - Terminal multiplexer: a more modern alternative to screen that offers more advanced features.

  52. cut - Text processing: extracts columns from a file.

  53. paste - Text processing: merges lines from two or more files.

  54. sort - Text processing: sorts lines in a file.

  55. uniq - Text processing: removes duplicate lines from a file.

  56. tr - Text processing: replaces or deletes characters in a file.

  57. wc - Word count: displays the number of lines, words, and characters in a file.

  58. diff - Compare files: compares two files and displays the differences.

  59. patch - Apply patches: applies patches to files.

  60. locate - Search for files: searches for files based on a specified name or pattern.

  61. whereis - Locate binary files: locates the binary, source, and manual page files for a command.

  62. which - Locate binary files: displays the path to the binary file for a command.

  63. pkill - Stop processes by name: stops all processes with a specified name.

  64. free - Memory usage: displays information about memory usage.

  65. uptime - System uptime: displays system uptime and load averages.

  66. date - Display date and time: displays the current date and time.

  67. cal - Display calendar: displays a calendar for a specified month and year.

  68. ln - Create links: creates hard or symbolic links to files.

  69. pwd - Print working directory: displays the current working directory.

  70. pushd/popd - Change directory stack: allows you to switch between directories using a stack.

  71. history - Command history: displays a list of previously executed commands.

  72. alias - Create command aliases: creates aliases for frequently used commands.

  73. export - Set environment variables: sets environment variables for the current session.

  74. source - Execute a script: executes a script in the current shell session.

  75. su - Switch user: switches to a different user account.

  76. useradd - Add user: creates a new user account.

  77. usermod - Modify user: modifies an existing user account.

  78. passwd - Change password: changes the password for a user account.

  79. groupadd - Add group: creates a new group.

  80. groupmod - Modify group: modifies an existing group.

  81. userdel - Delete user: deletes a user account.

  82. groupdel - Delete group: deletes a group.

  83. reboot - Restart system: restarts the system.

  84. shutdown - Shutdown system: shuts down the system.

  85. fzf - Fuzzy finder: allows you to quickly find files and directories by typing a partial string of their name or path.

  86. ag - Silver searcher: a faster and more efficient alternative to grep for searching for text in files.

  87. bat - Cat with syntax highlighting: a replacement for the cat command that adds syntax highlighting to the output.

  88. exa - ls replacement: a replacement for the ls command that adds additional features and improved formatting.

  89. tree - Display directory tree: displays the directory structure of a specified directory as a tree.

  90. ncdu - Disk usage analyzer: a tool for analyzing disk usage and finding large files and directories.

  91. trash-cli - Move files to trash: moves files and directories to the system trash instead of permanently deleting them.

  92. xargs - Execute command with arguments: executes a command with arguments taken from standard input.

  93. crontab - Schedule jobs: creates a schedule for running jobs or scripts automatically.

These are just some of the many terminal commands that are available for developers to use. Whether you are a back-end or front-end developer, knowing these commands can help you work more efficiently and effectively on your projects. By mastering the terminal, you can become a more productive and efficient developer.

How to improve your terminal command skills

One great way to improve your terminal command skills is by practicing with online resources such as cmdchallenge.com. This website provides a series of challenges that test your knowledge of various terminal commands. Each challenge presents a problem, and you must use your knowledge of the terminal to find the solution. With over 20 levels and 200 challenges, it is a fantastic way to develop your skills and become more proficient with the terminal.

Tags:
miscellaneous
My portrait picture

Written by Alissa Nguyen

Alissa Nguyen is a software engineer with main focus is on building better software with latest technologies and frameworks such as Remix, React, and TailwindCSS. She is currently working on some side projects, exploring her hobbies, and living with her two kitties.

Learn more about me


If you found this article helpful.

You will love these ones as well.

  • Photo by Cristina Gottardi on Unsplash
    Jan 22 2023 — 5 min readPOSIX Basics
    #miscellaneous
  • what-is-a-cms 870x450
    Mar 11 2022 — 5 min readHeadless CMS vs. Traditional CMS
    #miscellaneous
  • Image by aj_aaaab on Unsplash
    Jan 19 2023 — 5 min readStatic Dispatch vs. Dynamic Dispatch
    #miscellaneous

  • Built and designed by Alissa Nguyen a.k.a Tam Nguyen.

    Copyright © 2024 All Rights Reserved.