When you start up a terminal session, you are placed within your home directory (denoted by a
~). To list contents of your current working directory, simply use the
ls command (short for list).
file1.txt file2.txt file3.txt file4.txt
Here, we can see that four text files reside in our current working directory.
Additionally, you can list files within other directories by specifying the pathname after the
$ ls ~/Dropbox
Books Library Movies School Work
Hidden files are usually those that have to do with the configuration of certain programs. They are kept hidden from the user, and have a . preceding its name.
For example, the .bash_profile file, located in your home directory, is run every time you start a new terminal to configure your environment. Furthermore the .vimrc file configures your Vim settings. However, you can't see these files with a normal
ls command. To list the hidden files use the option
$ ls -a
. Applications Library .. Desktop Movies .bash_history Documents Music .bash_profile Downloads Public .vimrc Dropbox
Can you see your secret files now?
To see more details of the files, we can pass the
You should see a list of files with the following format (don't worry if your date format isn't exactly the same):
$ ls -l
total 12 drwx------ 6 JohnDoe staff 204 Jan 7 10:30 Applications drwx------+ 37 JohnDoe staff 1258 Mar 20 17:58 Desktop drwx------+ 6 JohnDoe staff 204 Mar 13 08:57 Documents drwx------+ 29 JohnDoe staff 986 Mar 22 00:06 Downloads drwx---rwx@ 25 JohnDoe staff 850 Mar 20 15:38 Dropbox drwx------@ 51 JohnDoe staff 1734 Mar 17 17:42 Library drwx------+ 3 JohnDoe staff 102 Dec 29 00:00 Movies drwx------+ 3 JohnDoe staff 102 Dec 29 00:00 Music drwxr-xr-x 4 JohnDoe staff 136 Mar 13 11:15 NetBeansProjects drwx------+ 4 JohnDoe staff 136 Dec 29 20:39 Pictures drwxr-xr-x+ 5 JohnDoe staff 170 Dec 29 00:00 Public drwx------ 4 JohnDoe staff 136 Mar 20 11:31 VirtualBox VMs
Let's break this down per attribute.
There are other options you can use, but
-a are the most common.
To combine options, simply places the two together:
$ ls -la
In this completely revised second edition of the perennial best seller How Linux Works, author Brian Ward makes the concepts behind Linux internals accessible to anyone curious about the inner workings of the operating system. Inside, you'll find the kind of knowledge that normally comes from years of experience doing things the hard way.$ Check price
Relieve your stress, back, neck and sciatic pain through 1,782 acupuncture points for immediate neck pain relief. Made for lower, upper and mid chronic back pain treatment, and improves circulation, sleep, digestion and quality of life.$$ Check price