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
-aand-allshould be same - I found
-lflag but there is no-alin the help but this flag works
So my questions are:
- Why don't
-aand-allreturn the same output but help shows both of them in a same line? - Is
-alan old form of-allbecause both are the same but I didn't find manual for-al - What's the meaning of
. ..in thels -aoutput?
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
-l3 times? of course each time you copy-paste this flag it wont add more details on output because as you saidls -a -l -lsame asls -a -lalso 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-lmore 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,-aand-bbecomes-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