I want to do something like ls -t
but also have the files in subdirectories included. But the problem is that I don't want the output formated like ls -R
does, which is like this:
[test]$ ls -Rt b testdir test ./testdir: a
I want it to be formatted like the find
command displays files in subdirectories. I.e:
[test]$ find . . ./b ./test ./testdir ./testdir/a
But what find
doesn't seem to do is order the result chronologically by last update time.
So how can I list all the files in a directory and subdirectories, in the format that find
does, but in reverse chronological order?
The ls command is used to list files or directories in Linux and other Unix-based operating systems. Just like you navigate in your File explorer or Finder with a GUI, the ls command allows you to list all files or directories in the current directory by default, and further interact with them via the command line.
Listing files in reverse name order To reverse the listing of files by name, add the -r (reverse) option. This will be like turning the normal listing upside down.
If you want to get the results in the reverse sort order, use the -r option. It's worth mentioning that the ls command does not show the total space occupied by the directory contents. To get the size of a directory , use the du command.
ls -lR
is to display all files, directories and sub directories of the current directory ls -lR | more
is used to show all the files in a flow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With