Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1838288
  • 博文数量: 184
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 2388
  • 用 户 组: 普通用户
  • 注册时间: 2016-12-21 22:26
个人简介

90后空巢老码农

文章分类

全部博文(184)

文章存档

2021年(26)

2020年(56)

2019年(54)

2018年(47)

2017年(1)

我的朋友

分类: LINUX

2018-06-24 23:45:42

前一阵子一直在看这本书,在此记录下自己觉得容易忽视的一些命令以及选项,以备后续查找,估计各位看官看着肯定是非常乱的了~~
bc: 可以进行浮点数运算;e.g.: echo “4*0.56” | bc --------> 2.24
tr: translate 简写,
    -d:删除全部匹配字符
    -s:当出现连续多个匹配字符时,仅保留一个
cat  vs  tac: 正(反)打印文件内容
$@: 全部变量,并且每个变量可以单列
$#: 全部变量,并且每个变量不可单列,全部变量作为一个整体
[contitiion] && action: 前为真,后执行;
[condition]|| action: 前为假,后执行;
字符串比较相等用[[ expr1 ]] || [[ expr2 ]]
$find . type f -perm 644 -prune(取反)
#find . -type f -user root -exec chown slynx {} \;
subshell: ()
ctime: 修改元数据时间; 
mtime: 修改数据时间;
^$: 匹配空格;
%:从右向左匹配,非贪心,%%,贪心
#:从左向右匹配,非贪心, ##, 贪心
$IFS: oldIFS=$IFS; IFS=":"; IFS=$oldIFS;
tput sc; tput rc; tput ed;
paste: merge multiple files
split, csplit -s(ilent)
script -t 2>timing.log -a output.session & cmds
scriptreplay timing.log output.session
awk: -F:(分隔符), NR, NF, '/start_pattern/, /end_pattern/'
cut: -d":"(分隔符)  -f{1,2,3} -c-10(前10个字符)
sticky-bit: a+t
diff: -u(niform)
comm: -1 -2 -3
grep: -q(uiet), -z(每个匹配以'\0'结尾, -A, -B, -C
sort: -n(umeric) -r(everse)
xargs: -1 -0
head: (-n 2)==(-n +2) 头两行, -n -2 除去末尾两行
tail: (-n 2)==(-n -2) 尾两行, -n +2从第二行开始
lynx: plain text
curl: -s(不显示进度)
        -d(ata)  "var1=1&var2=2"
var_list ap; va_stat(fmt, ap); var_arg(ap, int);var_end(ap);;
sed 's/~/~/g'
fping(icmp): -a(live), -u(nreachable), -g(支持ip段) -d支持dns返回结果 -f 从指定文件读取输入
hping(tcp):-p端口 -s 设置tcp模式syn包 -a(模拟其他IP地址)
< DATA;
EOF
iwconfig , iwlist
du: -s(ummarise) -h(uman readable) -c(更详细的-s)
time cmd
登录: who, w, users | last lastb(locked, #)
uptime: 开机时长,可同时获取loadaverage[1min, 5min, 15min]
历史命令:~/.bash_history
watch -n 5 'ls -l' 每隔5s打印ls -l结果 -d高亮不同部分
inotifywait: -m:持续监控
                -r: 递归
                -e:事件
                -q(uiet)  $path
logrotate: 控制日志文件大小
ps: -f(ull)
    -e(very)
    -ax:all
    -o colomns: 输出指定列[pcpu,pid,ppid,pmem,comm,cmd,user,nice,time,etime,tty,euid,state]
    --sort -colums: 根据指定列排序
    -C CMD(pgrep CMD): 指定命令产生的进程
    -u:effective user
    -U:real user
    -t: ttyfilter
    -L: 显示线程信息,之后多了两行(线程数以及线程ID)
ps -eo pid,cmd e: 输出pid cmd 以及环境变量
top: cpu consuming process
kill -9 PID
trap 'sig_handler_func' SIGNAL LIST
which, whereis, file, whatis,
wall: write messages on the terminals of all logged in terminal
uname: -n(hostname)
            -a(ll)
            -r(elease)                        
/proc/
crontab: min hour day month weekday CMD
    -u(ser) -r(emove)

阅读(3358) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~