Contact us

Print

Using ls

The “ls” command stands for list. It lists the contents of a directory.

To use ls


1. Type “ls” in root’s home directory


[root@localhost root]# ls


List the contents of the directory:


2. Change to the folder1 directory

3. List the contents of “folder1” directory. Type “ls”


[root@localhost folder1]# ls

file11 file12


4. Change to the folder2 directory and list its contents here:


5. Change back to your home directory and list “all” the hidden files and folders.


[root@localhost folder2]# cd


[root@localhost root]# ls –a

.. .bash_history .bash_logout .bash_profile .bashrc folder1 folder2 .gtkrc .kde screenrc


6. To obtain a long or detailed list of all the files and folders in your home directory type:


[root@localhost root]# ls –al
total 44
drwx------ 5 root root 4096 May 8 10:15 .
drwxr-xr-x 8 root root 4096 May 8 09:44 ..
-rw------- 1 root root 43 May 8 09:48 .bash_history
-rw-r--r-- 1 root root 24 May 8 09:44 .bash_logout
-rw-r--r-- 1 root root 191 May 8 09:44 .bash_profile
-rw-r--r-- 1 root root 124 May 8 09:44 .bashrc
drwxrwxr-x 2 root root 4096 May 8 10:17 folder1
drwxrwxr-x 2 root root 4096 May 8 10:18 folder2
………………………




Created by: system. Last Modification: Wednesday 26 of November, 2008 19:15:28 EST by wale.

...