加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

Linux常用命令

发布时间:2020-12-13 23:47:32 所属栏目:Linux 来源:网络整理
导读:一次性创建多个文件夹:mkdir -p /test/{1,2,3} ? //注册systemd服务 https://gist.github.com/mkocikowski/aeca878d58d313e902bb ? ? // 列出?systemctl上所有服务 systemctl list-unit-files | grep enabled|grep redis systemctl | grep running systemct
一次性创建多个文件夹:mkdir -p /test/{1,2,3}
?
//注册systemd服务
https://gist.github.com/mkocikowski/aeca878d58d313e902bb ?
?
// 列出?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
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 [email?protected]:/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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读