linux常用命令

查看cpu信息
lscpu

cpu 型号
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c

物理cpu
cat /proc/cpuinfo | grep "physical id" | sort | uniq|wc -l

逻辑cpu
cat /proc/cpuinfo | grep "processor" |wc -l

cpu 核数
cat /proc/cpuinfo | grep "cores"|uniq

查看linux内核版本

uname -a

查看linux系统版本

cat /etc/redhat-release

查询端口80被占用的连接
netstat   -anpt | grep   80 

查询端口3000被占用的进程
lsof -i:3000

查看云端支持安装的openjdk版本
yum search java|grep openjdk  

查询java安装的绝对路径
which java

查看当前目下所有文件夹及文件的大小

du -sh *

按时间升序显示当前目录文件
ll -hrt

查看java日志
less *.log |grep '要查的关键字'

shfit+G 移动到日志结尾

less 1.log然后/关键字 回车, 小写n下翻,大写N上翻

配置非22端口

1. vi /etc/ssh/sshd_config

# Port 22 更改端口,并打开注释

2.如果是集群间免密登录,配置如下

[root@yy1 ~]# cat .ssh/config

Host yy1

    Hostname yy1

    port 端口

    User root

Host yy2

    Hostname yy2

    port 端口

    User root

Host yy3

    Hostname yy3

    port 端口

    User root

查看hadoop的yarn日志
 yarn logs -applicationId application_1656991740104_0001

linux定时任务crontab -e

位数每位的含义
5位:* * * * *分、时、天、月、周
6位:* * * * * *秒、分、时、天、月、周
7位:* * * * * * *秒、分、时、天、月、周、年

表达式举例:

0 1 * * * 每天的凌晨1点执行任务

0 0-12 * * * 每天0-12点每小时执行一次任务

0 0-12/2 * * * 每天0-12点每2小时执行一次任务

0 0,2 * * * 每天0点和2点执行一次任务

定时任务举例:

0 1 * * * sh /home/test.sh >> /home/test/log/log_`date '+\%Y\%m\%d'`.log 2>&1

FIO测试硬盘读写性能(建议ssd设置size=500G,hhd设置size=300G)
随机写
fio -filename=/data/file.txt -direct=1 -iodepth 1 -thread -rw=randwrite -ioengine=psync -bs=8k -size=500G -numjobs=10 -runtime=60 -group_reporting -name=mytest

随机读
fio -filename=/data/file.txt -direct=1 -iodepth 1 -thread -rw=randread -ioengine=psync -bs=8k -size=500G -numjobs=10 -runtime=60 -group_reporting -name=mytest

顺序写
fio -filename=/data/file1.txt -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=8k -size=500G -numjobs=10 -runtime=60 -group_reporting -name=mytest

顺序读
fio -filename=/data/file1.txt -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=8k -size=500G -numjobs=10 -runtime=60 -group_reporting -name=mytest

查看系统日志

journalctl --since "2023-10-01 20:00:00" --until "2023-10-01 20:20:00"

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值