随笔分类 - ③linux基础命令
摘要:#####wc -l 统计行号 [root@rongbiz002 26]# wc -l /etc/passwd 30 /etc/passwd
阅读全文
摘要:######cut -d 指定分隔符 -f 指定列数 1,2,3 [root@rongbiz002 26]# awk '{print $1}' /www/wwwlogs/c2p.rongbiz.com-access_log|head -n5 |cut -d '.' -f 1,2,3 112.64.5
阅读全文
摘要:uniq -c统计次数 [root@rongbiz002 26]# awk '{print $1}' /www/wwwlogs/c2p.rongbiz.com-access_log|sort |uniq -c|sort -k1rn|head 2709 112.64.53.246 2668 120.5
阅读全文
摘要:######sort -t 指定分隔符 -k 指定那一列排序 [root@rongbiz002 ~]# awk '{print $1}' /www/wwwlogs/www.rongbiz.com-access_log |sort -t "." -k2|head 120.0.113.75 112.0.
阅读全文
摘要:which command which ls alias ls='ls --color=auto' /usr/bin/ls
阅读全文
摘要:curl -o 下载到某个目录 并重命名 curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
阅读全文
摘要:下载软件 wget wget -O 把文件下载到某个目录 并重命名 wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo wget --limit-rate=100k
阅读全文
摘要:#####根据内容过滤文本信息 #####grep [root@rstx-201 ~]# grep root /etc/passwd root:x:0:0:root:/root:/bin/bash operator:x:11:0:operator:/root:/sbin/nologin 加上通配符^
阅读全文
摘要:######tail 查看文件的尾部信息 默认后10行 [root@rstx-53 test]# tail /etc/passwd openvpn:x:995:991:OpenVPN:/etc/openvpn:/sbin/nologin postgres:x:26:26:PostgreSQL Ser
阅读全文
摘要:#####head 查看文件头部内容 默认前十行 [root@rstx-201 ~]# head /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbi
阅读全文
摘要:######cat #查看文件内容 [root@rstx-53 test]# cat /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbi
阅读全文
摘要:rm 删除 remove #####绕过交互删除 -f [root@rstx-53 test]# rm file rm: remove regular empty file ‘file’? n [root@rstx-53 test]# fm -f file -bash: fm: command no
阅读全文
摘要:移动文件和目录 ######改名 [root@rstx-53 test]# mv file.txt /tmp/file_txt [root@rstx-53 test]# ls [root@rstx-53 test]# ll /tmp/file_txt -rw-r--r-- 1 yangtao yan
阅读全文
摘要:cp 复制 copy ######复制文件 -v显示过程 [root@rstx-53 test]# touch file.txt [root@rstx-53 test]# cp file.txt /tmp/file_copy [root@rstx-53 test]# ll /tmp/file_cop
阅读全文
摘要:#####以树状的结构显示目录和文件 [root@rstx-201 ~]# tree . ├── anaconda-ks.cfg ├── test └── test2 ├── 1 └── 2 4 directories, 1 file #显示文件和目录的数量 ######tail -L 查看目录层数
阅读全文
摘要:#####mkdir make directory 选项 -v 显示创建详情 -p 递归创建 [root@rstx-201 ~]# mkdir test/test/test -vp mkdir: created directory ‘test’ mkdir: created directory ‘t
阅读全文
摘要:#####touch 创建文件 ######touch file 无则创建 有责修改创建时间 [root@rstx-201 ~]# touch file [root@rstx-201 ~]# ll -rw-r--r-- 1 root root 0 Feb 25 22:28 file [root@rs
阅读全文
摘要:cd 回到家目录 cd ~ 回到家目录 cd . 回到当前目录 cd .. 回到上级目录 cd - 回到上一次所在的目录
阅读全文
摘要:#####1 . ..代表什么 . 代表当前目录 .. 代表上级目录 #####从根/开始的路径是'绝对路径' [root@rongbiz002 ~]# cd /etc/skel/ #####从当前位置开始的目录为'相对路径' [root@rongbiz002 /]# cd etc/skel/
阅读全文
浙公网安备 33010602011771号