Useful Commands/System Management: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 35: | Line 35: | ||
<source lang="bash"> | <source lang="bash"> | ||
free | free | ||
</source> | </source> | ||
|- | |- | ||
| Line 66: | Line 50: | ||
<source lang="bash"> | <source lang="bash"> | ||
sudo locale-gen | sudo locale-gen | ||
</source> | </source> | ||
|- | |- | ||
Revision as of 09:07, 8 March 2019
| 情境 | 指令 |
|---|---|
| List process |
ps -axo pid,command
ps -axo pid,command | awk 'match($2, /^ssh/) { print $0; }'
ps -axo pid,command | awk 'match($2, /^login/) { print $0; }'
ps -axo pid,command | awk 'match($2, /^-?bash/) { print $0; }'
|
| List process tree |
# Mac/BSD
pstree -p 713
pstree $(ps -axo pid,command | awk 'match($2, /^login/) { print $1 }')
# Linux
pstree 713
pstree -p $(ps -acxo pid,command | awk '/sshd/{print $1}' | head -n 1)
pstree -p $(ps -acxo pid,command | awk '/bash/{print $1}' | tail -n 2 | head -n 1)
|
| 顯示CPU資訊 |
cat /proc/cpuinfo
|
| 顯示記憶體資訊 |
cat /proc/meminfo
|
| 釋放記憶體並且顯示記憶體資訊 |
free
|
| 檢查使用中的語系 |
locale
|
| 檢查可使用的語系 |
locale -a
|
| 重建語系定義檔 |
sudo locale-gen
|
| 一分鐘後執行指令 |
echo "ls -l > `tty`" | at now + 1 minute
|