Programming in UNIX Environment : Commands – kill, ps, nohup, nice

The ampersand at the end of the command says that run this command and also take another from the terminal without stopping the first. It prints the process id. For stopping a process we use ‘kill’ command followed by process id. ‘ps’ command prints what that user running. Using ‘nohup’, the command will run even if the user logged out. ‘nice’ is for using another system to run our job.

$wc a* >wc.out &

$kill 6578


$ps -ag // all process that are currently running.

$nohup command & // No hangup for this command even if user logged out.

$nice expensive-command & // if your command take a lot of processor resources.

The ‘at’ command followed by time is to run our job at whatever time we want.

$ at 2340 <file

There is a file ‘.profile’ in the user’s login directory, this file contains commands which the user want to run when the user logged in. A user can set things in it.


$cd $a

We can put ‘a’ as given above in our profile. So we can refer that directory by the value of shell variable.

Author: Abhilash

Hey! My name is Abhilash - A Ruby developer for years, specialised on web programming, working as a freelancer. Mainly working on Ruby On Rails platform since 2010. This blog is about Ruby, Ruby On Rails and other subjects that I work. You can contact me here: Abhilash AK

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s