

The most common way to use it is with the -h argument which means “human readable” (because we are not machines, right?): :~$ df -hįilesystem Size Used Avail Use% Mounted on It lists the actual “disk space usage” and it can give you information about what hard disks (or current disk space) is being used in the entire system. The df command in Linux is probably one of the most commonly used. Let’s see what commands you can use to show disk info in Linux.

Please note that some of these commands are actually disk partitioning tools and listing disk partition is one of their features. Here are some different commands which can list the hard drives, keep in mind there are others but these are probably the most commonly used and easy to get the job done. Keep in mind a hard drive could be physically connected, virtually connected or even emulated (for example: when you use storage devices such as EMC, Sun or IBM). Have any other helpful tips or tricks for sorting directories by date? Let us know in the comments below.There are several ways to list all the hard drives present in a system through Linux command lines.
List file details linux mac#
For example, sorting the Mac Finder ‘All My Files’ by last date opened is a great tip that can be similarly applied to any other folder shown in Finder on the Mac to show the last time a file was accessed or modified. 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.
