linux 常用命令

------------------------------------clear-------------------------
启动 关闭 tomcat
ls (查看目录文件)
cd apache-tomcat-5.5.17 (打 a 按TAB键) 进入tomcat

cd bin
ls bin

sh shutdown.sh (关闭tomcat)
sh startup.sh (启动tomcat)

ps -ef|grep java (查看进程 kill、 ps -aux|grep java)
查看后台

cd apache-tomcat-5.5.17

cd logs

tail -1000 catalina.out (查看日志)

--------------------------------------------
压缩

tar zcvf newFile.tar.gz dir(目录)
tar zxvf newFile.tar.gz

--------------------------------------------
rm file(删除文件)
rm -r file(删除文件,文件夹非空)

rmdir dirFile(删除目录)
cp file folder/newDir (复制文件)
mv file folder/newDir (移动文件)
mv fileName newFile (重命名)
-------------------------------------------
ps是显示当前状态处于running的进程
grep表示在这些里搜索
ps aux是显示所有进程和其状态

ps -aux|grep tomcat (在所有进程中 查找 tomcat 进程)
kill ..
-------------------------------------------
poweroff(关机) reboot(重启)

install 2.txt 3.txt (复制 文件-备份)

last -i
finger -s
(查看登录历史)


file (查看文件类型-探测文件)
file text.txt --> text.txt ASCI ||
file foleder --> folder:directory

例如,我们想要查找一个文件名是lilo.conf的文件,可以使用如下命令:
find / -name lilo.conf
find命令后的“/”表示搜索整个硬盘。
-------
find path(可省略-当前) 通配符 (搜索)
find jdk/bin -name java*

find path(可省略-当前) -ctime n (搜索在过去n天修改过的文件)
find path(可省略-当前) -atime n (搜索在过去n天读取过的文件)

diff a.txt b.txt (比对两个文件的不同之处)

top (监控系统 - 查看进程 什么的)

ifconfig , ping , netstat
---------------------------------------------------
passwd root (修改用户密码)
new password:......
---------------------------------------------------
touch test.txt
vi test.txt
:wq
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值