If I have 10 files called 01-a.txt, 02-a.txt,...10-a.txt - how can I find the files where the number is greater than 5? I would like a general solution, and I would be putting the contents of all files into one file using something like
cat *.txt > bigfile.txt
I can get files with numbers using
ls *[0-9]*
but can't seem go beyond that.
thanks.
First, open the folder to obtain a file list within the Command Prompt. To do so, enter cd\ followed by a folder path and press Return. Press the Win + E key combo, and open the folder for which you set up a file title list. You'll find the file list text document you set up with the Command Prompt within that folder.
Assuming the folder contains only these files.
This would list all files where the number is > 5
ls [0-9]* | awk -F '-' '{if ($1 > 5) print $0}'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With