Tagged Questions
2
votes
2answers
75 views
Delete whitespace in filenames in directory
I have a directory where some filenames have been wrongly named something .pdf rather than something.pdf. Is there a quick one liner I can use to delete the whitespace in the filenames.
I have tried ...
1
vote
2answers
85 views
Is it better to pass all files to mv or to run a bunch of mv processes in parallel?
I have three ways of running mv. First:
mv /db/dbfile1 /db/dbfile2 /db/dbfile3 /usb_storage/
and second:
mv /db/dbfile1 /usb_storage/ &
mv /db/dbfile2 /usb_storage/ &
mv /db/dbfile3 ...
1
vote
2answers
77 views
renaming a directory and its subdirs without affecting their files
I have to rename directories under the root directory with prefix "ms_PF" and then rename their subdirectories with the modified name of the main directory with an extra "_", and then copy all ...
1
vote
3answers
119 views
Recursively edit files based on parent directory's name
I'm facing an issue I'm not quite sure how to overcome. I have a large directory with hundreds of folders, all following the naming scheme "a_b_x", with x being a random word. In every one of these ...
4
votes
6answers
514 views
How to move all files and folders via mv command
How can I move all files and folders from one directory to another via mv command?
2
votes
3answers
1k views
Rename files by incrementing a number within the filename
I have a directory which contains numbered image files, something like this:
01.png
02.png
03.png
03.svg
04.png
05.png
06.jpg
07.png
08.png
09.png
09.svg
10.png
Sometimes there may be multiple ...
4
votes
3answers
216 views
Linux Rename File Beginning with “--” [duplicate]
Possible Duplicate:
How do I delete a file whose name begins with “-” (hyphen a.k.a. dash or minus)?
This is an awkward one, I have received some files from a windows machine ...
1
vote
3answers
1k views
rename multiple files with rename command? [duplicate]
Possible Duplicate:
How can I rename a lot of files using a regex?
Rename All Files with a Certain Name
There are files with
ORDER_EVENTS_SOMETHING_20120117.log
...
8
votes
3answers
1k views
How can I use ms-dos style wildcards with ls and mv?
I have the misfortune of coming from a MS-DOS background - but at least it makes me appreciate how much more powerful Linux is. I've been working on getting my Linux-Fu up to par, but there are a ...
8
votes
5answers
4k views
How to replace one char with another in all filenames of the current directories?
How do you rename all files/subdirs in the current folder?
Lets say, I have many files and subdirs that are with spaces and I want to replace all the spaces with an underscore.
File 1
File 2
File 3
...
1
vote
2answers
1k views
How do I correct a directory incorrectly copied into itself?
Given the following situation...
<path>/mydir1/mydir2
...where mydir2 should have overwritten mydir1, but was instead placed inside, and both directories actually have the same filename. How ...