|
|
|
|
|
|
|
|
Listing Files and Directories
|
|
To see is believing, indeed. You can display names of files
and subdirectories in current directory with
"ls" (list)
command (e.g., "ls -al"). "ls" is equivalent of the
DOS command "dir" if you're familiar with DOS.
Files with a period as the first letter of the file name
are hidden files (compare the difference between an "ls"
and an "ls -a"). Hidden files (called "dot files") typically
contain important system/user setting or configuration data,
and the idea of making them 'hidden' from normal ls command is
based on "Out of sight, Out of mind" approach - to make them
safer from accidental tempering.
Here are some useful flags to the ls command:
-
Flags |
It will |
a |
show hidden files |
l |
show long listing |
C |
show short listing (in columns) |
t |
list in order of time (creation) |
r |
list in reverse order |
R |
list recursively |
These flags can be combined as needed. Here are some useful
combinations, please examine them and get familiarize yourself with
their characteristics.
-
ls -al |
ls -l |
ls -C |
ls -lt |
ls -lrt |
ls -lR |
There is a system command alias for "ls -Flas | more"
called "ll" and you can just type "ll" to get a full
information of a directory. I'd recommend you to make
a habit to list directory and files as often as possible.
|
|
|