Reputation: 1272
This lists all svg files in a directory:
ls -1 *.svg
But how could I list say, the 50th svg through the 100th svg?
Thank you
Upvotes: 2
Views: 97
Reputation: 1073
The other answers here work perfectly well, but I thought I'd contribute a purely bash-builtin solution:
declare -i x=50 y=100 i=0;
for f in *.svg; do
((++i>y)) && break;
((i>=x)) && echo "$f";
done;
Here it is again as a single, compact line:
declare -i x=50 y=100 i=0; for f in *.svg;do((++i>y))&&break;((i>=x))&&echo "$f";done
Upvotes: 0