
linux-command
kong-kong
记录流水账
展开
-
linux批量解压zip文件
方法1 find . -name '*.zip' -exec unzip {} \; 方法2 ls *.zip | xargs -n1 unzip -o 方法3 # for i in *.zip > do > unzip -o $i > done转载 2021-01-18 17:44:54 · 3279 阅读 · 0 评论 -
linux查看2进制文件
hexdump 语法SYNOPSIS hexdump [options] file [...] -n length (Interpret only length bytes of input.) -s offset Skip offset bytes from the beginning of the input. -x 两字节的十六进制显示 # 查看整个文件 hexdump mapper2 # 查看前100个字节 hexdump mapper2 -n 100 ...原创 2020-12-26 10:33:06 · 307 阅读 · 0 评论 -
查看Centos系统信息
查看物理CPU个数、核数、逻辑CPU个数 # 查看物理CPU个数 cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l # 查看每个物理CPU中core的个数(即核数) cat /proc/cpuinfo| grep "cpu cores"| uniq # 查看逻辑CPU的个数 cat /proc/cpuinfo| grep "processor"| wc -l # 总核数 = 物理CPU个数 X 每颗物理CPU的核数 # 总逻辑C原创 2020-12-14 20:02:49 · 447 阅读 · 0 评论 -
ps命令
语法 ps [options] 例子 To see every process on the system using standard syntax: ps -e ps -ef ps -eF ps -ely To see every process on the system using BSD syntax: ps ax ps axu To p原创 2020-09-21 14:45:11 · 359 阅读 · 0 评论 -
linux安装软件命令
#pstree yum -y install psmisc原创 2020-08-21 08:27:52 · 358 阅读 · 0 评论 -
tail
语法 # tail 用的最多的就是tail -f filename tail [OPTION]... [FILE]... OPTION -c, --bytes # output the last K bytes; -f # 监视文本 动态显示新增的内容 -F # --follow=name --retry 如果再次创建相同的文件名,会继续监视 -n, --lines # 查看最后几行 默认10 tail -f 和 tail -F...原创 2020-08-20 18:31:45 · 253 阅读 · 0 评论 -
head
语法 head [OPTION]... [FILE]... OPTION # 默认字节bytes 可以指定K、M -c, --bytes # 默认前10行 指定前几行 -n, --lines # 显示文件名 -v -v原创 2020-08-20 18:11:57 · 594 阅读 · 0 评论 -
less
语法 less [-[+]aABcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX~] [-b space] [-h lines] [-j line] [-k keyfile] [-{oO} logfile] [-p pattern] [-P prompt] [-t tag] [-T tagsfile] [-x tab,...] [-y lines] [-[z] lines] [-# shift].原创 2020-08-20 18:01:02 · 318 阅读 · 0 评论 -
wc命令
语法 wc [OPTION]... [FILE]... OPTION -c, --bytes print the byte counts -m, --chars print the character counts -l, --lines print the newline counts -L, --max-line-length print the length of the longest l..原创 2020-08-20 08:54:33 · 269 阅读 · 0 评论 -
grep
egrep 相当于 grep -E (扩展正则表达式) #扩展正则表达式 grep -E #匹配多个模式 grep -e #忽略大小写 grep -i #模式匹配整个单词 grep -w #匹配整行 grep -x #打印不匹配的行 grep -v #打印a b 相同的行 grep -f a b -n 打印行号 -c 打印每个文件匹配的行数 -...原创 2019-04-15 00:11:08 · 277 阅读 · 0 评论 -
awk
$0 表示整个当前行 $1 每行第一个字段 NF 字段数量变量 NR 每行的记录号,多文件记录递增 FNR 与NR类似,不过多文件记录不递增,每个文件都从1开始 # 根据:分隔 awk -F : '{print $1}' /etc/passwd ...原创 2019-04-14 23:40:56 · 386 阅读 · 0 评论 -
sed命令
语法 man sed sed [OPTION]... {script-only-if-no-other-script} [input-file]... 参数说明 -n, --quiet, --silent 只显示script处理后的结果 -e script, --expression=script 以指定的script来执行 -f script-file, --file=script-file 以指定的script文件来执行 ...原创 2020-08-19 18:50:12 · 319 阅读 · 0 评论 -
linux命令
nl #显示行号 默认右对齐 nl /etc/passwd #显示行号 左对齐 nl -n ln /etc/passwd原创 2020-08-19 18:53:02 · 238 阅读 · 0 评论