Getting Help in Shell

by

hello everyone

in the last post, my friend “3abed” talked about Shell and its Advantages, Commands architecture and he also wrote some commands to let you know how to write commands

in this post … we’ll talk about “Getting Help” in shell

but before we start talking about getting help … let me talk about an indispensable command!!!

cd:

this command is used to Change Direcotry and it’s used as follows:

#cd /etc/

ok i want to Change Directory from /etc/ to /etc/sysconfig/

there’re two ways to write the path:

Relative Path:

The path in relation to the current working directory, and it’s used as follows:

#cd sysconfig/

Absolute Path:

The path that you can enter from any directory

#cd /etc/sysconfig/


note:there’s a way of referring to the Parent Directory or the Current Directory

the current directory is reffered to as “.”

the parent directory is referred to as “..”

so we can go to /etc/sysconfig/ from /etc/ by typing:

#cd sysconfig/

or

#cd ./sysconfig/

and we can go back to /etc/ by typing:

#cd ../

and this equals “UP” in any directories browser

if we want to go “back” type:

#cd –

now we can talk about getting Help:

1)man pages:

“man pages” is short to “manual pages

manual pages are documentation for all Unix and Unix-like operating systems

usage:

you can see the documentation of any command in linux by simply write this:

#man <command>

so if you want to see the “ls” command documentation, you’ll have to write:

#man ls

you’ll find a very good and understandable documentation about the “ls” command

in the “See Also” section, you may find “<command> (2)” ( ex: mkdir (2) )

suppose you want to see the “mkdir” documentation, you’ll find in the “See Also” section a different page for the same command “mkdir (2)”, so you can simply see this page by typing

#man 2 mkdir

notes:

  • you can search the man page using “/<search word>” (ex: /any)
  • you can go down to the next search keyword by using “n” button, and go up using “Shift+n”
  • you can exit man pages using “q” button

2)info pages:

usage:

#info ls

unlike the “man pages”, “info pages” presents the Documentation as a tree

so you can move to tree branches simply, so when you goto info page, you can use the following shortcuts:

  • “n” –> goto the next page
  • “p” –> goto the previous page
  • “u” –> goto the upper page
  • “l” –> goto the lower page

3)help option

#ls –help

“help” option shows a fast documentation about commands and its options

it really helps when you’re looking for an option usage

usage:

#ls –help

4)online help:

and this is the most powerful type of “Getting Help” as it contains a very large number of problems and their solutions

you can get help using many sites, ex:

GNU , TLDP and also you can use search engines like “google” and “yahoo”

they’re really useful

5)whatis command:

“whatis” command searches its DataBase that contains short descriptions of system commands

usage:

#whatis ls

——————————————————————————————-

hope this information was useful

any Questions?? post a comment!

thanQ

bye

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s


%d bloggers like this: