Now that you know were you are, before you start moving around, maybe you want to know what else exists in the working directory! Contents of a directory can be displayed by using the ls
(list) command.
Hint: when typing the name of a file or directory, you can use the <TAB>
button to autocomplete!
The ls
command can be combined with arguments like ls -l
or ls -la
or ls -ltrh
for extra information. You can also use ls –help to get some help in what arguments you can use and what they mean. The command ls -la
, for example, means long (including extra details) list all (including hidden files) of the contents of a directory.
Very important!!!!!!!!
You should notice that when the name of a file or folder contains spaces it is quoted. This happens because spaces have a special meaning: they separate parts of a command. For example, ls My Music
, will be interpreted as ls My
and then ls
Music
. So when working in the terminal we strongly advise you to name your files and directories WITHOUT SPACES. For example the name 'My Music'
could instead be:
If you’re on a system other than Windows (including replit), it is also important to be aware that names are case sensitive, so Music
and music
are not the same!
1 – Click to do exercise in a controlled environment before practicing quiz:
LinuxSurvival (listing the directory)
2 – Practicing a bit more in your own computer:
Open replit where you started to work in the precious exercise, and list all the directories and files that you have in your computer in this specific directory. find out what is the path of your current directory.