The rename tag has no wiki summary.
4
votes
6answers
527 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?
4
votes
4answers
180 views
Follow a moved file to its destination directory
Is there a way to move a file from a directory to another and then cd into the latter in one command? Something like mv /a/file /another/dir && cd _ but without typing second time the ...
0
votes
2answers
402 views
batch rename a few files [duplicate]
Possible Duplicate:
Batch renaming files
I have some files that I wish to rename in a single command. The files are names thus. I want the E S Posthumus bit removed from the names and also ...
4
votes
4answers
190 views
How to shift filename numbers without collisions?
Consider this list of files:
$ touch index-{1,2,3,4,5,6,7,8,9}.txt
If I want to shift them down so they start at zero, it's relatively easy:
$ rename --verbose 's/^index-([1-9])\.txt$/$1/; ...
3
votes
1answer
265 views
When we use mv command, what changes take place in HDD?
Under following conditions-
mv within the same HDD partition
mv to a different partition in the same HDD
mv to a different device (e.g. USB HDD)
Is the complete file moved or is it a very small ...
3
votes
7answers
722 views
Bulk rename, change prefix
How can I bulk replace the prefix for many files?
I have a lot of files like
TestSRConnectionContext.h
TestSRConnectionContext.m
I would like to change all them to
CLConnectionContext.h
...
4
votes
2answers
133 views
Trying to do arithmetic in Perl rename tool (Debian)
Supposed I have five mp3 files:
01-trackfoo.mp3
02-trackbar.mp3
03-trackbaz.mp3
04-trackabc.mp3
05-trackxyz.mp3
Now I give a quick listen to the files (just mplayer on console will do the trick) ...
0
votes
2answers
341 views
File extension case sensitivity on CentOS [duplicate]
Possible Duplicate:
How to clean up file extensions?
I'm using CentOS. There are >10M images in one of my folders, which are furthur grouped into subdirectories.
The issue is that some of ...
3
votes
2answers
387 views
How do I get this find and rename command to work with subdirectories? [duplicate]
Possible Duplicate:
Recursive rename files and directories
I have a large directory of music files that is often changing as files and directories come and go. My preference is to make sure ...
3
votes
1answer
243 views
Can't rename a directory that I own
I have a directory with a big load of sub directories. I own all of them, and the permissions are all 777.
pascal@azazel /box $ ls -al
total 147872
drwxr-xr-x 293 root root 12288 aoû 22 19:44 ...
15
votes
3answers
2k views
Why unix mv program doesn't need -R (recursive) option for directories but cp does need it?
This is a kind of "wtf?" question, so I'm sorry if I will disturb someone's vision of how things should be or if I will just annoy you with the "stupid" question.
I always get messed up when need to ...
1
vote
1answer
109 views
Move some files on every dir to a different dir [duplicate]
Possible Duplicate:
How can I move files by type recursively from a directory and its sub-directories to another directory?
I'm quite new to Linux and specially to the shell and all of its ...
3
votes
2answers
229 views
rename randomly files on a USB device
I would like to rename all of my files of my USB device randomly. Indeed, in my car, my tuner has not the random function.
I think I can do it with PHP ... but I'm pretty sure it is possible to do ...
2
votes
5answers
226 views
Flatten Directory but Preserve Directory Names in New Filename
How can I flatten a directory in the following format?
Before: ./aaa/bbb/ccc.png
After: ./aaa-bbb-ccc.png
3
votes
2answers
501 views
Remove prefixes from filenames
I have a bunch of files as follows:
04602635_b0294.DAT20120807164534
04602637_b0297.DAT20120807164713
04602638_b0296.DAT20120807164637
04602639_b0299.DAT20120807164819
...
4
votes
1answer
143 views
xterm doesn't switch directory when it is moved
Recently I was very frustrated with xterm not behaving as expected. This is what I was doing:
open xterm
run the following commands:
$ mkdir test_01
$ cd test_01/
$ echo 'a' > a
$ cat a
The ...
1
vote
1answer
257 views
rename files maching specific mtime value within directory
I use simple set of shell commands to in order to create mysqldumps daily. The script is called by cron daemon. It looks like:
presentdate="`date +%d-%m-%Y_%H:%M.%S`"
basedir="/var/db_my_backup"
...
3
votes
3answers
494 views
Rename multiple directories
I want to find all directories with the last subdirectory named doc, for then rename them to Doc. How can be renamed?
I've the first part:
find -type d -name 'doc'
which returns directories paths ...
2
votes
1answer
178 views
Detect file-type with the help of magic-file and rename file-suffix accordingly
I have a folder (the iPhone Backup) with various files without a suffix.
I want to run a batch process over these files, which detects each file's file-type (with the help of the magic-file database ...
5
votes
4answers
998 views
Renaming a bunch of files with date modified timestamp at the end of the filename?
So, say, I have a directory with a bunch of files like g.txt, where g.txt was last modified on, say, June 20, 2012.
How would I batch-rename all of the files (like g.txt) with the last modified date ...
15
votes
2answers
397 views
What does mv do in case of errors?
I've just tried to move a big tree from one disk to another, which was too small. Now, I'm left with something I can't really understand - it looks like some files were indeed moved away from the ...
3
votes
1answer
678 views
Gunzip multiple files and rename them
I want to know whether it is possible to gunzip multiple files and rename them with one command/script.
I have a bunch of files in the format:
test.20120708191601.DAT.3599502593.gz
...
3
votes
1answer
287 views
How do permissions work when moving directories?
Recently I tried to move a directory that I own to another directory (which I also own), but I couldn't. I then noticed that I don't own the parent directory.
This made me wonder what are the rules ...
0
votes
2answers
873 views
How can I rename all files in the current directory having a particular extension to another extension? [duplicate]
Possible Duplicate:
Renaming multiple files (changing extension)
Suppose that in my current/working directory I have five files:
file1.xvg
file2.xvg
file3.xvg
file1.eps
file2.eps
Is ...
2
votes
1answer
112 views
prepend digit to filenames which begin with digits (with zmv, please)
I have a directory with files named like 19.png, 20.jpeg, and README00.txt
I want to rename these to 119.png, 120.jpeg, and README00.txt.
I would like to do this with zmv as it works well in so many ...
3
votes
2answers
361 views
How do I find a bunch of files with a string in its filename (or body text) and then move all those files to a specific folder?
Say - what if I wanted to move every HTML file in several independent directories with the word "heavengames" in its filename (and as a second question, every HTML files with the word "heavengames" in ...
0
votes
3answers
182 views
Recursively rename e-mail files from .txt to .eml
Directory "$d" contains a few thousand e-mail files with the .txt extension. To open them in my e-mail client, I need to rename them to .eml
Will this command rename them correctly:
find "${d}" ...
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 ...
7
votes
1answer
1k views
Best way to continue stopped move (mv) by merging directories?
I have moved (mv) a pretty large directory on my NAS (Linux based), but had to interrupt the procedure. Not being a regular Linux user, I though I could just continue and merge the rest later in.
mv ...
1
vote
1answer
155 views
Switching source and destination (or undoing the mv, cp operation)
mv or cp commands both expect source and destination as arguments.
In case you want to undo the change you made, or just change the source and destination you supplied before, what is the quickest ...
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 ...
13
votes
5answers
577 views
How to remove the (1) from filenames using the find command
I recently converted all of my FLAC files to a lower sampling rate of 44.1 kHz and bit depth of 24 bits (because iPhone/iPod don't support anything above that) using XLD on my Mac OS 10.7 (Lion).
...
1
vote
2answers
1k views
Batch copying/moving files in unix?
Is there a way to batch copy/move files in unix? I thought it might be an option for cp/mv but I can't find any way to do it.
2
votes
3answers
463 views
Removing apostrophe from all file names
I tried to remove apostrophe from all files' names in the directory.
for i in *; do mv $i `echo $i | tr -d "'"`; done
After executing this command nothing is renamed.
Do you know what's wrong ...
4
votes
4answers
840 views
Recursively rename subdirectories that match a regex
I have a media server with a folder called Series. (/media/Expansion2/Series/)
In it, I have (surprise!) TV series. These are just the show names, e.g., /media/Expansion2/Series/The Big Bang Theory/
...
4
votes
3answers
414 views
For each subfolder, sort files by name and rename them to sequential padded numbers (regardless of extension)
I have the following directory structure:
.
├── event-a
│ ├── album-a
│ │ ├── a.jpg
│ │ └── x.png
│ └── album-b
│ ├── a.jpg
│ ├── x.png
│ └── y.gif
└── event-b
├── ...
3
votes
3answers
258 views
Unique file name for different files
I'm working with graphic design. I've downloaded many files (EPS files, PSD files, etc) from various websites.
Because it come from various websites, after downloaded from more than 10 different ...
1
vote
1answer
1k views
Move huge number of files into date structured directory order
I have about 1 million files in this directory: /home/username/images/
Each of the files are called something like: 012345678910(Place)_0_20120414185957_28841.jpg with the timestamp part of the ...
2
votes
1answer
152 views
Renaming a bunch of files but keeping the number part
I have a bunch of files like this:
pic100.png
pig102.png
box103a.png
superb103b.png
px103c.png
rotor110 - new.png
ready1323 (yellow car).png
motorhome1036x red circle.png
...
so, you can notice ...
19
votes
4answers
697 views
Quick way to include a directory path when calling mv?
Often I will work out of the root of a rails directory where I find my self navigating the same path twice every time I would like to move a file:
mv app/views/layouts/application.html.erb ...
2
votes
3answers
284 views
pull out a file named to ~
So I have downloaded a music album from aMule and it is located in the .aMule/Incoming directory. I tried to move it out with the following command:
mv albumName.rar ~
This left me with a file ~ ...
2
votes
2answers
860 views
UNIX move file name with sysdate
I want to make a script in Unix in which I have to move a file daily to a specific path.
In order to avoid overlapping of the file, I want the file name along with the date.
e.g. mv filename ...
3
votes
2answers
2k views
How to rename multiple files by removing the extension?
I have a number of tiff files named:
sw.001.tif
sw.002.tif
...
and I want to remove the .tif at the end of each of the files. How can I use the rename command to do this?
1
vote
2answers
449 views
Bulk rename files with numbering
How do I bulk rename multiple files named
Image401.jpg, Image402.jpg,...
to
Image 001.jpg, Image002.jpg, ... ?
2
votes
3answers
304 views
Rename a lot of files with all types of characters, with POSIX portability
Sometimes I need to rename all the files (the renaming convention follows later) in a directory where the filename is always in the form of 'filenamename.extension' (extension always exists and ...
1
vote
3answers
331 views
How to move files into newly created directory on condition in shell/perl
It was a mess of music files and directory.
It is needed to perform the below operation over multiple directories at once:
If the directory contains ".jpg" files, then create a new directory
...
0
votes
2answers
3k views
how can I rename multiple files by removing a character or string?
As a follow-up to my previous question, if I have multiple files of the form
sw.ras.001
sw.ras.002
sw.ras.003
…
What command can I use to remove the ras. in the middle of all the files?
2
votes
3answers
461 views
how can I rename multiple files by inserting a character?
I have many files of the form
sw001
sw002
sw003
...
I want to insert a period between the sw's and the number values. How can I accomplish this?
1
vote
3answers
469 views
How can we rename a file with semi-colon as part of the filename?
I tried to rename all file with extension "XLS;1" to "XLS" but it just didn't work.
I tried the following in cygwin in windows xp and they don't work:
mv *.XLS;1 *.XLS
mv *.XLS\;1 *.XLS
mv ...
4
votes
6answers
1k views
Linux script or program to shorten filenames
I haven't had much success in finding a Linux version of namemangler, which I need to rename 1000 of files so they are readable on Windows.
Does anyone know of a Linux program that can do this?
If ...