加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

简单linux查询

发布时间:2020-12-14 01:34:55 所属栏目:Linux 来源:网络整理
导读:1查看日志异常 tailf nohup.out|grep ERROR -A 3 --color ? tailf nohup.out|grep ERROR|grep chunk -A 3 -B 3 --color ? nohup ./curl_14.sh 50 10000 200 100 ? ? 2查看历史操作 vi ~/.bash_history vi ~/.history ? ? ? 3常用命令 ps -ef|grep tomcat ? n
1查看日志异常
tailf nohup.out|grep ERROR -A 3 --color
?
tailf nohup.out|grep ERROR|grep chunk -A 3 -B 3 --color
?
nohup ./curl_14.sh 50 10000 200 100 &
?
?
2查看历史操作
vi ~/.bash_history
vi ~/.history
?
?
?
3常用命令
ps -ef|grep tomcat
?
nohup ./start.sh &
?
ps -ef|grep curl
?
pkill??-f curl
?
mkdir consumer_12
cp curl_12 consumer_12
?
?
4查看异常数量
grep??"connection timed out" -B 1 ./nohup.out| grep "ConsumerController" |wc -l
?
5定时任务
定时任务shell
crontab -e编辑
crontab -l查看
?
server crond status查看cron服务状态
service crond start启动
?
?
分页打印
cat -n test.log |grep "debug" |more
查看保存到新文件
cat -n test.log |grep "debug"??>debug.txt
?
?
c统计
n行号
grep与find命令的区别:grep搜索的是文本,find搜索的是文件,换句话说就是grep是查找匹配条件的行,find是搜索匹配条件的文件。
?
?
拷贝文件内容到新的目录下的产生一个文件
cat nohup.out > ../curllognodelete/nohup12_
?
6 解压命令
1、*.tar 用 tar –xvf 解压
2、*.gz 用 gzip -d或者gunzip 解压
3、*.tar.gz和*.tgz 用 tar –xzf 解压
4、*.bz2 用 bzip2 -d或者用bunzip2 解压
5、*.tar.bz2用tar –xjf 解压
6、*.Z 用 uncompress 解压
7、*.tar.Z 用tar –xZf 解压
8、*.rar 用 unrar e解压
9、*.zip 用 unzip 解压
压缩文件夹
tar -zcvf /home/xahot.tar.gz /xahot
tar -zcvf 打包后生成的文件名全路径 要打包的目录
子:把/xahot文件夹打包后生成一个/home/xahot.tar.gz的文件。
?
7显示行号
?
输入命令:
????set nu
或者
????set number
取消显示行号
命令:
????set nonu
或者
????set nonumber
8
chown:更改文件属主,也可以同时更改文件属组
chmod:更改文件9个属性

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读