0

I tried:

grep "$1-2400000" /media/linux/DATADISK/flashka/ 

It is running and doing nothing for a long time. Is there another way? It is not necessary to do that with the terminal.

1
  • 3
    Do you want to grep a literal $1 or is this supposed to be a variable to be expanded? Commented Mar 12, 2020 at 10:59

1 Answer 1

0

You're missing a -r to match "all files" and should probably use single-quotes:

grep -r -l -F '$1-2400000' /media/linux/DATADISK/flashka/ 

With -l, grep will only show you filenames, not the match in the file. -F greps for a fixed string, instead of a regex.

If your filenames contain spaces or other special characters, you may want to make use of find instead:

find /media/linux/DATADISK/flashka/ -type f -exec grep -l -F '$1-2400000' {} \; 
0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.