First look at the output of ls --help
command:
Several lines ignored in the output
-a, --all do not ignore entries starting with .
-l use a long listing format
- As you can see
-a
and-all
should be same - I found
-l
flag but there is no-al
in the help but this flag works
So my questions are:
- Why don't
-a
and-all
return the same output but help shows both of them in a same line? - Is
-al
an old form of-all
because both are the same but I didn't find manual for-al
- What's the meaning of
. ..
in thels -a
output?
Outputs of above commands included below:
ls -a :
. .. article.png bgame newtest
ls -all :
total 32
drwxr-xr-x 4 shahab shahab 4096 Sep 19 12:15 .
drwxrwxr-x 33 shahab sudo 4096 Oct 28 16:00 ..
-rw-r--r-- 1 shahab shahab 15504 Aug 19 16:06 article.png
drwxr-xr-x 5 shahab shahab 4096 Aug 19 10:41 bgame
drwxr-xr-x 5 shahab shahab 4096 Aug 29 16:48 newtest
ls -al :
total 32
drwxr-xr-x 4 shahab shahab 4096 Sep 19 12:15 .
drwxrwxr-x 33 shahab sudo 4096 Oct 28 16:00 ..
-rw-r--r-- 1 shahab shahab 15504 Aug 19 16:06 article.png
drwxr-xr-x 5 shahab shahab 4096 Aug 19 10:41 bgame
drwxr-xr-x 5 shahab shahab 4096 Aug 29 16:48 newtest
-l
3 times? of course each time you copy-paste this flag it wont add more details on output because as you saidls -a -l -l
same asls -a -l
also am I understood true that, you can combine two flags by type one hyphen and then both flags? .e.g-a
+-b
=-ab
?? (thanks again) – Shahab Ouraie Oct 28 '19 at 17:16.
one for parent directory..
what are they using for? – Shahab Ouraie Oct 28 '19 at 17:38-l
more than once doesn’t make any difference (unlike other programs where some options increase their effect if they’re added more than once). Two flags can indeed be combined,-a
and-b
becomes-ab
. – Stephen Kitt Oct 28 '19 at 17:39.
and..
. To understand..
, see this question and its answers, and the linked questions..
provides a reference to the current directory in a generic way. – Stephen Kitt Oct 28 '19 at 17:47