Now that you know how to move from a working directory to another or to move around the filesystem of your Ubuntu Linux by using cd command. Today, we are going to learn how to list information about files and directories. To do this, we will learn a new command named ls which stands for list.

ls

This is the basic "ls" command, with no options. It provides a very basic listing of the files in your current working directory. Filenames beginning with a decimal are considered hidden files, and they are not shown.

ls -a

The -a option tells the ls command to report information about all files, including hidden files.

ls -l

The -l option tells the ls command to provide a long listing of information about the files and directories it reports. The long listing will provide important information about file permissions, user and group ownership, file size, and creation date.

ls -al

This command provides a long listing of information about all files in the current directory. It combines the functionality of the -a and -l options. This is probably the most used version of the ls command.

ls -al /usr

This command lists long information about all files in the /usr directory.

ls -ld /usr

Rather than list the files contained in the /usr directory, this command lists information about the /usr directory itself (without generating a listing of the contents of /usr). This is very useful when you want to check the permissions of the directory, and not the files the directory contains.

1 comments

  1. Oleg // 11/10/08, 7:20 PM  

    "ls -l

    The -l option ...... and creation date."

    Not creation date, MODIFICATION date, guys.