Linux命令及SHELL命令 面試點

2021-10-05 04:04:09 字數 688 閱讀 3698

面試必問的

linux命令:

檢視記憶體: top

檢視磁碟: df -h

檢視磁碟io讀寫: iotop

檢視比較高的磁碟io讀寫程式: iotop

埠占用: netstat -tunpl | grep 埠號

檢視程序: ps -ef | grep ***.sh

shell命令:

awk是行處理器,將內容列印輸出到螢幕

awk awk -f":" 『』 /etc/passwd

sed行資料處理

sed 『1,2d』 test.xx

cutcut接受三個定位方法:1)byte: -b2)characters: -c3)fields: -d

提取第3,4,5,9的位元組: cut -b 3-5,9

使用-b,-b後面所有的定位進行從小到大排序,然後再提取,不 能顛倒順序。

遇到多位元組字元時,使用-n選項,不會將多位元組字元拆開。cut -nb 1,2,3

cut -d : -f 1 -d設定間隔符為:,-f 1 為提取第乙個域。

sort排序 預設公升序 -r 降序

cat test_sort.txt |sort -r

linux命令 常用shell命令及應用

man command linux下更好用的幫助命令 cheat pip install cheat cheat tar linux下更好用的幫助命令 cheat ubuntu終端視窗中,複製貼上的快捷鍵需要加上 shift 複製 ctrl shift c 貼上 ctrl shift v comma...

Linux 命令及shell程式設計備忘

如果桌面不能顯示資料夾,需要顯示介面化的資料夾,命令nautilus linux shell 日期變數 date string date y m d date後面一定要有空格,而且 號後面一定不能有空格,昨天 date d last day y m d 明天 date d next day y m ...

linux 命令及shell基礎雜記

1 不管是linux命令列,還是windows的dos,執行乙個命令,就會去path環境變數中找是否有這個變數。pwd print working directory fdisk 檢視系統disk ctrl l 清屏 ctrl u 刪除到行首 ctrl a 游標到行首 ctrl e 游標到行位 ct...