• Linux shell script deletes the core files from a particular directory in Redhat

    Arnold Member

    Linux shell script deletes the core files from a particular directory in Redhat

  • Adelaid Member

    you can go into directory in which you want to remove files..then

    rm -fR $pwd/*
    
  • Ganesh Member

    I believe he means “core” files…as in dumps that occur in servers.

    Use the following command:

    • find -name core
    • dump to a file
    • then grep the file to conduct a rm-f of the core dumps
    • Now make that into a script and make it executable
    • Half the fun is figuring it out!
  • SapnaVishwas Member

    If you want to remove all the core files from a particular directory structure, you could do:

    find  -name core -exec rm {} \;
    

    for example, to remove all core files under /usr/lib, you could use:

    find /usr/lib -name core -exec rm {} \; 
    
Viewing 3 reply threads
  • You must be logged in to reply to this topic.
en_USEnglish