We're an ISO27001:2013 Certified Supplier

New

This is really quick, really simple, and really useful.

It’s often helpful to see which files in a directory have been modified the most recently, For example, which logfiles have been written to recently?

A very simple command would be:

$ ls -lt | head

The ls lists the files; the -l gives a long listing with more detail; the -t sorts files by their last modified time, newest first, and finally piping the result through head shows only the first 10 lines of the output.

For convenience, I define this in my ~/.bash_profile:

alias new='ls -lt|head'

Now, simply typing new at the command prompt shows me the newest files in the current directory. Try it: you’ll use it more than you think.

Could This Linux Tip Be Improved?

Let us know in the comments below.

1 thought on “Linux Tips: What’s New?”

Leave a Reply

Your email address will not be published. Required fields are marked *

Secure. Reliable. Scalable.

If that doesn't describe your current Linux systems, check out our FREE Linux Survival Guide to help you get your systems up to scratch today!

  • This field is for validation purposes and should be left unchanged.