So I'm in an OS class right now. First lab is pretty much fiddle around with the Bash shell. Anyway, the professor has an example of displaying a directory in reverse order by modification time.
ls /etc -alrt
This works the same as:
ls /etc -lt -c -r
Is there a reason to use the former as opposed to the latter, besides it being shorter? Also seems to use different flags
The -a flag for ls usually shows hidden files. So it'll show files prepended with a period and also the . and .. links for your current and parent directory.
The -l flag puts it in list format, with more details.
The -t flag is the sort by modification time flag.
The -r reverses that sort.
The -c I *think* sorts by modification time of the inode number, rather than the file.
It might just be coincidence that they show the same results, especially if you're listing a smaller set of files. When I run the commands on my box here, I get a different result for each.
I should note, I'm running ksh but I don't think that should make a difference.