Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jun 102010
 

List 10 most often used commands

Answer:

You can list the top 10 most often used commands in your Linux, by the following method.

# history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head 

135 ls
63 cd
48 exit
46 sudo
34 tail
30 cat
29 df
18 date
17 vi
12 pwd
May 082010
 

Move a long running job to background

Answer:

Assume you have a job running for a very long time, and you might want it to run in background, even you have logged out from the SSH session.

1. Suspend it

# [Ctrl-Z]

2. Make it run in background

# bg && disown

You can now safely logout from the SSH session.