linux命令總結

2021-06-05 21:40:29 字數 2653 閱讀 8568

登出:

exit

關機:

shutdown -h  now

重啟:

reboot

幫助:

man ls

man -f ls

info ls

date +%y/%m/%d

更改檔案使用者組

chgrp -r user file/d

更改檔案使用者

chown -r user file/d

更改檔案屬性

chmod -r 777 file/d

當前路徑

pwd建新目錄

mkdir d

刪除空目錄

rmdir d

複製

cp -a 原始檔  目標檔案

刪除

rm -rf 檔案/目錄

移動或者重新命名

mv 原始檔  目標檔案

檢視檔案

cat -n file 

tac file

nl file

more file

less file

head -n 10 file

tail -n 10 file

檢視二進位制檔案

od file

建立檔案

touch file

搜尋命令檔案

which name

搜尋特定檔案

whereis name

locate name

查詢檔案

find -name file

檢視磁碟大小

df -h 

檢視目錄容量

du -h 目錄 

掛載目錄

mount --bind 目錄a 目錄b

解除安裝掛載目錄

umount 目錄b

壓縮和解壓

tar -zcvf  test.tar.gz 目錄

tar -zxvf test.tar.gz

tar -jcvf  test.tar.bz2 目錄

tar -jxvf test.tar.bz2

增加使用者

useradd -u group -m user

修改密碼

passwd user

刪除使用者

userdel user

增加使用者組

groupadd usergroup

刪除使用者組

groupdel usergroup

切換使用者

su user

檢視使用者組

groups

切換有效使用者組

newgrp group

執行系統命令(visudo裡允許情況下)

sudo

使用者登入歷史

last or lastlog

正在登入使用者

w or who

檢查使用者設定檔案資訊

pwck

當前作業放後台暫停

ctrl+z

當前後台作業

jobs -l

後台作業拿到前台

fg %1

後台暫停作業後台執行

bg %1

記憶體正在使用的程序

ps aux

程序樹

pstree -aup

程序cpu/mem等狀態

top

刪除程序

系統記憶體

free -m

網路監控

netstat -tulnp

系統資訊

uname -a

Linux命令總結

vi基本命令 i 在當前游標的的所在位置,插入隨後輸入的文字,游標後的文字相應向右移動 i 在游標所在行的行首插入隨後輸入的文字,行首是該行的第乙個非空白字元,相當於游標移動到行首再執行i命令 a 在當前游標所在位置之後,插入隨後輸入的文字 a 在游標所在行的行尾新增隨後輸入的文字,相當於游標移動到...

linux命令總結

linux檔案編輯器 vi vim 1 vi 的三種命令模式 command 命令 模式,用於輸入命令 insert 插入 模式,用於插入文字 visual 可視 模式,用於視化的的高亮並選定正文 2 檔案的儲存和退出 command 模式是vi或vim的預設模式,如果我們處於其它命令模式時,要通過...

linux命令總結

1。命令格式與目錄處理命令ls 命令格式 ls la etc 顯示目錄檔案 a 顯示所有檔案,包括隱藏檔案 l 詳細資訊顯示 d 檢視目錄屬性 2,目錄處理命令 mkdir 建立新目錄 p 遞迴建立 mkdir p temp japan boduo cd 切換目錄 cd.回到上一級目錄 cd 進入當...