Useful Commands/System Management: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 12: | Line 12: | ||
| List process tree || | | List process tree || | ||
<source lang="bash"> | <source lang="bash"> | ||
pstree 713 | |||
pstree | |||
pstree $(ps -axo pid,command | awk 'match($2, /^login/) { print $1 }') | pstree $(ps -axo pid,command | awk 'match($2, /^login/) { print $1 }') | ||
</source> | </source> | ||
|- | |- | ||
Revision as of 09:19, 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 |
pstree 713
pstree $(ps -axo pid,command | awk 'match($2, /^login/) { print $1 }')
|
| CPU & Memory |
# Linux
cat /proc/cpuinfo
cat /proc/meminfo
free
|
| Locale |
locale # current locale
locale -a # available locales
sudo locale-gen # rebuild locales
|
| Run a command one minute later |
echo "ls -l > `tty`" | at now + 1 minute
|