complex sort question
hi all
I am getting a files with the format below from my application. the format of the file names are <app name>_<version #>_<sn>_<name> e.g log_0.7.90.1_00010_black.txt log_0.7.70.1_00010_silver.txt log_0.7.80.1_00010_gold.txt log_0.7.80.1_00020_blue.txt log_0.7.80.1_00030_green.txt log_0.7.80.1_00040_red.txt how can i sort these files according to version number and its serial number (i'm using Bash) thank a lot Yaniv |
ls |sort -n
is that what you are looking for? |
Quote:
Code:
sort -t_ -k2,3 file Cheers, Tink |
thanks
|
How about:
Code:
ls | sort -V |
All times are GMT -5. The time now is 10:23 AM. |