Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8904561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:09:51+00:00 2026-06-15T02:09:51+00:00

I want to remove a group of same extension files with different file name

  • 0

I want to remove a group of same extension files with different file name in different folders from my pen drive, I tried with the following commend, but its not working.

$sudo find /media/<Pendrive> *.jpg | rm -rf *

could someone let me know the exact command to delete the files from my Pendrive.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:09:52+00:00Added an answer on June 15, 2026 at 2:09 am

    You can write:

    sudo find '/media/<Pendrive>' -name '*.jpg' -exec rm -f '{}' ';'
    

    okay, If I’m exporting all the file paths to a text file and now I want to delete the files by using awk commend would it be possible in this case.

    If the text file is named all_file_paths.txt, then you can write:

    while IFS= read -r file_to_delete ; do
      if [[ "$file_to_delete" == *.jpg ]] ; then
        sudo rm -f "$file_to_delete"
      fi
    done < all_file_paths.txt
    

    (where the command IFS= read -r file_to_delete reads one line from standard input — which in this case is coming from all_file_paths.txt — and stores that line in the variable $file_to_delete).

    Note that this approach will misbehave if any file-paths contain the newline character. There’s no reliable way around that, since you’ve already discarded the distinction between “end of file-path” and “newline inside file-path” when you created all_file_paths.txt.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to remove duplicate lines from a file, without sorting the file. Example
I want to make this query on Symfony/Propel SELECT folders.NAME, COUNT(documents.NAME), COUNT(files.idfiles), SUM(files.size) FROM
I want to remove (uncommnet #) wheel group in /etc/sudoers file so what would
I want to remove the option Invite Only from Membership Requests in Organic Groups.
I want to remove the braces so {test} becomes test. I tried {test}.gsub(/\{(.*)\}/,$1) while
i want to remove the link from my header using CSS so that only
I want to remove a key from a dictionary if it is present. I
I want to remove the whitespace between the arrays, but I've used different codes
I want to remove a specific context menu item, appears when the Mouse down(right)
I want to remove the decimal part of a number in a cell but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.