linux 常用命令

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、防火墙

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值