I have question about sorting files,and my question is different from other questions about sorting I have a folder including hundereds of files looks like this
anacovaux_1052_summary_betai.out
anacovaux_1052_summary_Pdelta.out
anacovaux_1052_summary_pij.out
anacovaux_1053_DIC.out
anacovaux_1053_summary_betai.out
anacovaux_1053_summary_beta_params.out
anacovaux_1048_DIC.out
anacovaux_1048_summary_betai.out
anacovaux_1043_summary_pi_xtx.out
anacovaux_1058_DIC.out
I wanted to know is there any way that I could sort them numerically? I mean get something like this:
anacovaux_1043_summary_pi_xtx.out
anacovaux_1048_DIC.out
anacovaux_1048_summary_betai.out
anacovaux_1052_summary_betai.out
anacovaux_1052_summary_Pdelta.out
anacovaux_1052_summary_pij.out
anacovaux_1053_DIC.out
anacovaux_1053_summary_betai.out
anacovaux_1053_summary_beta_params.out
anacovaux_1058_DIC.out
lsshould sort them already, as wouldecho *andprintf '%s\n' *.lsor GNUls -v. For instance, do you wantB_1.outto sort beforeA_2.out? You'd wantA2to sort beforeA10I presume?