1、bin 目录下启动
./startup.sh && tail -f ../logs/catalina.out
!tail 查看日志
2、进程
ps -ef | grep tomcat
ps -ef | grep java
ps -ef | grep /home/iess
3、解压缩
tar --help
我们经常使用的tar压缩命令为 tar -zcvf 压缩名.tar.gz 文件/目录 文件/文件夹
对于解压缩正好与压缩相反,命令变化很小 tar -zxvf 压缩包名
4、两台服务传输文件
scp P.tar.gz root@172.0.0.1:/home
ssh: Could not resolve hostname root: Temporary failure in name resolution
lost connection
5、查看cpu几个
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
查看系统版本:
cat /etc/issue
6、循环Linux脚本
#!/bin/sh
while : ;do
系统资源:top -b -c i -n 1 -d 3
sleep 60
done
./top.sh>>A1.txt 2>&1& 重定向日志可以删除
7、find命令:
在data目录下搜:find . -name "004" 搜索文件
8、cp命令
cp -R file file1 复制为file1
cp file file1 file2 dir
9、清除日志命令
清除文件内容
true>log.txt
10、mv移动命令
mv file file1 file2 dir 移动到dir文件夹
mv file file2 重命名为file2
11、chmod 命令
chmod -R 777 file
r:2
w:4
x:1
12、创建普通用户
useradd yonghu
passwd yonghu
更改用户 zhugan 的密码 。
新的 密码:123456
重新输入新的 密码:123456
添加用户成功
13、重启服务
shutdown -r now
14、防火墙
<