Tagged Questions
20
votes
1answer
578 views
How to move a directory, file by file? (instead of “copy then remove”)
My computer has one 500GB drive.
I want to move 400GB of data from /unencrypted to /encrypted.
Both directories are on the same partition, but /encrypted is handled by ecryptfs, so mv /uncrypted/* ...
6
votes
4answers
1k views
Bash script to rename files from a text file source
I'm fairly new to bash; I can just about perform simple administrative tasks with simple commands 1 at a time. However, I've been tasked with renaming some files in a directory using a text file as ...
4
votes
6answers
3k 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 ...
4
votes
2answers
146 views
Faster way to rename duplicate files (identified by fdupes) in another directory?
I have a directory full of pdf files of journal articles, most of which are named by their bibtex key. Some time ago I made a backup on an external hard drive, but I haven't kept it up to date and ...
3
votes
3answers
302 views
Shell Script to move folders containing a specific word
I'm searching for an simple shell script to mv all folders in /var/www/uploads/ that containing Math or Physics in the name to /mnt/Backup/.
I've never done something like that before, due to the ...
3
votes
2answers
471 views
How to copy multiple files but keep their extensions the same?
I am looping through a number of files, and $file represents the current file.
How can I make copies or renames and keep the extension the same for this current file?
e.g. if $file = x.jpg
How to ...
3
votes
2answers
39 views
Overriding amended time stamps
I need to make it so the files in current directory get amended with a timestamp. It works fine for the first time, but once I run it again it adds another timestamp to the file. I need a way to ...
2
votes
3answers
420 views
Batch File Rename Using Mapping File
I have a large collection of image files, for example:
a.png, b.png, c.png, etc
If I have a file with mappings of filenames to numbers, like so (ignore the format, it could be anything):
a=>1
...
2
votes
3answers
694 views
Replace filename with parent folder name
I have a bunch of files each in their own subdirectory. I need to write a script to rename each file to have the same name as its directory: For example, given:
./1111/1234.pdf
./2222/2345.pdf
...
2
votes
1answer
1k views
Create sub-directories and organize files by date
I have some directories of files copied from my security camera that I would like to organize into sub-directories by file date. So for example;
-rwxrwxrwx 0 root root 4935241 Jul 19 2012 ...
2
votes
1answer
55 views
Renaming the files and move to other path
I need to rename the files given below and move to some other path
1234551abcde20140718023216001.txt.809047512.2014_07_07_13:47:44
000001abcde20140718023216001.txt.34568.001.2014_07_07_13:50:44
...
1
vote
4answers
218 views
renaming multiple files increment order
I have the following files
SSt12.precip.374.sub.climatology.ctl
SSt12.precip.2874.sub.climatology.ctl
SSt12.precip.3764.sub.climatology.ctl
SSt12.precip.6774.sub.climatology.ctl
I want to rename ...
1
vote
1answer
63 views
How do I rename lots of files on a directory without changing their extensions? [duplicate]
I have a problem! I have a bunch of image files with extensions. Jpg and. Png. I wrote a script that renames the files, changing their names in a pattern followed by a number like this:
...
...