![]() This trick obviously applies to the command line and Terminal, but sorting by date and variations of date modified or last date opened can be incredibly useful for Finder as well. The output will be same except it has been shown in reverse order, with oldest modified date on top and most recently modified date and time on the bottom. If you want to reverse the order so that the most recently modified items are on the bottom of the ls command output, you can add the -r flag as well like so: This also makes it an easy to remember flag of -halt, used like so: My personal preference for sorting ls output by date modified is to use -lt but also include -h for human readable sizes, and -a for showing all dot prefixed files as well. Show ls Sort by Date, Human Readable, All Files The most recently modified items will be shown at the top of the command output, rather than showing the returned list in alphabetical order. Hit return to see the directory contents listed with ls by date.Open the Terminal if you have not done so already (/Applications/Utilities/ in mac OS) and navigate to the directory you wish to sort by date with ls.The -t flag will sort the ls command output by last date and time modified: ![]() ![]() Let’s review a few helpful ways to sort ls output by date. The -t flag will sort ls command output by last modified date and time, but for best results you’ll likely want to apply it with the -l long listing flag, and perhaps a few others as well.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |