1
vote
5answers
65 views

Rename a portion of multiple files

Take a number of files named: data_a_LT.fits data_a_LT.coo data_a_LT.ec data_a_LT.grp I want to replace all "a_LT" with "LT_A" such that I have: data_LT_A.fits data_LT_A.coo data_LT_A.ec ...
14
votes
3answers
698 views

Move files and change ownership at the sametime

On Linux (Debian, Ubuntu Mint...), Is there any option command or something that I can use to transfer files to another user without having to do : sudo mv /home/poney/folderfulloffiles ...
4
votes
4answers
2k views

What is the most efficient way to move a large number of files that reside in a single directory?

CentOS 5.x I apologize if this is a repeat question. I've seen a lot of similar questions (regarding deleting files) but not exactly the same scenario. I have a directory containing hundreds of ...
5
votes
3answers
10k views

How to rename multiple files in single command or script in Unix? [duplicate]

I have the below list of files aro_tty-mIF-45875564pmo_opt aro_tty-mIF-45875664pmo_opt aro_tty-mIF-45875964pmo_opt aro_tty-mIF-45875514pmo_opt aro_tty-mIF-45875524pmo_opt that I need to rename to ...
2
votes
2answers
544 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
247 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
106 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
485 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 ...
11
votes
5answers
29k 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
8k 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 ...
5
votes
3answers
625 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
2k 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
3k 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 ...
19
votes
6answers
15k 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 ...
2
votes
2answers
3k 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 ...