Re: How to sort files in a directory?
On Sun, Feb 24, 2008 at 05:51:48PM +0000, Rodolfo Medina wrote:
> I want to sort all files with, say, .txt extension that are in the directory
> `/path/to/dir' and all its subdirectories, and I want to perform this search
> starting from the directory itself: how can I do that?
> I didn't manage with `find'.
> Thanks for any suggestion
> e.g.: suppose that in my home directory there are dir1 and dir2 and the
> following files:
> ~/file ~/dir1/file1 ~/dir/file2
> I want the result of my search to be:
Find indeed needs some help. It can only produce a list, and not very good
at sorting it out-of-order.
find . -name \*.txt -printf '%f\n' | sort
Tzafrir Cohen | email@example.com | VIM is
http://tzafrir.org.il | | a Mutt's
firstname.lastname@example.org | | best
ICQ# 16849754 | | friend