2
votes
2answers
105 views

find file, copy but with different name

I have files with random numbers in /home/user/files folder (every 4 days I have new ones). for example: john20 john25 john40 tom12 tom32 simon2 simon8 simon53 I want to take only last modified ...
3
votes
4answers
513 views

how to rename files while copying?

How would I copy (archive style where date isn't changed) all the files in a backup directory to the user's directory while renaming each file to remove the random string portion from the name (i.e., ...
1
vote
3answers
428 views

Adding timestamp to file/dir name

I am trying to write a script, that will copy file or directory with added timestamp to filename/dirname Something like: cover.jpg --> cover_18-01-2014_17:37:32.jpg directory --> ...
1
vote
2answers
112 views

Copying and renaming files to a single directory by a single shell script

I have multiple files with an example of how they look like shown below. -rw-r--r-- 1 my_user users 12 Dec 13 09:56 Example_30_001_20130913175000.DAT -rw-r--r-- 1 my_user ...
3
votes
2answers
625 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 ...
20
votes
1answer
599 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/* ...
10
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
1answer
1k views

Insert selected filename while copying in Midnight Commander

Is it possible to paste the selected filename into the copy popup, so when I hit F5 this filename will be in the 'to' section, so I can adjust it? For example: I want to copy ...
7
votes
3answers
12k views

How can you move (or copy) all files of a certain type to a directory in Unix?

I'm not very familiar with all the tricks of grep/find/awk/xargs quite yet. I have some files matching a particular pattern, say *.xxx. These files are in random places throughout a certain ...
4
votes
3answers
13k views

Copy files with renaming

I have a huge file tree. Some files have same name but in different case, e.g. 'some_code.c' and 'Some_Code.c'. So when I'm trying to copy it to NTFS/FAT filesystem it asks me about whether i'm ...