Archive for the Category General

 
 

Top: Display running information of processes

$ top

While running top, type ‘h’ for a help-overview. Other useful keys:

  • u [user name] - display only processes belonging to a specific user. Leave blank to see all users.
  • k [process id] - Kill the process with process_id

Kill: Stopping, Continuing and Killing processes

To kill a process

$ kill -KILL process_id
$ kill -9 process_id

To stop a process

$ kill -STOP process_id

To resume a stopped process

$ kill -CONT process_id

uname: display OS information

Usage:
uname [-amnrsv]
  • -a : All information specified with the -m, -n, -r, -s, and -v options.
  • -m : Type of hardware
  • -n : Name of the node
  • -r : OS release number
  • -s : Name of the implementation of the OS
  • -v : OS version.

Find a string in files

To search a directory recursively for a string, use:

1
find . -exec grep "string to find" '{}' \; -print