In this series we introduce you to commands for the command line of macOS which make life easier and faster.

The command line or the terminal can be found on macOS in the menu bar of your Mac under Go to > Utilities > Terminal. We know many people have never used this type of command prompt before. This is often because a command line, unlike a graphical user interface, does not display the options you can use – you need to know them.

cmd button1

And this is exactly where we want to start: from now on we will show you a command from time to time, so that you at least can act a little on the command line and lose your fear of it.

Today’s command: Show files of a directory.

List files.
ls : list


After we’ve shown you how to change the directory, you’d like to see what’s in it at all. The necessary command is called “ls” and lists (you can remember it well) everything that is in the current directory.

ls

We’ll give you two more arguments. If you add “-l” for “long”, you will get a lot of detailed information. Just enter the following:

ls -l

And if you also want to show hidden files (those that start with a dot), just add “-a”, for “all”.

ls -a

Practically, you can also simply combine both arguments.

ls -l -a

Or, if you are in a hurry, simply summarize the two arguments after a minus:

ls -la

Now you should find out what files are in the respective directory.

Close