2
votes
2answers
67 views

How to rename filename with ' or ? in file name?

I have a problem renaming a file that I'm not even sure which special characters I have in the file. I'm using CentOS 6 64bit. When I ls the file: Giko Suzo San?e - Ep1.avi but when view it in ...
12
votes
6answers
631 views

Subtract 1 from all file names (rename them) in a directory.

I have a directory which contains image files with names like image1.jpg image2.jpg image3.jpg ... Unfortunately, the image names must be zero based, so image1.jpg should be image0.jpg, ...
3
votes
7answers
387 views

Batch renaming of files [duplicate]

I have a directory full of images: DSCN4749.JPG DSCN4750.JPG DSCN4892.JPG ... And I would like a one-liner to rename them to (say). dscn4749.jpg dscn4750.jpg dscn4892.jpg ... How do I do this? ...
2
votes
1answer
128 views

Merging folders with practically the same name but different casing

When digging around in the advanced settings in Dropbox I lost a folder. I only discovered this about a month later. I managed to get this folder back from Dropbox however the file structure of the ...
3
votes
2answers
425 views

Automatically moving files to a directory, one by one, and only when the target folder is empty

Is it possible? And in reverse alphabetical order? Essentially, this: How can I move files by type recursively from a directory and its sub-directories to another directory? Except that each file is ...
7
votes
3answers
290 views

cp or mv files to same directory they are already in when I am in another?

If I am in ~/blob and I have a file in ~/blob/a_long_directory_name/c/x.x I can type mv blob/a_long_directory_name/c/x.x blob/a_long_directory_name/even_more/y.y Is there any shortcut whereby I ...
1
vote
4answers
449 views

How to remove URI encoding in file names

I realise this might be quite a simple question, but I'm still quite new to the command line and only have a grasp of basic commands. I've downloaded some lecture presentations (~25 or so) from my ...
1
vote
2answers
124 views

How to strip directory structure with command line (or script)

I have a large collection of files packed into a two-level directory structure with many, many, many folders. In other words, I have a folder with a great many subfolders in it. There are no ...
1
vote
1answer
38 views

Can one move a relpath in one command?

This question is similar to one I asked recently, but the answers to that question, for the most part, do not extend to this one, AFAICT. The main difference between the two questions is that the ...
3
votes
2answers
677 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 ...
9
votes
1answer
3k 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
2answers
3k 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
1k 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 ...
3
votes
3answers
405 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 ...
8
votes
3answers
2k 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 ...
3
votes
2answers
488 views

Move with possible rename

Is it possible to construct a command that will move the file to another directory and if the same file is already there, generate some random string that is not in the name of some file in the ...
8
votes
2answers
1k views

mv a file without breaking a symlink to that file

Is it possible to mv a file w/out breaking a symbolic link to that file? My initial response to this is no, and I'm working out a script based solution to change the links immediately following the ...
3
votes
1answer
319 views

Multiple renaming files [duplicate]

Possible Duplicate: How to clean up file extensions? I'd like to rename files with extension .flac.mp3 to extension .mp3. I used the following command $ for i in *; do mv $i `echo $i | sed ...
25
votes
6answers
42k views

How to overwrite target files with mv?

I have a ton of files and dirs in a subdirectory I want to move to the parent directory. There are already some files and dirs in the target directory which need to be overwritten. Files that are only ...
2
votes
3answers
518 views

Selective recursive move?

Is there a command like mv --preserve-structure src src/1 src/2/3 dst which creates dst/1 and dst/2/3? It should work similar to mv src/* dst, but move only the subtrees listed.
9
votes
3answers
742 views

Lowercasing all directories under a directory

I want to lowercase every directories' name under a directory. With which commands can I do that?
9
votes
7answers
5k views

How do you bulk move files up one directory safely?

How can I move files up a directory where there might be hundreds or thousands of files in the directory, and you might not be sure about whether there are dupes in ... What method would you use? How ...
35
votes
5answers
12k views

How can I move files and view the progress (e.g. with a progress bar)?

When moving large directories using mv, is there a way to view the progress (%)? The cp command on gentoo had a -g switch that showed the progress.
6
votes
1answer
2k views

Command-line mv exclusion list

Is there a way to mv,cp, or any file operation such that I could specify all the files I don't want affected? For example, say I have a folder with the files file1, file2, and file3, and I want to ...
8
votes
3answers
7k views

How can I move files by type recursively from a directory and its sub-directories to another directory?

What would be a good way to move a file type from a directory and all of its sub-directories? Like "move all *.ogg in /thisdir recursively to /somedir". I tried a couple of things; my best effort was ...