美文网首页
bash常用命令

bash常用命令

作者: 追卓2018 | 来源:发表于2017-06-28 22:38 被阅读0次

常见命令格式:命令 [-options] [参数]

配置用户

git config --global user.name "自已的名字"

git config --global user.email "自已的邮箱地址"

pwd (Print Working Directory) 查看当前目录

cd (Change Directory) 切换目录,如 cd /etc

ls (List) 查看当前目录下内容,如 ls -al

mkdir (Make Directory) 创建目录,如 mkdir blog

touch 创建文件,如 touch index.html

wc (Word Count) 字数信息统计,如 wc index.html

wc -l filename 报告行数wc -c filename 报告字节数

wc -m filename 报告字符数wc -w filename 报告单词数

cat 查看文件全部内容,如 cat index.html

more less 查看文件,如more /etc/passwd、less /etc/passwd

rm (remove) 删除文件,如 rm index.html、rm -rf  blog

rmdir (Remove Directory) 删除文件夹,只能删除空文件夹,不常用

mv (move) 移动文件或重命名,如 mv index.html ./demo/index.html

cp (copy) 复制文件,cp index.html ./demo/index.html

head 查看文件前几行,如 head -5 index.html

tail 查看文件后几行 –n –f,如 tail index.html、tail -5 index.html 

tab 自动补全,连按两次会将所有匹配内容显示出来

history 查看操作历史

ssh 远程登录,如ssh root@gitlab.study.com

> 和 >>重定向,如echo hello world! > README.md,>覆盖 >>追加

把原来输入的内容,自己指定到别的地方。

把原本输出到屏幕上的内容,写入到指定的文件当中。如果文件不存在,会自动帮你创建文件。

wget 下载,如wget https://nodejs.org/dist/v4.4.0/node-v4.4.0.tar.gz

tar 解压缩,如tar zxvf node-v4.4.0.tar.gz

curl 网络请求,如curl http://www.baidu.com

who am i 查看当前用户

| 管道符

把上一次的结果当做下一次的参数。

grep 匹配内容,一般结合管道符使用

相关文章

  • 近期常用

    bash 脚本要点 bash testing vim:你的不二选择 JSON 若干约定 Linux 常用命令 Bu...

  • Git Bash中基本命令

    Bash中基本操作命令 基本配置常用命令 分支常用命令 标签常用命令 创建标签 删除标签 推送标签 删除远程标签

  • ubuntu常用系统命令

    <命令> [<参数>] [<目标>] 在线帮助文档 Bash快捷键以及设置 常用命令 Bash内部命令 部分系统命...

  • git cmd

    GitHub Commands git 常用命令 注册 SSH key 以便git bash 可以push req...

  • Docker常用命令

    docker常用命令 进入容器 docker run -it xxxxx:1.1 /bin/bash 构建容器 d...

  • GitHub版本控制

    1、常用命令简表 常用命令详细版本 2、本地的版本库创建 ①Git Shell中bash命令行创建文件夹(wind...

  • Mac终端设置别名

    编辑~/.bash_profile,加入常用命令别名,例如我加入了以下命令的别名:alias pull = 'gi...

  • 常用的linux命令<一>

    1. 常用命令介绍 2. crontab定时SHELL=/bin/bash 3. 杀死命令 4. 常用

  • Docker

    1、常用命令 进入容器:docker exec –it 0e2801cbb8bf /bin/bash 启动容器:d...

  • 常用命令行及explainshell.com的简单使用

    学习目标 常用命令行的使用 explainshell.com的使用技巧 打开git Bash,执行下面命令 通过 ...

网友评论

      本文标题:bash常用命令

      本文链接:https://www.haomeiwen.com/subject/ggcpcxtx.html