Tag Archives: find

Searching for a string inside multiple files and output the name of the files containing that string

find . -name “*” | grep -i ecomm | xargs ls -las | grep “Aug 27” | awk ‘{print $10}’ | xargs grep -i string_to_search_for | grep -i “\.log” | awk ‘{print $1}’ where: “ecomm” is part of the name … Continue reading

Tagged , | Leave a comment

find files and copy them to a certain folder in bash (draft)

find . -name “*” | grep -i scomm | xargs ls -ltr | grep “Aug 13 10” | awk ‘{print $9}’ to use in the cp command (get the column number 9 which contains the file’s full path cp `find … Continue reading

Tagged , , | Leave a comment

How to search for a string inside multiple text files

find starting_folder -name “*” | grep -i file_name | xargs grep -i search_string for example: “find . -name “*” | grep -i hobba | xargs grep -i tito” searches for the string “tito” inside all files whose name contains the … Continue reading

Tagged , , | Leave a comment

How to search for a file using the "find" command in bash (not case sensitive)

find start_directory -name “*” | grep -i search_string e.g. “find . -name “*” | grep -i hobba” searches within the current directory and can return a file with name “aamr_HoBba.log” for example.

Tagged , | Leave a comment