1. 程式人生 > >記錄一下日常工作中常用的一些linux指令

記錄一下日常工作中常用的一些linux指令

1、檢視磁碟總容量:df -h

     檢視當前目錄下的磁碟容量:du -sh

2、顯示當前目錄下前n個檔案:ls -1 | sort -u | head -10

      檢視檔案前或後n行:head/tail -n 10 filename

3、screen的用法:

     (1)建立screen:screen -S name          (2)檢視:screen -ls             (3)恢復:screen -r name

     (4)關閉:①在當前screen中輸出指令quit/exit;②強制關閉:screen -X -S name quit

4、將檔案轉換成可執行檔案:chmod u+x filename

5、檢視txt行數:wc -l filename/wc filename

6、檢視檔案修改時間:stat filename

7、將游標移到行首:ctrl+a,移到行尾:ctrl+e,ctrl+←/→為跳段移動

8、vim模式移動到行尾:shift+g

9、檢視所有檔案(包括隱藏檔案):ls -al

10、檢視某個GPU使用者:ps -aux|grep PID