Cut some rows
cut -d " " -f2-4 messages
with tee we drop shit in a file and in stdout
grep kernel /var/log/messages | tee /root/my.log
with xargs we give in this expample the command host the output line by line:
cut -d " " -f1 localhost_access_log.2014-11-19.txt | sort | uniq | xargs -n1 host
ps -C tail
ps and show all processes of the program tail
pstree -pna
-p = show PID
-n = sort by PID
-a = shows options and arguments
top -bi -d 1 > file.txt
-b = batch mode to put it in a file
-i = show only the active ones
-d 1 = every 1 sec
Like that the file.txt has every second the active processes in top
kill -l shows you all available signals you can send to the process
1) SIGHUP: Hang-up-signal, for daemons to reload their config
9) SIGKILL: to kill the process
15) SIGTERM: to terminate the process
other
2) SIGINT: like Ctrl+C, but much more fun
18) SIGCONT: continue processes which are put in the background with bg and fg (or with 19)
19) SIGSTOP: bg, but also much more fun
20) SIGSTP: like ctrl+z.
with w we see the logged in users