Skip to content

Tag: wildcard

Excluding a file extension through wildcards

I have a directory which files with multiple extensions such as *.asc, .txt..csv etc. I am using this path in a script where I can only change the file names, which is passed through variable. I can pick all the .csvs by passing *.csv as the variable value or *.txt for respective files. However what I want to…

How to pass an extra option in ls using execv()?

I’m trying to execute this simple command ls -1 *.c using the execv() function. The output I’m getting is Answer There’s a big problem in your code: execv can’t tell how big the array you’re passing it is. You absolutely need a terminating NULL element to mark the end: OK, now th…

bash wildcard n digits

So I’ve got the following files in the tmp directory: if I wanted to list only the files that end in ‘.digits’ (0, 1, 22, 4444) but not (t9) I could try and use wildcards such as this: however I get the following results with the ugly error I’ve also tried using {0..999} but that also …