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 192903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:27:54+00:00 2026-05-11T16:27:54+00:00

Trying to rename a series of files on a linux server. Finding the files

  • 0

Trying to rename a series of files on a linux server. Finding the files I want is easy:

find . -type f -wholename \*.mbox

Of course, being mbox files, some of them have spaces in the names, so it becomes:

find . -type f -wholename \*.mbox -print0

I’m piping to xargs so that I can rename the files:

find . -type f -wholename \*.mbox -print0 | xargs -0 -I{} echo ${"{}"/.mbox/}

The echo should return something like INBOX, given INBOX.mbox, however, bash complains:

bash: ${"{}"/.mbox/}: bad substitution

How can I fix this? I’d like to try to keep it in a find/xargs solution if possible, so that I’m not adding a lot of looping constructs around it.

  • 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-05-11T16:27:54+00:00Added an answer on May 11, 2026 at 4:27 pm

    Try

    find . -type f -wholename \*.mbox | sed 's/\(.*\)\.mbox/mv "\1.mbox" "\1"/' | sh
    

    This is not 100% fool proof should some of the files contain double quote characters, but I assume you can ignore that 🙂

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

Sidebar

Related Questions

Using Python, I'm trying to rename a series of .txt files in a directory
I am trying to rename multiple files in windows using powershell. And I want
trying to rename all files in a directory to $arg[1] + number of file
I'm trying to rename several different files in bash. How to rename for example
I'm trying to rename some files, but getting a baffling error*. When I run
I am trying to rename files with a dash in the name to ensure
I am trying to rename many files in my application and need to be
I am trying to batch rename several files that are named using the following
I'm trying to rename some files in a directory using Python. Say I have
I'm trying to rename files that my program lists as having illegal characters for

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.