Saturday, March 28, 2015

MAN Command in ubuntu explained

"""
man command revisited

man ls 

it displays huge output...
You need to hit enter to move down...but it does move only 1 line...
you use space,it displays page by page rather line by line.
use g to goto top of the page
use [shift+g] to move to down of the page.
q to quit

Environmental Variables == Storage location that has name and value.


==>Mostly uppercase names


PATH is one of the environmental variables.

echo $PATH (we have to use $ sign before the variable)

Output

cam@hack3r:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/cam/bin:/usr/local/java/jdk1.8.0_40/bin


This will not be same for you;

they are different paths separated by ':'

Long back I've installed oracle java jdk and added to environmental variables.It's showing the path of jdk.

Question:
Why are there so many paths??

If you type a command then it is first searched in all the paths starting from /usr/local/sbin (this is for my laptop).
If the command typed by you is not in the path then it will display command not found.

which command 

You might want to know in "which" path does ls reside.you can find that by using wich command

which ls

cam@hack3r:~$ which ls
/bin/ls
cam@hack3r:~$ which man
/usr/bin/man

Note: Which doesn't work for builtins;so don't try it on cd












"""







Learn python for fun.The popular blog with questions and answers to the python.Solutions to facebookhackercup,codejam,codechef.The fun way to learn python with me.Building some cool apps.

No comments:

Post a Comment