Nov 27, 2007

Linux Shell Commands (Tutorial):

Print Working Directory (pwd):

pwd command is used to print working directory means it will display the current directory name where you are working. Type the pwd command press Enter Key to do so.

pwd

Displaying List of files and subdirectories:

ls command is used to display list of files and subdirectory in the current directory. It is just like DIR command of DOS (Disk Operating System). Like DOS, this command also has options. Options are always used with – followed by option name. Type the following command at Linux shell prompt and press Enter Key.

ls

Above Linux command will display list of files and subdirectories in current directory.

ls –l

Above Linux command will display detailed list of file and subdirectories of current working directory. Details list of files and directories includes file permissions, file owner, file size, file modification time then at the last filename or directory name.

ls –a

Above Linux command will display list of file and directories including hidden files.

What should I do when option of commands do not work: There may be following reasons.

1. You may be mistakenly put a space between – sign and option name. There must not be any space between – sign and option name.

2. There must be a space between command (ls) and – sign.

ls directory name

Above Linux command ls is followed by a directory name will display the content of the mentioned directory.

Wild Cards: Same as in DOS, wild cards are also used in Linux OS. There are two wild cards * and ?. * Means any number of characters and ? Means single character.

ls –l pro*

Above command will display all those files, which name start from pro. For example product, promote etc.

ls –l pro?

Above command will display all those file, which name start from pro and fourth character is something else. For example prod, proc etc.

No comments:

Post a Comment

Infolinks In Text Ads

Total Pageviews

Powered by Blogger.

Dont Forget To Follow Us