Tips for using the ls command to list files in Cygwin or Linux

Classify

ls –classify or ls -F will append characters to files to show their type:

* / directory
* * executable

Code: ls -F
directory/ me.jpeg script.sh*

ls –color=tty

Will color the ‘ls’ output. Directories are blue, regular files stay black (or white) and executable files are green.

Make an Alias of your prefered method.

Example:

alias ls=’ls –color=tty –classify’

List only directories

ls -d */

Will list only dentries ended by a “/”, and with the “-d” option, will not descend into the next level of directory.

Be Sociable, Share!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>