Linux 常用命令

来源:互联网 发布:淘宝的追加评论在哪里 编辑:程序博客网 时间:2024/06/07 00:55

切换账号:

su - oracle

模拟访问网址

curl -l -s https://www.baidu.com

ls -1 logs.xml  列显示文件

tail -f logs.txt  实时查看文件logs.txt

tail -n 100 logs.txt 查看文件logs.txt最后100行

cat logs.txt 查看文件logs.txt

cat logs.txt|grep zhucheng 查看文件logs.txt中有zhucheng的行

tail -n 100 logs.txt|grep error  查看文件logs.txt后一百行中有error的行

ps -ef|grep tomcat  查看tomcat相关进程

env 查看系统环境变量

top 查看系系统进程状态

netstat -tulpn  查看端口占用情况

ip address show  或者 ifconfig 查看网络地址

lsof -i tcp:5887  查看端口占用情况

lsof -p 11111 查看进程号11111打开了哪些文件

find / -name redis.conf  根据文件名查找

du -sh  查看当前目录大小

du -sh log.txt 查看log.txt文件大小

原创粉丝点击