Linux基本命令

  1. ls: Lists files and directories.

    • Usage: ls, ls -l (long format), ls -a (including hidden files)
  2. cd: Changes the current directory.

    • Usage: cd [directory], cd .. (parent directory), cd (home directory)
  3. pwd: Displays the path of the current working directory.

    • Usage: pwd
  4. cp: Copies files and directories.

    • Usage: cp [source] [destination], cp -r [source_directory] [destination_directory] (recursive copy)
  5. mv: Moves or renames files and directories.

    • Usage: mv [source] [destination], mv [old_name] [new_name]
  6. rm: Removes files and directories.

    • Usage: rm [file], rm -r [directory] (recursive remove)
  7. mkdir: Creates new directories.

    • Usage: mkdir [directory_name]
  8. touch: Creates a new empty file or updates the timestamp of an existing file.

    • Usage: touch [file_name]
  9. cat: Concatenates and displays the content of files.

    • Usage: cat [file], cat [file1] [file2] > [new_combined_file]
  10. grep: Searches for a specific pattern in files or input.

    • Usage: grep '[pattern]' [file], cat [file] | grep '[pattern]'
  11. find: Searches for files and directories based on various criteria.

    • Usage: find [directory] -name '[pattern]', find [directory] -type f (files only)
  12. sudo: Executes commands with superuser privileges.

    • Usage: sudo [command]
  13. chmod: Changes the permissions of files or directories.

    • Usage: chmod [permissions] [file]
  14. chown: Changes the owner and group of files or directories.

    • Usage: chown [user]:[group] [file]
  15. df: Displays disk space usage.

    • Usage: df, df -h (human-readable format)
  16. du: Displays the disk usage of files and directories.

    • Usage: du, du -h (human-readable format)
  17. ps: Shows information about active processes.

    • Usage: ps, ps -aux
  18. kill: Terminates processes.

    • Usage: kill [process_id], kill -9 [process_id] (force kill)
  19. nano, vi, emacs: Text editors for editing files.

    • Usage: nano [file], vi [file], emacs [file]
  20. man: Displays the manual page for other commands.

    • Usage: man [command]
posted @   马路野狼  阅读(10)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· DeepSeek在M芯片Mac上本地化部署
点击右上角即可分享
微信分享提示
主题色彩