Unix Useful Shell Commands

Killing Tasks

sudo killall <taskname>

Running Tor

/etc/init.d/tor start

Running Apache2

/etc/init.d/apache2 [restart|start|stop]

Reloading profile – how to reload Unix profile

Use the following command to reload a unix profile (/etc/profile, ~/.profile, ~/.bash_profile …):

$ . ~/.profile
$ . /etc/profile

Notice: . (dot) is a command that originates from source command. On some unix flavours (FreeBSD 6 for example) source command works still:

$ source ~/.profile
$ source /etc/profile

.profile settings overwrite those in /etc/profile. You can also use .bash_profile in your home directory to customize your bash shell’s profile.

Basically, if you need to load shell variables from any file just run the . (dot) command, followed by space and (the absolute path is necessary) the path to the file. (Be carefull what file you’re loading variables from because you meight overwrite some important environment variables and your system could become unstable).


Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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