码迷,mamicode.com
首页 > 系统相关 > 详细

Linux常用命令

时间:2019-06-20 12:40:35      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:ber   rpm包   ucid   rpm -e   http   系统版本   用户   emc   内存   

一次性创建多个文件夹:mkdir -p /test/{1,2,3}
 
//注册systemd服务
 
// 列出 systemctl上所有服务
systemctl list-unit-files | grep enabled|grep redis
systemctl | grep running
systemctl list-unit-files | grep enabled|grep redis|awk ‘{print $1}‘|xargs systemctl stop
systemctl list-unit-files | grep enabled|grep redis|awk ‘{print $1}‘|xargs systemctl disable
ps -ef | grep java | grep sharding| grep testcase| grep -v grep | awk ‘{print $2}‘|xargs kill -9
rm -fr /etc/systemd/system/zcloud_redis_*
rm -fr /zcloud
 
 
=============tar====================
tar -zxf 解压

tar -cvf jpg.tar *.jpg //将目录里所有jpg文件打包成jpg.tar 

tar -czf jpg.tar.gz *.jpg   //将目录里所有jpg文件打包成jpg.tar后,并且将其用gzip压缩,生成一个gzip压缩过的包,命名为jpg.tar.gz

 tar -cjf jpg.tar.bz2 *.jpg //将目录里所有jpg文件打包成jpg.tar后,并且将其用bzip2压缩,生成一个bzip2压缩过的包,命名为jpg.tar.bz

 

=========检查端口是否被占用=======

netstat -an|grep 8082|grep -i listen

 ss -tulpn|grep LISTEN|grep 8082

 

 

==========查看linux系统版本=======

cat /etc/os-release

lsb_release -a

hostnamectl

================检查端口是否使用================

netstat -an|grep 6379|grep -i listen

===========递归修改文件权限===============

 chmod -R  755 test

 

==========虚拟机不能用ssh访问解决方案==============

https://yq.aliyun.com/articles/103191 

 

===========查看目录的挂载点==============

df /var/lib/

 

=========关闭liux防火墙===========

systemctl status firewalld.service systemctl stop firewalld.service

 

==========RPM=====================

====安装rpm

rpm -ivh <package name>

====删除install的rpm包

rpm -qa | grep -i <keyword>

rpm -e <package name>

=============查看系统位数==========

uname -m

arch

===========SCP===================

scp -r /paasdata/o_1d92gnr8kgubab3102e6ohp1g8/python_redis_cluster_deploy.tar.gz root@192.168.20.100:/zcloud_team/zCloud-1.0.5.0-20190516/RedisV1.0.5.0/installPackage/python

 

==========查看用户==============

cat /etc/passwd|grep sharding|grep testcase|awk -F: ‘{print $1 > "delusers.txt"}‘

==删除用户

cat /etc/passwd|grep sharding|grep testcase|awk -F: ‘{print $1}‘|xargs -i userdel -fr {}

 

 

====查看文件夹占用的内存

du -h -x --max-depth=1

 

 

 

 

 

 

 

 

 

 

 

 

Linux常用命令

标签:ber   rpm包   ucid   rpm -e   http   系统版本   用户   emc   内存   

原文地址:https://www.cnblogs.com/guoAIrong/p/11057848.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!