Examples of Commonly Used Utilities
Directory listings: ls
When doing a long listing of a directory or file and looking at the date,
you typically only want to see the date when the
contents of the file was last changed. This is the default behavior with the
there may be cases, where you want to see when other aspects of the file were changed,
such as the permissions. This is done adding the
Typically, when you do a simple ls of a directory, the only piece of information
you get is the filename.
However, you could use the
Data/ letter.txt script* script2@
Here you can see that at the end of many of the files are a number of different
symbols. The / (forward slash) indicates it is a directory, the @ says it is a symbolic link, and * (asterisk) says it is executable.
For many years, this is the extent of what you could do (that is, differentiate file types by
which symbol was displayed). However, with newer systems there is a lot more that you can do.
If your terminal can display colors, it is
possible to color-code the output of ls.
Newer versions of ls have the option
By default, a number of different file types and their associated colors are specified in the
/etc/DIR_COLORS file. For example, dark red is used for executable files, light red is used
for archives (tar, rpm), dark blue is for directories, magenta is for image files and so forth.
If you have a symbolic link that points nowhere (i.e the target file does not exist) the name
will blink red. If you want to change the system defaults, copy /etc/DIR_COLORS to .dir_colors in your home directory.
Some linux distributions, the ls command is by default an alias and defined like this:
alias ls='/bin/ls $LS_OPTIONS'