1
vote
1answer
240 views

Linux: Copy files with dates in filename between two dates

I have a folder full of files where I from time to time need to copy a subset of these to somewhere else for processing. The files have the date they were created in the filename, i.e. ...
0
votes
5answers
2k views

Moving a file using PuTTY

I am newbie struggling to move a file on a Linux VPS using PuTTY. I can log in with a user in PuTTY at this point I can navigate to see the file I wish to move ...
2
votes
2answers
80 views

Running cp -r ~/.ipython ~/some/path/.ipython a second time creates ~/some/path/.ipython/.ipython. How to prevent that?

I am using a script to copy directories to a specified location. When I run cp -r ~/.ipython ~/some/path/.ipython the .ipython dir is copied as expected to the specified location. But when I run this ...
0
votes
1answer
183 views

cp - copying and keeping different version

How to copy all .aze files that have different contents into folder3 ? The screen show what I don't want to do. What I want to get close is to have in folder 3, file1(1).aze and file1(2).aze (and ...
0
votes
2answers
2k views

Why does my Bash script display the “too many arguments” error at the cp command?

Here is my script, I get the error "line 33: [: too many arguments", I'm confused why, surely only 2 arguments are being provided to cp here? I am providing two directories to the script with no ...
1
vote
3answers
2k views

Copy multiple files via cp from a string

I'm trying to copy multiple files to a directory from within a shellscript. These files contain all sorts of "ugly" characters, such as whitespaces, brackets and what not else. However, I'm stuck when ...
2
votes
1answer
715 views

ssh Mac Unix: copy a file with special characters and spaces

I am remote logged into a Mac and trying to copy a music file from one directory to another, but I am getting an error. I think it's caused by spaces or special characters, but not sure. the file ...
5
votes
3answers
9k views

how to stop cp: overwrite './xxx' ? prompt

How can I stop the cp command from prompting to overwrite. I want to overwrite all the files with out having to keep going back to the terminal. As these are large files and take some time to ...
4
votes
2answers
8k views

Linux permissions and owner being preserved with cp

I can't understand the following behavior: I have a file named someFile under /opt/com/internal/someFile If I do ls -all /opt/com/internal/someFile the permissions are 700 user:userGroup I am root ...
12
votes
3answers
284 views

Reuse text on a bash command

If i'm writing a long command or just typing an extensive file path, is there any that i can "reuse" it with some command shortcut? e.g: 1.cp /home/myuser/really/big/file/here/and/there.png ...
7
votes
5answers
8k views

How can I copy a (big) directory over another changing only the files that differ?

I have directory a and directory b. They are big. b is almost identical to a. "almost" means that 4-5 files differ, and I don't know which they are. I want to copy b over a, but only the files that ...
2
votes
3answers
307 views

Copied directory appears to become larger at destination

I have the following code as part of a shell script: while [ $(ps -ef | awk '{print $2}' | grep -F "$CPPID") ]; do sleep 10 awk -v "usbsize=$(/bin/df | grep -F $DEVICEMOUNTPOINTQ | awk ...
9
votes
3answers
2k views

How is install -c different from cp

What is the difference between install -c and cp? Most installations tend to use install -c, but from the man page it doesn't sound like it does anything different than cp (except maybe set ...
1
vote
2answers
2k views

Find files in subdirectories and copy them to another directory with the same subdirectories?

This question is very similar to this one except that I want to maintain the file's original subdirectories. For example if I had /temp/a/a.txt /temp/a/a.jpg /temp/a/b.txt /temp/b/c.txt ...
11
votes
3answers
22k views

Copy list of files

I have a list of files separated by spaces in a file list.txt. I'd like to copy them to a new folder. I tried to do: cp `cat list.txt` new_folder but it did not work. How would you do this ? ...
3
votes
3answers
5k views

How do I use find to copy all found files to a new name in their same directories?

I've got a simple command that does almost what I want. The following will locate all files with a suffix of '_compressed.swf' and copy each into its same directory with a '.bak2' appended: find ...
5
votes
2answers
8k views

Use rsync to copy all files except for certain filenames with a certain extension

I have two same-size flash cards, and I want to copy contents of one to the other based on the following rules: I want all directories and subdirectories in place I want to exclude files of type ...