I'd like to rename a group of files to their same filename but without extension. They are scattered in my home directory and I don't know where they are located precisely, but I do know the extension to be removed.
I need to have one and only one command to perform this task.
Here's the partial command:
$ find ~/ -type f -name "*.hhs" -exec mv {} <I DO NOT KNOW> \;
Where <I DO NOT KNOW>
is to be replaced by your suggestion. For example, I tried to replace it with the following:
`basename {} .hhs`
It does not work for me.
Example
If files file1.jpg.hhs
and file2.jpg.hhs
are found, I'd like them to be renamed as follows: file1.jpg
and file2.jpg
find
example usescp
, which would create a copy yet your title and body of the question imply a rename -- what's the goal? – Jeff Schaller Nov 28 '18 at 14:18