2017-02-20 29 views

回答

3

嘗試:

ls -1 *.svg | awk "NR >= 50 && NR <= 100"

0

這有幫助嗎?

ls -1 *.svg | head -100 |tail -50 
0

這裏其他的答案很好的工作,但我想我會促成一個純粹的bash,內置的解決方案:

declare -i x=50 y=100 i=0; 
for f in *.svg; do 
    ((++i>y)) && break; 
    ((i>=x)) && echo "$f"; 
done; 

這再次作爲單一緊湊型線路:
declare -i x=50 y=100 i=0; for f in *.svg;do((++i>y))&&break;((i>=x))&&echo "$f";done

相關問題