Renaming many files to their parent directory name [duplicate]
This question already has an answer here:
Rename files in directory according to name of directory
3 answers
Rename file by its folder name
4 answers
Rename files depending on their parent directory
3 answers
I want to recursively change many files named raw.tex
to parent-directory-hw.tex
. Is there a simple scripting solution to this problem?
For example, running the script on
.
`-- root
|-- baz
| `-- raw.tex
|-- foo
| `-- bar
| `-- raw.tex
`-- spam
|-- eggs
| `-- raw.tex
`-- raw.tex
should result in
.
`-- root
|-- baz
| `-- baz-hw.tex
|-- foo
| `-- bar
| `-- bar-hw.tex
`-- spam
|-- eggs
| `-- eggs-hw.tex
`-- spam-hw.tex
bash shell-script find rename
marked as duplicate by Kusalananda
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Dec 19 '18 at 7:47
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Rename files in directory according to name of directory
3 answers
Rename file by its folder name
4 answers
Rename files depending on their parent directory
3 answers
I want to recursively change many files named raw.tex
to parent-directory-hw.tex
. Is there a simple scripting solution to this problem?
For example, running the script on
.
`-- root
|-- baz
| `-- raw.tex
|-- foo
| `-- bar
| `-- raw.tex
`-- spam
|-- eggs
| `-- raw.tex
`-- raw.tex
should result in
.
`-- root
|-- baz
| `-- baz-hw.tex
|-- foo
| `-- bar
| `-- bar-hw.tex
`-- spam
|-- eggs
| `-- eggs-hw.tex
`-- spam-hw.tex
bash shell-script find rename
marked as duplicate by Kusalananda
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Dec 19 '18 at 7:47
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Rename files in directory according to name of directory
3 answers
Rename file by its folder name
4 answers
Rename files depending on their parent directory
3 answers
I want to recursively change many files named raw.tex
to parent-directory-hw.tex
. Is there a simple scripting solution to this problem?
For example, running the script on
.
`-- root
|-- baz
| `-- raw.tex
|-- foo
| `-- bar
| `-- raw.tex
`-- spam
|-- eggs
| `-- raw.tex
`-- raw.tex
should result in
.
`-- root
|-- baz
| `-- baz-hw.tex
|-- foo
| `-- bar
| `-- bar-hw.tex
`-- spam
|-- eggs
| `-- eggs-hw.tex
`-- spam-hw.tex
bash shell-script find rename
This question already has an answer here:
Rename files in directory according to name of directory
3 answers
Rename file by its folder name
4 answers
Rename files depending on their parent directory
3 answers
I want to recursively change many files named raw.tex
to parent-directory-hw.tex
. Is there a simple scripting solution to this problem?
For example, running the script on
.
`-- root
|-- baz
| `-- raw.tex
|-- foo
| `-- bar
| `-- raw.tex
`-- spam
|-- eggs
| `-- raw.tex
`-- raw.tex
should result in
.
`-- root
|-- baz
| `-- baz-hw.tex
|-- foo
| `-- bar
| `-- bar-hw.tex
`-- spam
|-- eggs
| `-- eggs-hw.tex
`-- spam-hw.tex
This question already has an answer here:
Rename files in directory according to name of directory
3 answers
Rename file by its folder name
4 answers
Rename files depending on their parent directory
3 answers
bash shell-script find rename
bash shell-script find rename
edited Dec 19 '18 at 7:45
asked Dec 19 '18 at 7:40
Brian Fitzpatrick
80611123
80611123
marked as duplicate by Kusalananda
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Dec 19 '18 at 7:47
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Kusalananda
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Dec 19 '18 at 7:47
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes