[版权声明] 本站内容采用 知识共享署名-非商业性使用-相同方式共享 3.0 中国大陆 (CC BY-NC-SA 3.0 CN) 进行许可。
部分内容和资源来自网络,纯学习研究使用。如有侵犯您的权益,请及时联系我,我将尽快处理。
如转载请注明来自: Broly的博客,本文链接: CentOS常用命令收集
收集一些常用的命令备用
查看版本
1 2 |
[root@Broly-PC ~]# cat /etc/redhat-release CentOS release 6.6 (Final) |
查看RPM包
1 2 |
[root@localhost home]# rpm -q gitlab gitlab-7.8.1_omnibus-1.el6.x86_64 |
1 |
[root@localhost home]# rpm -qa |grep gitlab |
由上面查到包名,然后删除RPM包(加 --nodeps 可忽略依赖)
1 |
[root@localhost home]# rpm -e gitlab-xxx-xxx |
压缩解压
不压缩打包
1 |
[root@localhost home]# tar -cvf etc.tar /etc |
以 gzip 压缩打包
1 |
[root@localhost home]# tar -zcvf etc.tar.gz /etc |
以 bzip2 压缩打包
1 |
[root@localhost home]# tar -jcvf etc.tar.bz2 /etc |
递归更改权限
更改目录下所有文件夹权限为755,所有文件权限为644
1 2 |
find directory-name -type d -exec chmod 755 {} \; find directory-name -type f -exec chmod 644 {} \; |
运行Jar包
1 |
nohup java -jar dmlk.jar > logs/dmlk.log 2>&1 & |