The glob tag has no wiki summary.
1
vote
2answers
47 views
“or” in shell glob
I want to ls the files containing the substring "s1r", "s2r", "s3r" or "s19r" in their filenames.
I'm almost there!
Botched attempts:
ls *s[123][9?]r*
The above gives me only files including the ...
5
votes
2answers
46 views
Modifying zsh globbing patterns to use with cp
I'm trying to write a script to copy files recursively from a particular folder except files A.extn, B/*.extn and C/* where B and C are directories and extn is just some generic extension. This is ...
8
votes
5answers
243 views
Can I select only one result from a bash glob?
I'm trying to write a script for work to automate some reporting on an output. The Log files are (currently, it's being 'standardise' in the future) stored in this sort of path structure:
...
1
vote
1answer
86 views
How does logrotate treat globbing?
If I have a logrotate config file like this,
# matches multiple ones
/var/log/project/*.log {
...
prerotate
...
endscript
...
}
So how does the glob work here? If I have 3 log ...
2
votes
2answers
92 views
What is an equivalent of rm `find lib/ -name *.swp` without find?
As in the title, I would like to remove all files in the lib directory with .swp in the end.
How can I do this without find in:
rm `find lib/ -name *.swp`
1
vote
1answer
84 views
Filter / select folders using wildcards
For my mecurial ignore file I want to select all the folders that start with dataset in my project folder with with one 'glob statement'.
Example project folder:
my_project_folder/
dataset1/
...
4
votes
2answers
486 views
Recursive glob?
I'd like to write something like this:
$ ls **.py
in order to get all .py filenames, recursively walking a directory hierarchy.
Even if there are .py files to find, the shell (bash) gives this ...
0
votes
1answer
418 views
Asking ls to only list files in a path that match a specific glob/regex
In Zsh: Is there a way to use ls to only list files and folders in the current directory that match a specific globbing or regex pattern?
For example, say I have multiple files that start with the ...
12
votes
5answers
4k views
How to match case insensitive patterns with ls?
I would like to list all files matching a certain pattern while ignoring the case.
For example, I run the following commands:
ls *abc*
I need to see all the file that have "abc" as a part of the ...