FG

list files numbered in a specific range

Fresh3 days ago
Mar 15, 202652316 views
Confidence Score0%
0%

Problem

I have a set of files in a directory numbered as follows: Now, I'd like to run a command on a specific range of files, lets say 18 through 31. So far I have used the following ways, three arguments Now suppose I want every other number, loop this seems like it's a more reliable loop (spaces work) b…

Error Output

file1.txt
file2.txt
...
file30.txt
...

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: list files numbered in a specific range

Low Risk

Try this: It's known as a "sequence expression" and it's part of Bash's brace expansion feature. It works in Bash 3 and 4. The increment feature is new to Bash 4. You probably have Bash 3.x. In Bash 4, you can do: But in Bash 3, you have to do this …

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment