L

Linux 终端备忘单(适合初学者)

2025-06-08

Linux 终端备忘单(适合初学者)

Twitter 关注

面向初学者的 Linux 速查表(简短、实用、切中要点)


Linux(实用命令)终端速查表


导航命令:

  • passwd- 更改密码
  • ls- 列出目录(可以指向机器上的任何点)
    • -la列出所有+权限和隐藏文件的标志
  • pwd- 打印工作目录 - 检查您所在的位置
  • cd- 更改目录(可以在机器文件系统的任何位置寻址)
  • mkdir- 创建目录
  • rmdir- 罢免董事
  • rm- 删除文件
  • echo- 发送数据(如果没有给出目的地,则数据将作为输出发送到终端)
  • cp复制文件(cp [source] [desintation]
  • mv-mv 文件(mv [source] [desintation]
  • locate- 在机器上定位文件(locate [filename]
  • updatedb- 更新目录数据库(必须在运行定位之前运行)
  • man- 任何命令的手册页
  • grep- 搜索以下词语(可用于检查文件是否包含特定信息)

Linux 区分大小写,因此请注意大写字母!

  • ./- 您现在的目录
  • ../- 上一个文件夹
  • ~- 用户根文件夹
  • |- 将一个命令的输出通过管道传输到另一个命令
  • >- 对以下文件使用命令(覆盖)
  • >>- 对以下文件使用命令(附加)

特权和用户命令:

  • cat- 将文件读取到终端
  • chmod- 更改文件的权限
  • adduser- 创建新用户
  • sudo- 授予执行以下命令的 root 权限
  • su- 切换用户

网络命令:

  • ifconfig- 打印网络信息
  • iwconfig- 无线网络信息
  • ping- ping 一个 IP 地址(-c标志让你定义希望 ping 给定 IP 地址的次数)
  • arp -a- 发送 arp 请求来检查网络上的机器
  • netstat -a- 显示所有开放端口以及连接到这些端口的设备
  • route- 显示路由表

查看、创建和编辑命令:

  • history- 列出您输入的 15 条命令(history | grep [command]显示您在机器上运行命令的所有时间(包括特定语法))
  • touch- 创建文件
  • nano- 使用纳米文本编辑器
  • apt-get- 安装 [程序名称] - 在机器上安装程序(无需安装即可运行)
  • apt install- 从系统/kali-服务器安装文件
  • apt purge- 程序名称 - (您必须使用**)
  • pip install- 运行本地文件的安装程序
  • git clone- 克隆 github 存储库(这是一个插件,在大多数 Linux 发行版上并未预装!)

Web服务器命令:

  • service apache2 start- 启动网络服务器
  • service ssh start- 启动 ssh 服务器
  • service postgresql start- 以 metasploit 启动的服务
  • service apache2 stop- 停止网络服务器
  • systemctl enable [program name]- 机器开机时启动服务

Linux中的重要文件/目录:

  • /etc/passwd- 存储系统中所有用户的文件
  • /etc/shadow- 存储系统中的所有密码
  • /var/log/auth.log- 认证报告

感谢您的阅读,欢迎关注 Clean Code Studio 了解更多信息!

--- ### 结束 --- [Clean Code](https://cleancode.studio/clean-code) [Java Script 设计模式](https://cleancode.studio/design-patterns) [JavaScript 算法示例](https://cleancode.studio/algorithms) --- [Clean Code Studio](https://cleancode.studio) ☕️ 代码技巧 ☕️ 职业建议 ☕️ 开发者表情包闪亮按钮,精美 𝗡𝗲𝘄𝘀𝗹𝗲𝘁𝘁𝗲𝗿 👇,精彩的开发技巧……想加入吗? [![是的,我想加入!点击按钮注册 Clean Code Studio 简报](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f7hwc3k4pzedr59fnr9r.png)](https://cleancodestudio.paperform.co/) (发现我的 [50+ 页] 个人 FAANG 访谈笔记!) --- [在 Twitter 上关注@cleancodestudio ](https://twitter.com/cleancodestudio) [在 YouTube 上关注@cleancodestudio ](https://youtube.com/c/cleancodestudio) [在 TikTok 上关注@cleancodestudio ](https://tiktok.com/ @cleancodestudio ) [在 Facebook 上关注@cleancodestudio ](https://facebook.com/cleancodestudio) [在 Instagram 上关注@cleancodestudio ](https://instagram.com/cleancodestudio) [在 LinkedIn 上关注@cleancodestudio ](https://linkedin.com/company/cleancodestudio) [在 Reddit 上关注@cleancodestudio ](https://reddit.com/r/cleancodestudio) [在 Dev.to 上关注@cleancodestudio ](https://dev.to/cleancodestudio) [在 Stack Overflow 上关注@cleancodestudio ](https://stackoverflow.com/users/8541350/clean-code-studio) [在 npm 上关注@cleancodestudio软件包](https://npmjs.com/~zhorton999) [在 packagist 上关注@cleancodestudio软件包](https://packagist.org/packages/clean-code-studio) [在 Github 上为 @cleancodestudio加星标](https://github.com/zhorton34)
鏂囩珷鏉ユ簮锛�https://dev.to/cleancodestudio/linux-terminal-cheat-sheet-useful-for-beginners-2e6c
PREV
向您的网站添加加载器
NEXT
14 种 JavaScript 数组方法(8 分钟内)