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 do is
Tag: wildcard
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 that we have a valid execv invocation, we can
Paths must precede expression Linux find
I have the following command: I get the error “find: paths must precede expression: 1990” Why is this? I have quoted the wildcard, so I don’t see the error. How to fix this? Thanks! Answer You need to repeat the -iname argument:
Bash: Using filenames as commands with the wildcard
I was playing around in my terminal earlier and discovered that I can execute single word commands (‘ls’,’cat’,’python2.7′,’exit’) by making a file or directory named the same thing as the command. However, I can’t execute ‘multi-word’ commands (‘rm -rf *’,’ls -a’, ‘python2.7 test.py’) (which also led me to discover that you can’t remove directories named ‘-rf’ with ‘rm -rf *’)
How to find files that contain two or more of a specific character?
I’m learning about wildcards and I’m trying to figure out how to find filenames that contain a specific character, two or more times. For example, finding filenames that have two or more x’s in them, such as Xerox. I know how to find files that have an *x, or that have an *ox*, but I can’t figure out how I’d
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 results in the same