Command Line - Files and Directories

Where are my files?

Now that we are able to navigate on the command line the next question is: how do I find out what files are in my directory? To view the content of a directory use the command ll (short for long list, i.e., a long version of the default command ls = list) which shows one line per file, program or directory in the specified location:

course_user> ll
d rwxr-xr-x  2  course_user  staff   68  17  Jul  10:32  Files
d rwxr-xr-x  2  course_user  staff   68   2  Oct   2020  Workshops
d rwxr-xr-x  2  course_user  staff   68  22  Feb  14:02  meeting_notest
- rw-r--r--  1  course_user  staff  152  17  Jul  10:32  sequences.fasta
- rw-r--r--  1  course_user  staff 1551  17  Jul  10:32  to-do.txt

Wow, ok, we can see that there are a lot of things in there. Let’s take a closer look: first of all we see that the output of ll consists of ten columns:

1     2      3   4      5     6   7    8     9     10
d rwxr-xr-x  2  course_user  staff   68  17  Jul  10:32  Files
d rwxr-xr-x  2  course_user  staff   68   2  Oct   2020  Workshops
d rwxr-xr-x  2  course_user  staff   68  22  Feb  14:02  meeting_notest
- rw-r--r--  1  course_user  staff  152  17  Jul  10:32  sequences.fasta
- rw-r--r--  1  course_user  staff 1551  17  Jul  10:32  to-do.txt
Explanation of ll output
  1. Type, d = directory, - = file
  2. Access rights,ie., who is allowed to read (r), write (w) or execute the file/directory.
  3. Link Count
  4. Owner of the file/directory
  5. Group the file/directory belongs to
  6. Size in bytes
  7. Day it was created/last modified
  8. Month it was created/last modified
  9. Time (if this year) or year it was created/last modified
  10. Name of the file/directory

For beginners, the columns of most importance are usually

Many CLIs also distinguish the type of a directory item by colour: directories are shown in blue, files in black. For example, the same directory structure on my laptop looks like this:

Also, as you can see, the first two columns often look like one column.

With this knowledge we can now properly interpret the output of ll of our current working directory:

CONTINUE ->