Skip to content

Instantly share code, notes, and snippets.

@mikepmunroe
Created February 6, 2013 14:53
Show Gist options
  • Save mikepmunroe/4723034 to your computer and use it in GitHub Desktop.
Save mikepmunroe/4723034 to your computer and use it in GitHub Desktop.
Return a list of most recent files in a linux directory, capped by the number of files you want returned. In this example, I capped the results at 10, but you can change 'head -10' to whatever you want. 'tail -n +2' cuts off the number of results that would show at the top of the files returned.
ls -l -t | tail -n +2 | head -10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment