Using the ls command

Written by Adam

I created a brief video providing an introduction and overview of using the ls command with Terminal.

StumbleUpon Toolbar Stumble It! | reddit Submit to reddit | Digg Digg it! | Add to Mixx! Mixx it! | Slashdot Slashdot It!
Facebook Facebook | del.icio.us Save to Del.icio.us | Technorati Technorati Favorite It! | E-mail E-mail this!

One Response to “Using the ls command”

  1. Brandon Says:

    One essential option you didn’t discuss is -d. In your example, what if you want to look at the owner or permissions for directory1? You would type ls -l and look in the long list. This does not work very well if your directory contains many items. If you had directory1 through directory1000 and wanted to see who owns directory500 you might first type “ls -l directory500″ hoping to see that information. But all you will see is a long listing of the contents of directory500, not the owner, permissions, etc of the directory itself. Typing ls -ld directory500 will prevent ls from recursing into the directory and will print information about the directory itself. This also applies to symbolic links. If you want to see information about a link and where it points rather than seeing information about the object the link points to, you can use -d.

    This comes up often when inspecting links or on a multiuser system when you want to check the permissions of someone’s home directory.

Leave a Reply