- 解压
基本语法:
tar -zxvf 文件名.tar.gz
参数说明:
-z: 使用 gzip 解压缩
-x: 解压
-v: 显示解压过程(verbose)
-f: 指定文件名
例子:
# 解压到当前目录
tar -zxvf example.tar.gz
# 解压到指定目录
tar -zxvf example.tar.gz -C /path/to/directory
其他常用选项:
-C: 指定解压到的目录
-t: 只查看压缩包内容,不解压
如果你只想查看压缩包里面有什么文件,可以使用:
tar -tvf example.tar.gz
- 查看进程
语法 :ps -ef|grep /xxx/xxxx (需要查看进程的目录)/ ps -ef|grep java (查看java的进程)
- 变更文件名称
mv xxx/xxxx/file1.txt xxx/xxxx/file2.txt
file1 为修改前
file2 为修改后
- 关闭进程
kill -9 xxxx (进程id)
注意:该操作要提前使用ps -ef|grep 来确定进程id
- 实时查看文件,一般用于查看tomcat的输出文件
tail -f xxxx (文件名称)
- 切换Linux用户
su root
- 切换账户后切回上一个账户
exit
- 变更文件的owner
chowner -r xxxxx

196

被折叠的 条评论
为什么被折叠?



