

He wrote more than 7k+ posts and helped numerous readers to master IT topics.

Vivek Gite is the founder of nixCraft, the oldest running blog about Linux and open source.
#LINUX FIND FILE RECURSIVE HOW TO#
You learned how to search and delete a directory recursively when using Linux or Unix-like operating system. See “ How to push/send message to iOS and Android from Linux CLI” for more information. Mail -A " $log" -s "Backup rotation successful $HOSTNAME " -r webmaster alert <<< "$0 script ran successfully." fi # Remove log file if found & /bin / rm -f " $log" Push_to_mobile "$0" "Monthly backup rotation successful $HOSTNAME " egrep -R is what enables the recursive search, and sed -i enables Seds in-place mode to modify the files directly. Mail -A " $log" -s "Backup rotation failed $HOSTNAME " -r webmaster alert <<< "$0 script cached errors." else Open up the du command and read the recursive directory listing on Unix. For Linux, check a recursive directory listing by using the the find command: /dir/ -print. Push_to_mobile "$0" "Alert backup rotation failed - $HOSTNAME. How To Find A File In Linux Recursively -R: Gets the directory list on Linux if you run ls -R. Share a.3 answers 16 votes: man grepFor this example, grep -i -R your phrase directory-i means case insensitive. $ find /dir/to/search/ -type d -name "dirName" -exec rm -rf " & failed= "true" # Send email and push status to sysadmin mobile # if then If you dont know which directory, use / - but be prepared for it to take a long time. Find command syntax to delete directory recursively
