Linux 常用命令

发布时间 2023-03-24 14:12:51作者: mysuper

1,查询文件大小:  du -h --max-depth=1

2,解压.tar.gz 格式:  tar -zxvf 压缩文件名.tar.gz

3,删除文件夹:  rm -rf 文件夹名称

4,拷贝文件:   pscp linaro@192.168.0.20:/home/linaro/test/Server/nlogs/application-2020-04-10.log g:/

5,后台启动程序 : nohup ./NbSites.Web 1>/dev/null 2>&1 &

6,查询进程:ps -ef|grep  ./NbSites.Web

7,查看端口进程:lsof -i:端口号

8,显示隐藏文件: ls -a

9,增加执行文件权限:  chmod u+x 文件名称

10,列出所有时区: timedatectl list-timezones  

11,设置系统时区为上海  timedatectl set-timezone Asia/Shanghai 

12,当前时区:vim /etc/timezone

13,重启:  reboot

14,查询存储:  df -h

15,查询linux版本:  cat /etc/issue

16,1,通过端口号查询进程号 netstat -nlp | grep 端口号        2,通过进程号查询程序路径 ll /proc/进程号/cwd