Results 1 to 5 of 5

Thread: Hard time using find...-exec

  1. #1
    Join Date
    Aug 2016
    Location
    El Lago, Texas
    Beans
    685
    Distro
    Ubuntu Mate

    Hard time using find...-exec

    I am having a hard time understanding how to use -exec.

    I am trying to delete all .deb files.

    This does not work and returns no messages when run.

    Code:
    find /home/andy/.local/share/Trash/expunged/ -type f -exec rm {*.deb} \;
    Ubuntu Mate 18.04 Bionic
    Mate Desktop

  2. #2
    Join Date
    Jun 2019
    Location
    Dirndl-land
    Beans
    772
    Distro
    Lubuntu 20.04 Focal Fossa

    Re: Hard time using find...-exec

    Why are you searching for files in the garbage can?

    You'll need to rearrange the command, I think.

  3. #3
    Join Date
    Aug 2016
    Location
    El Lago, Texas
    Beans
    685
    Distro
    Ubuntu Mate

    Re: Hard time using find...-exec

    The files themselves go to

    Code:
    /home/andy/.local/share/Trash/files/
    My entire script.
    Code:
    #!/bin/bash
    find /home/andy/.local/share/Trash/expunged/ -type f -exec rm {} \;
    find /home/andy/.local/share/Trash/files/ -type f -exec rm {} \;
    find /home/andy/.local/share/Trash/info/ -type f -exec rm {} \;
    The script works with all deleted files except .deb files?
    Last edited by raleigh3; August 19th, 2020 at 12:20 AM.
    Ubuntu Mate 18.04 Bionic
    Mate Desktop

  4. #4
    Join Date
    Aug 2016
    Location
    El Lago, Texas
    Beans
    685
    Distro
    Ubuntu Mate

    Re: Hard time using find...-exec

    Code:
    rm /home/andy/.local/share/Trash/files/*.deb
    Ubuntu Mate 18.04 Bionic
    Mate Desktop

  5. #5
    Join Date
    Apr 2020
    Beans
    70

    Re: Hard time using find...-exec

    --Try this (not tested)

    find /home/andy/.local/share/Trash/expunged/ -type f -name *.deb -exec /bin/rm -fv {} \;

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •