Basic Linux Commands : “apropos” and “cd”


Each manual page has short description available within it, apropos command will search the command short description with the given keyword. This command is same as man -k option. but the advantage of apropos is using regular expression for searching the commands.

Example

apropos
Each manual page has short description available within it, apropos command will search the command short description with the given keyword. This command is same as man -k option. but the advantage of apropos is using regular expression for searching the commands.
Example

#apropos “print”




apropos Sample Output Page

#apropos -r “^[p]+[g]$”

pg (1)               – browse pagewise through text files

This pattern will match the command description word starting with “p” and ends with “g”. Like this user can create your own pattern for finding commands.
cd  – Change Directory

cd command is used for changing the current directoy to some destination directory which you want to use. First you need to find which directory currently you are using, for that you can use “pwd – present working directory” command.

Examples

anthoniraj@Ubuntu:~$ pwd

/home/anthoniraj

I am using home directory , here anthoniraj is the user of the system. Now i want to change home directory to “/opt”

anthoniraj@Ubuntu:~$ cd /opt/

anthoniraj@Ubuntu:/opt$

You can also use dot (.) for changing directory

anthoniraj@Ubuntu:/opt$ cd ..

anthoniraj@Ubuntu:/$ pwd

/

[/ - root directory]


No comments:

Post a Comment