linux常用命令

1、解压bz2后缀的压缩包:   yum -y install bzip2

2、查看所有端口netstat  :  yum install net-tools

3、kill -all不掉时安装命令 :   yum install psmisc

4、centos7查看当前防火墙状态:systemctl status firewalld.service    

                         关闭当前防火墙:systemctl stop firewalld.service    

                         开机防火墙不启动:systemctl disable firewalld.service

5、安装wget:yum -y install wget

6、监控网卡流量:iftop -i lo -n -P -m 100M

7、jmeter脚本启动:sh jmeter.sh -n -t online-tts-test-v1.0.jmx

8、逻辑CPU个数:    # cat /proc/cpuinfo | grep "processor" | wc -l

9、 物理CPU个数:    # cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l            

       每个物理CPU中Core的个数:    # cat /proc/cpuinfo | grep "cpu cores" | wc -l

10、模拟网络延迟:tc qdisc add dev em3 root netem delay 5000ms                

                      恢复:tc qdisc del dev em3 root

11、excel中批量添加后缀:ctrl +E

12、pip版本查看:pip -V

13、安装rz、sz:yum install -y lrzsz

14、根据pid查看程序所在目录:ll /proc/pid

15、zip打包:zip 打包名称.zip 原文件

16、yum安装zip、unzip:yum install zip/unzip

17、大量cp文件:find source/ -name "*.txt" | xargs -i mv {} target/                            

                              find  -name "*.wav" | xargs -i cp {} 目录文件夹                            

                              find . -name "*" -type f -size 0c | xargs -n 1 rm -f---删除文件为0的

18、查看linux系统内核:uname -a    或cat /proc/version

19、sed命令批量替换文件内容:sed -i "s/old/new/g"  test3.txt

20、批量获取当前目录下文件名称:ls | grep ".wav$" > list.txt

21、查看进程的线程数:pstree -p  进程号        

                                      cat  /proc/进程号/status

22、调试core文件:gdb 程序 -c core

23、永久生效core:编辑vi /etc/security/limits.conf        

                      增加:*  soft   core unlimited        

        或者:vi ~/.bashrc      

                 增加ulimit -c unlimited      

                 source ~/.bashrc

24、创建软连接:ln -s 源文件 目标文件

25、开放端口: /sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT        

        查看开放端口:lsof -i :3306

26、查看当前文件夹所有文件大小并排序:du -sh * | sort -n

27、拷贝指定数量的文件:复制前100:ls |head -n 100|xargs -i cp {} /tmp                                  

                                            复制后100: ls |tail -n 100|xargs -i cp {} /tmp

28、查看目录下所有语音时长总和(秒):soxi -D * |awk '{total +=  $0};END{print total}'

29、转换文件格式编码:iconv -f gb2312 -t utf-8 原文件 >输出.txt

30、将文件夹下文件名写入到文件:find ./eng_wav/*.wav >eng.list

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值