解压缩文件常用命令——linux.
scp
,scp local_file remote_username@remote_ip:remote_folder
scp local_file remote_username@remote_ip:remote_file
scp local_file remote_ip:remote_folder
scp local_file remote_ip:remote_file
scp -r local_folder remote_username@remote_ip:remote_folder
scp -r local_folder remote_ip:remote_folder
例子:scp gitlab-ce-14.10.5-ce.0.el7.x86_64.rpm susu@目标ip地址:/home/susu/soft/softWare
下面用到的通配符先介绍一下
① :*
表示一串任意的字符串
② :?
表示一个任意的字符
-name
按照文件名来查
语法如下:
find 搜索路径 -name "文件名"
例子如下:
find / -name "*.cnf"
find / -name "?.cnf"
find / -name "?y.cnf"
find /etc -name "?y.cnf"
-size 结合 -print ,根据文件大小搜索
语法如下:
find 搜索路径 -size +文件大小 -print
例子如下:
find / -size +800M -print
locate xxx
(搜索含有xxx的文件或文件夹)locate *.cnf
或 locate -r 'cnf$'
(查询以.cnf
结尾的文件)locate -r 'cnf$' | head -n2
(查询以.cnf
结尾的文件,-n2
表示展示前2条)grep 搜索内容 搜索目录
grep root:x:0:0:root:/root:/bin/bash /etc/*
,递归搜索 /etc 下的文件种含有“root:x:0:0:root:/root:/bin/bash
”内容的文件grep 搜索内容 搜索文件
grep Root /etc/passwd
grep -i 搜索内容 搜索文件
(-i
不区分大小写)grep -i Root /etc/passwd
grep -n root /etc/passwd
(-n
显示行号)grep -A 10 root /etc/passwd
(-A 10
上下10行的内容)cat /etc/passwd | grep root
(cat + grep)cat -n /etc/passwd | grep root
(-n 显示行号)ps -ef | grep docker
(查进程)netstat -ano | grep "2181"
(win系统用findstr)netstat -anp | grep "2181"
ps -ef | grep java
ps -fu weblogic
ps -ef | grep weblogic
netstat -anput | grep redis
ps -ef | grep redis
ps -ef | grep mysql
cd /home/weblogic/liu/weblogic/Oracle/Middleware/wlserver_12.1/server/lib
java -cp weblogic.jar weblogic.version
上一篇:小程序开发必备功能的吐血整理【个人中心界面样式大全】
下一篇:9-定时器系统