sorting files in a directory
Hi,
I have some files in a directory like file1.txt file10.txt file2.txt file11.txt I want to sort it to file1.txt file2.txt file10.txt file11.txt How to do that..? I tried like ls -1 *.txt | sort But it gave like file10.txt file11.txt file1.txt file2.txt Can anyone help me.. Thanks Shyju N |
Try -v (--sort=version) option
% ls -1 -v *.txt |
The files are sorted to character order - but you want them in numerical order.
When you number files, put in the leading zeros. http://unstableme.blogspot.com/2009/...sing-bash.html |
it worked..
thanks Shyju N |
that's sounds interesting
|
Quote:
... um ... what worked? |
All times are GMT -5. The time now is 04:05 AM. |