windows下登录linux的常用工具SecureCRT和常用命令

SecureCRT是在windows下登录linux的服务器主键的软件

总结下工作中常用的linux命令:

su -admin切换用户
df -hl 查看磁盘剩余空间

tail -f bkxx-service-info.log 查看实时日志

vim bkxx-service-info.log 打开日志文件 ; shift+g 跳转到日志最后一页;

less bkxx-ds.xml  查看配置文件

grep 2015 bkxx-data-sync.log --color  查看包含2015的日志内容

service 服务名 status 查看指定服务的运行状态

ps -aux |grep xxx 查看某个进程或者服务是否存在

chkconfig --list查看出所有当前运行的服务

chkconfig --list| grep on 查询当前处于运行状态的服务

chkconfig --litt| grep off 查询当前处于关闭状态的服务

telnet localhost 1234 链接本地端口为1234的服务

netstat –n 命令来查看开放端口

quit 断开telnet连接

执行shell脚本的方法:

1、切换到shell脚本所在的目录,执行shell脚本

cd /data/shell

./hello.sh或 bash hello.sh 或 sh hello.sh

2、以绝对路径执行bash shell脚本

/data/shell/hello.sh

查看端口是否被占用:

#lsof -i:8080

通过netstat和ps两个命令联合起来看占用端口的程序及进程id

#netstat -apn|grep 8080

通过下面命令查看该程序的路径

#ps -elf|grep impalad

原文地址:https://www.cnblogs.com/s1328/p/4623720.html