2
votes
2answers
107 views

grep and directories containing spaces

I would like to search all files containing an association of strings (here the files should contain 'arthur' AND ('déni' OR 'deni') for instance) in a directory and subdirectories. After some search ...
2
votes
2answers
109 views

How do I check that a filename conforms to a pattern?

I'm tasked with writing a shell script which checks that a filename conforms to a specific pattern and I'm not sure how to go about it. The filename should follow a pattern which looks like: ...
2
votes
3answers
194 views

Finding a number of occurrences of a certain character in tcsh

I am trying to find the number of certain types of files that have a '_' in the filename. I'm a massive beginner so my syntax looks like this at the moment; foreach txt ( 'ls *.txt') set n=0 if(grep ...
2
votes
4answers
923 views

Grep for a string with list of files as source

I have a plain text file, in every line is a path to a file. Now I have to grep for a string in these files. Is there any way to use this file as "search source" for grep? Or do I have to copy and ...
1
vote
1answer
234 views

How can I grep through files whose name begins with `-`? [duplicate]

I've tried this. grep -r thanks * slave-iv grep: invalid option -- '@' Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information. Here's ...