The most common commands in Linux

1. Linux background:

Linux is an open source Unix-like operating system originally developed by Linus Torvalds in 1991 with extensive participation from developers around the world. It is known for its stability, security, and flexibility, and is widely used in server environments and embedded devices.

  1. File and directory operations:

    • ls: list files and directories
    • pwd: display the current working directory
    • cd: switch directory
    • tree: display the directory hierarchy in a tree structure
    • touch: create or modify files
    • mkdir: create a directory
    • rmdir: remove empty directories
    • rm: delete a file or directory
    • cp: copy a file or directory
    • mv: move a file or directory, or rename a file
  2. File content view:

    • cat: View file content
    • more: display the file content page by page
    • less: similar to more, providing more browsing functions
    • head: display the first few lines of the file
    • tail: display the last few lines of the file
    • grep: search for matching text patterns in files
  3. System Information and Administration:

    • man: view the help manual of the command
    • date: display the current date and time
    • cal: display the calendar
    • whoami: Display the current username
    • uname: display system information
    • top: real-time display of system resource usage
    • ps: View current process information
    • kill: end the specified process
  4. Compression and decompression:

    • zip: Compress files into zip format
    • unzip: unzip zip file
    • tar: Create a tar archive, or extract a tar file
  5. Network related:

    • ping: test network connection
    • ifconfig: Display and configure network interface information
    • ssh: remote login secure shell protocol
  6. User and permission management:

    • su: switch user
    • sudo: Execute commands as a superuser
    • chown: Change the owner of a file or directory
    • chmod: modify the permissions of a file or directory
  7. Process control:

    • bg: Put the process to run in the background
    • fg: switch the background process to the foreground
    • nohup: continue running processes after disconnecting the terminal
  8. File Search and Find:

    • find: search for files in the directory tree
    • locate: Quickly locate files through the database
    • which: display the path of the executable program
    • whereis: Find binary, source and help page files
  9. Text processing:

    • awk: text analysis and processing tool
    • sed: Streaming text editor
    • cut: extract text by columns
    • sort: sort text lines
    • uniq: remove duplicate lines
    • wc: Count the number of bytes, words and lines in the file
  10. Network Configuration and Diagnostics:

    • ifconfig: Display and configure network interface information
    • netstat: display network status information
    • traceroute: trace the transmission path of network packets
    • nslookup: query DNS server records
    • wget: download files from the network
    • curl: Get web content or interact with the server
  11. System Management:

    • shutdown: shut down or restart the system
    • reboot: restart the system
    • systemctl: manage system services (for distributions using systemd)
    • df: display disk space usage
    • du: View the disk usage of a file or directory
    • free: display memory usage
  12. Package management:

    • apt/yum/dnf: package manager (for different distributions)
    • apt-get/yum/dnf install: install the package
    • apt-get/yum/dnf update: update installed packages
    • apt-get/yum/dnf remove: uninstall the package

 

Guess you like

Origin blog.csdn.net/weixin_74021557/article/details/131373691