GOOGLE Search

Google
 

Tuesday, March 18, 2008

Linux Tip No. 26: Checking Directories

To find out what your current directory is, type the pwd command:

$ pwd
/usr/bin

To find out the name of your home directory, type the echo command, followed by the $HOME variable:

$ echo $HOME
/home/jepoy

To change your directory, use the cd command. You could also use the tilde (~) character to indicate the home directory. So cd ~ would have the same resultas just cd.

$ cd /var/log
$ pwd
/var/log


To check if its a directory, use the ls -la command. "d" means its a directory.
[jepoy@mail ~]$ ls -al
total 33048
drwx------ 7 jepoy jepoy 4096 Mar 15 12:12 .
drwxr-xr-x 85 root root 4096 Jan 28 13:35 ..
-rw-r--r-- 1 jepoy jepoy 304 Jul 27 2007 .bash_logout
-rw-r--r-- 1 jepoy jepoy 191 Jul 27 2007 .bash_profile
-rw-r--r-- 1 jepoy jepoy 124 Jul 27 2007 .bashrc
drwxr-xr-x 3 jepoy jepoy 4096 Aug 29 2007
dr-x------ 2 jepoy jepoy 4096 Mar 14 15:50 download_only
drwxr-xr-x 2 jepoy jepoy 4096 Aug 16 2007 DVBH
drwxr-xr-x 2 jepoy jepoy 4096 Aug 16 2007 Dynamips

No comments: