【Linux常用命令】
查看本机信息
查看Linux版本,区分centos还是ubuntu
radhat或centos存在: /etc/redhat-release 这个文件【 命令 cat /etc/redhat-release 】
ubuntu存在 : /etc/lsb-release 这个文件 【命令 cat etc/lsb-release 】
cat /etc/redhat-release && cat /etc/lsb-release
``
查看网路
#查看所有监听端口
netstat -tpln
#根据端口号查询进程ID
netstat -apn | grep 8088
#根据进程号查询目录
lsof -p 1205 或 ll /proc/1205
查杀进程
ps -aux | grep ftp
pkill - 9 java
内存的使用情况
cat /proc/meminfo
查看进程的内存占用
pidstat -r -p 24427 1 5
CPU占用最多的前10个进程
ps auxw|head -1;ps auxw|sort -rn -k3|head -10
内存占用高的前20
ps aux | head -1;ps aux |grep -v PID |sort -rn -k +4 | head -20
查看操作文件
#创建多级目录
mkdir -p /etc/docker
#创建文件
touch yyTest.ini
vi test.txt
vim touch.txt
#移动文件
mv -i /tmp/frpc.ini /home/app/frp
#查找目录下文件
find / -name '*aria*'
find / -name '*aria2.conf*'
*远程复制
直接在服务器A 上通过scp 命令 传到B上。
scp local_file root@172.25.25.115:/home/www/
或者 scp local_file remote_username@remote_ip:remote_file
或者 scp local_file 172.25.25.115:remote_folder
或者 scp local_file 172.25.25.115:remote_file
本地目录 复制到 远程,需要加参数-r
命令为:
scp -r /home/www/java/ root@172.25.25.115:/home/www/
远程目录 复制到 本地
scp -r root@172.25.25.114:/home/www/ /home/www/
Http请求
wget --ftp-user=csj101414323 --ftp-password=csj708253 009.3vftp.com/1.txt
post方法请求
curl -d "param1=value1&m2=value2" "http://xxxx.xxx"

浙公网安备 33010602011771号