S
S
Sergey Burduzha2017-09-20 09:43:22
ubuntu
Sergey Burduzha, 2017-09-20 09:43:22

How to select all files from a range?

There are files 001.jpg, 002.jpg, 003.jpg - 100.jpg
You need to select files from 001.jpg to 024.jpg
Unfortunately, I haven’t gone through regular expressions yet, but I’ll definitely study in the near future
Here’s what I came up with, but it doesn’t work
find . -regex "[001-024]\.jpg"
Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xibir, 2017-09-20
@serii81

find . -type f -regextype posix-awk -regex '.+/0([01][0-9]|2[0-4])\.jpg$' | sort

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question