linux中常用的一些命令
来源:互联网 发布:南山空同 知乎 编辑:程序博客网 时间:2024/05/01 11:45
tshark抓包
sudo tshark -s 512 -i eth0 -n -f 'tcp dst port 80' -R 'http.host and http.request.uri' -T fields -e http.host -e http.request.uri -l | tr -d '\t'
查看CPU的型号
cat /proc/cpuinfo | grep name | cut -f2 -d: |uniq -c
查看CPU 几核几线程
grep 'processor' /proc/cpuinfo |sort -u |wc -lgrep 'core id' /proc/cpuinfo |sort -u |wc -l
以人性化的展示文件大小
du -h file
文本按照列进行合并
paste -d" " file1 file2 >> newFile
查看端口被哪个进程占用 以80端口为例:
sudo lsof -i: 80
端口扫描:
nmap ip
删除txt文本中的第一列的命令:
sed -i -r -e "s/^[[:space:]]+//" -e "s/^[^[:space:]]+[[:space:]]+//" *.txt
把log.txt中的前600行追加到log1.txt中去
sed -n '1,600 p' log.txt > log1.txt
查看文件的编码:
enca -L zh filename.java
解压/压缩 命令:
后缀为gz:
解压:gzip -d FileName.gz压缩:gzip FileName
后缀为.tar.gz
解压:tar zxvf FileName.tar.gz压缩:tar zcvf FileName.tar.gz
压缩为zip
zip -r myfile.zip myfile/*
后缀为.bz2
解压:bzip2 -d fleName.bz2压缩: bzip2 -z fileName
后缀为.rar
解压:rar a FileName.rar压缩:r ar e FileName.rar
后缀为.tgz
解压:tar zxvf FileName.tgz
linux 查看外网ip
curl ifconfig.mecurl http://members.3322.org/dyndns/getip
在控制台打开某个文件窗口
nautilus /home/***
输出某一列
cat ××.txt |awk '{print $1}' >> out.txt
循环读取文件夹中的文件并保存为新的文件
for file in *do if test -f $file then #echo $file is file! cat $file |awk '{print $2}' >'N'$file else echo $file is mulu! fidone
windows文件拷贝到linux乱码时 指定编码
iconv -f GBK -t UTF-8 file1 -o file2
批量转码shell
#!/bin/shfor i in *doiconv -f gb2312 -t utf-8 $i >tmpcp tmp $idone
文本去空格
sed s/[[:space:]]//g
文本文件内容洗牌
cat in.txt | awk 'BEGIN{srand()}{print rand()"\t"$0}' | sort -k1,1 -n | cut -f2- > out.txt
awk -F ',' '{print $14,$15}' cup14w15w >> newcup
参考 >http://linuxtools-rst.readthedocs.io/zh_CN/latest/base/index.html
http://man.linuxde.net/tee
1 0
- 工作中一些常用的linux命令
- linux中常用的一些命令
- linux中一些常用的命令
- linux中一些常用的命令总结
- 常用的一些linux命令,不断完善中
- linux常用的一些命令
- 一些常用的linux命令
- 一些常用的Linux命令
- 一些常用的Linux命令
- linux一些常用的命令
- linux常用的一些命令
- linux 一些常用的命令
- Linux常用的一些命令
- linux常用的一些命令
- Linux常用的一些命令
- 一些常用的linux命令
- 一些常用的linux命令
- 一些常用的linux命令
- 孙孙啊i之项目实战(四) 广告页制作
- static 全局变量 和 普通全局变量区别
- 旋转字符串
- 可变参数
- js模块化require.js真的蛮有用
- linux中常用的一些命令
- mongodb查看当前操作db.currentOp()
- SparkStreaming基于Kafka Direct
- android 设置自定义dialog大小无效果
- 用unordered_map代替hash_map
- 魔兽世界任务制作教学,已经本人自己服务器中测试
- 一、OOP概念
- CocoPods的安装步骤
- 身份证号码生成