In bash, how can I rename a file without repeating the path?
Fresh3 days ago
Mar 15, 20264089 viewsConfidence Score0%
0%
Problem
Possible Duplicate: Reuse text on a bash command If I want to rename a file a few directories deep, how can I avoid repeating the path? For example: I'm wondering if there's a way to make this: Where would be some way of saying "in the same directory."
Error Output
mv path/to/old_filename.txt path/to/new_filename.txt
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Canonical Fix
Unverified Fix
New Fix – Awaiting Verification
Fix for: In bash, how can I rename a file without repeating the path?
Low Risk
You can use brace expansion: Here is a link to the GNU guide on brace expansion in the bash shell, which defines a list of substitutes and tells bash to repeat the parameter using a different substitute each time it repeats. For example, will be exp…
Awaiting Verification
Be the first to verify this fix
Sign in to verify this fix