How to List a Directory Sort by Date in Linux

Save

When you want to clean up your files, it is important to know which files are being used. Files that have not been updated or opened recently may be candidates for archiving or storing on an optical drive. The "ls" command in Linux lists the contents of a directory alphabetically. However you can use different command options to sort the contents of the directory by date. Depending on the options, you can show the most recently used files first or last.

  • Open a terminal or Konsole window. The "Terminal" or "Konsole" applications can be found by right-clicking on the desktop or under the main "Programs" menu.

  • Type the command "cd dir_name" to navigate to the directory that you want to list. Replace "dir_name" with the path to and name of the directory.

  • Type the command "ls -lt" to list the contents of the directory by date with the most recent items at the top of the list.

  • Type the command "ls -lrt" to list the contents of the directory by date with the most recent items at the bottom of the list.

References

Promoted By Zergnet

Comments

You May Also Like

  • How to Organize a Folder by Date

    Your Windows computer lets you sort folders by date. You sort folders by date to make it easier to find files chronologically....

  • File Management Techniques

    Ambiguous file names, mysterious file contents, unknown creation dates and odd filing locations can make finding computer files a pain. Employing a...

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

M
Is DIY in your DNA? Become part of our maker community.
Submit Your Work!