아래와 같은 파일 세트가 있습니다. 하루에 4개의 시간 단계가 있는 데이터가 있습니다. 날짜와 시간 NetCDF
및 사용을 기준으로 이러한 파일을 나열하고 싶습니다 cdo
.
anal_06z20210323.nc
anal_06z20210324.nc
anal_06z20210325.nc
anal_06z20210326.nc
anal_06z20210327.nc
anal_06z20210328.nc
anal_06z20210329.nc
anal_06z20210330.nc
anal_06z20210331.nc
anal_06z20210401.nc
anal_06z20210402.nc
anal_06z20210403.nc
anal_06z20210404.nc
anal_06z20210405.nc
anal_06z20210406.nc
anal_06z20210407.nc
anal_06z20210408.nc
anal_06z20210409.nc
anal_06z20210410.nc
anal_12z20210723.nc
anal_12z20210724.nc
anal_12z20210725.nc
anal_12z20210726.nc
anal_12z20210727.nc
anal_12z20210728.nc
anal_12z20210729.nc
anal_12z20210730.nc
anal_12z20210731.nc
anal_12z20210801.nc
anal_12z20210802.nc
anal_12z20210803.nc
anal_12z20210804.nc
anal_12z20210805.nc
anal_12z20210806.nc
anal_12z20210807.nc
anal_12z20210808.nc
anal_12z20210809.nc
anal_12z20210810.nc
anal_18z20211122.nc
anal_18z20211123.nc
anal_18z20211124.nc
anal_18z20211125.nc
anal_18z20211126.nc
anal_18z20211127.nc
anal_18z20211128.nc
anal_18z20211129.nc
anal_18z20211130.nc
anal_18z20211201.nc
anal_18z20211202.nc
anal_18z20211203.nc
anal_18z20211204.nc
anal_18z20211205.nc
anal_18z20211206.nc
anal_18z20211207.nc
anal_18z20211208.nc
anal_18z20211209.nc
anal_18z20211210.nc
답변1
나는 이것을 제안한다:
$ find . -name "*.nc" | \
xargs -I '{}' echo '{}' | \
sed -e 's/z/@/' -e 's/\./@/2' | \
sort -t@ -k2,2 | \
sed -e 's/@/z/' -e 's/@/./'
./anal_06z20210323.nc
./anal_06z20210324.nc
./anal_06z20210325.nc
./anal_06z20210326.nc
./anal_06z20210327.nc
./anal_06z20210328.nc
./anal_06z20210329.nc
./anal_06z20210330.nc
./anal_06z20210331.nc
./anal_06z20210401.nc
./anal_06z20210402.nc
./anal_06z20210403.nc
./anal_06z20210404.nc
./anal_06z20210405.nc
./anal_06z20210406.nc
./anal_06z20210407.nc
./anal_06z20210408.nc
./anal_06z20210409.nc
./anal_06z20210410.nc
./anal_12z20210723.nc
./anal_12z20210724.nc
./anal_12z20210725.nc
./anal_12z20210726.nc
./anal_12z20210727.nc
./anal_12z20210728.nc
./anal_12z20210729.nc
./anal_12z20210730.nc
./anal_12z20210731.nc
./anal_12z20210801.nc
./anal_12z20210802.nc
./anal_12z20210803.nc
./anal_12z20210804.nc
./anal_12z20210805.nc
./anal_12z20210806.nc
./anal_12z20210807.nc
./anal_12z20210808.nc
./anal_12z20210809.nc
./anal_12z20210810.nc
./anal_18z20211122.nc
./anal_18z20211123.nc
./anal_18z20211124.nc
./anal_18z20211125.nc
./anal_18z20211126.nc
./anal_18z20211127.nc
./anal_18z20211128.nc
./anal_18z20211129.nc
./anal_18z20211130.nc
./anal_18z20211201.nc
./anal_18z20211202.nc
./anal_18z20211203.nc
./anal_18z20211204.nc
./anal_18z20211205.nc
./anal_18z20211206.nc
./anal_18z20211207.nc
./anal_18z20211208.nc
./anal_18z20211209.nc
./anal_18z20211210.nc