The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
2answers
72 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 ...
12
votes
2answers
613 views

Why is this binary file being changed?

I am trying to copy files over SSH, but cannot use scp due to not knowing the exact filename that I need. Although small binary files and text files transfer fine, large binary files get altered. Here ...
1
vote
2answers
45 views

How use minimum number of commands to copy all .txt files from all subdirectories to one directory?

I have more than 90 subdirectories and inside each one, there will be a number of .txt files. What I need to do is to copy all those txt files out to one single directory. How can I do that?
4
votes
2answers
284 views

How To Synchronize Directories in two different external hard disks?

I have few big folders "cosmo_sim_9", "cosmo_sim_10".... in one of my external hard disk, and a old copy of this on another external hard disk. I want to Synchronize old directories with the new ...
1
vote
2answers
2k views

Java code to copy files from one linux machine to another linux machine

I'm looking for java code to copy files to a remote linux system. I have tried Runtime.getRuntime().exec() function by passing an scp command, but each time I run the program it is asking for the ...
1
vote
3answers
59 views

How to copy-merge two directories?

I have two directories images and images2 with this structure in Linux: /images/ad /images/fe /images/foo ... and other 4000 folders and the other is like: /images2/ad /images2/fe ...
1
vote
1answer
310 views

cp --backup=numbered for folders

To backup existing files with number suffixes, I can do the following: cp --backup=numbered afile /path/to/dest But this does not apply when I try to do the same with a folder: cp -R ...
2
votes
1answer
39 views

Is there a system call to bind a file descriptor directly into another?

A read() & write() loop would probably be as good as what I'm looking for, but nevertheless is anything like that around or is it impossible because of an obstacle I didn't envisage ? I'm curious
0
votes
2answers
42 views

Copy directory not just the contents

I want to copy a directory into another directory. For example, cp -r dir1 dir2 copies the contents of dir1 into dir2. I want to copy dir1 itself into dir2 so that if I ls dir2 it will output dir1 ...
2
votes
2answers
111 views

Bash copy all files that don't match the given extensions

When I import pictures from my camera in Shotwell, it also imports the video clips. This is somewhat annoying, as I would like to store my videos in another folder. I've tried to write a bash command ...
3
votes
4answers
84 views

The most *robust* remote file copy?

How would I go about to copy files over a very unstable internet connection? Sometimes, the connection is lost, other times the IP of one machine or the other machine is changed, sometimes both, ...
0
votes
1answer
39 views

Connect psftp between Unix and Windows server

I need to transfer files from Unix to Windows server. After creating a folder in the windows server files need to be copied from Unix to Windows. I am using psftp to do this process.So, I am trying to ...
22
votes
10answers
10k views

Is there a faster alternative to cp for copying large files (~20 GB)?

I am a graduate student, and the group in which I work maintains a Linux cluster. Each node of the cluster has its own local disk, but these local disks are relatively small and are not equipped with ...
3
votes
3answers
123 views

Copy a file and overwrite the existing file

I have two images (image1.png and image2.png) in the same folder on my server, I want to run a command that overwrites image2.png to image1.png. I prefer to overwrite the image instead of deleting it ...
2
votes
1answer
60 views

rsync specific directories

Below are the directories of my directory structure. I only want to run rsync on the content under the archive directory of any subdirectory and exclude everything else: ./ ap/ ap/aploader/ ...
2
votes
1answer
37 views

rsync to copy files which has changed

I need to copy some files from a particular directory to a different location on a daily basis. I want to copy the changes only, so planning to use rsync. These files follows the following naming ...
16
votes
7answers
2k views

How do I copy multiple files by wildcard?

I have a folder with a number of files in it ABC.* (there are roughly 100 such files). I want to duplicate them all to new files with names starting with DEF.* So, I want ABC.Page1 ABC.Page2 ...
1
vote
0answers
36 views

copy files from Google drive [closed]

I've installed a terminal on my nexus tablet and would like to batch copy files from a sub-directory in Google drive to my tablet's dcim directory. how do I do this?
70
votes
9answers
44k views

SSH easily copy file to local system

If I'm logged in to a system via SSH, is there a way to copy a file back to my local system without firing up another terminal or screen session and doing scp or something similar or without doing SSH ...
4
votes
4answers
3k views

How to clone/copy all file/directory attributes onto different file/directory?

I want to copy the attributes (ownership, group, ACL, extended attributes, etc.) of one directory to another but not the directory contents itself. This does not work: cp -v --attributes-only A B ...
2
votes
5answers
81 views

How to copy 5 newest files from one directory to another and delete the old copies

How can I copy the 5 newest files from a directory to another in a "new to old" order.
1
vote
3answers
180 views

copying files with particular names to another folder

I have a folder with a lot of files. I want to copy all files which begin with of these names (separated by space): abc abd aer ab-x ate to another folder. How can I do that?
2
votes
4answers
158 views

Copy files and directory tree for filesize in specified range

Hi I would like to make a small script copying files from different directories example /pp/01 /pp/02/ etc... to another destination with the same directory design. But only those files within the ...
1
vote
0answers
116 views

Copy files to parent directory using relative pathnames [closed]

If I'm in the current working directory of oxford. How would I copy outline.doc, and place it into the sample_dir directory using relative pathnames? I've tried cp outline.doc ../outline.doc
1
vote
0answers
44 views

How to back-up files from nautilus retaining the time stamp?

I connected my android tablet (Asus fonepad7 me372cg) to laptop using usb cable. It showed up in nautilus in Ubuntu 13.04. I've to back-up the files in the tablet (specially the videos & photos) ...
11
votes
5answers
2k views

How can I copy a file and create the target directories at the same time?

I want to cp aaa/deep/sea/blob.psd to bbb/deep/sea/blob.psd How do I do the copy if the deep and sea directories don't exist under bbb so that the copy both creates the directories that are needed ...
2
votes
1answer
139 views

Copy a local file to a remote server, non-root privileges over sudo?

I'd like to do something like: scp local_file remote_server:/some_directory But in order to gain privileges to /some_directory, we need to call sudo. I know that a similar question had already been ...
6
votes
3answers
2k views

How do you compare two folders and copy the difference to a third folder?

You've got three folders: folder current, which contains your current files folder old, which contains an older version of the same files folder difference, which is just an empty folder How do ...
7
votes
5answers
522 views

copy smallest files first?

I have a large directory containing subdirectories and files that I wish to copy recursively. Is there any way to tell cp that it should perform the copy operation in order of file size, so that the ...
2
votes
3answers
89 views

how to synchronize two directory?

I want to using crontab to synchronize two directory between my linux partion and windows partion like this: 24 9 * * * cp -r /home/fan/Data /media/T/Data But it would create a directory named ...
1
vote
2answers
834 views

copy files from one path to another path in linux

I am new to linux. I am trying to copy files from one path to another path. I have a text file which has all names of files in the following pattern: file-1.txt file-2.pdf file-3.ppt .... I created ...
3
votes
2answers
67 views

Can I safely read a file that is appended to by another process?

If process A copies files to some location loc and process B regularly copies the files from loc to some other location, can B read a file that is currently in the process of being copied to loc by A? ...
0
votes
0answers
77 views

My computer beeps while copying files

Whenever I create disk activity on my memory stick, my headphones create very annoying beeps at various notes. It doesn't happen with my in built speakers, and it hasn't happened before. I'm on Ubuntu ...
2
votes
1answer
148 views

How to copy files *to* a camera?

I'd like to copy a firmware update file to my Canon 7D camera. After it was auto-mounted by thunar + thunar-volman + gvfs-gphoto2 I tried the following: $ cp eos7d-v205-win/7D000205.FIR ...
1
vote
1answer
170 views

Symlinks and permissions in backup archives

I installed linux on another computer and I want to move my /home directory to that computer. I want to backup that directory with any file permission, symlinks etc. how should I do it? Are there any ...
1
vote
0answers
82 views

Copy file if no error was encountered, else delete copied portion

I am copying a folder in Linux with plenty of files. Some of the files give me error like this: Error splicing file: Input/output error The problem is that it keeps the file in new location though ...
1
vote
1answer
127 views

cp /etc/DIR_COLORS ~/.dir_colors not responding

I'm using CentOS 6.5 and Putty. My problem is that directory file names are shown in dark blue color which is hard to read. I google searched and found this link; basically it's copying the DIR_COLORS ...
3
votes
1answer
83 views

How to move /usr from one partition to another partition safely

Linux, Debian. Now I have: /dev/sda5 on / /dev/sda6 on /home /dev/sda7 on /usr I would like to use sda6 to hold /usr, then free /dev/sda7 for other use. What is the safest way to do this? I ...
2
votes
1answer
288 views

Copy files based on date/time from subset of directories

I'm teaching a class where (~80) students are submitting assignments that I can access via webdav, organized by student in directories named by their unique identifier. The students are split into ...
3
votes
4answers
248 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., ...
3
votes
1answer
813 views

File inheriting permission of directory it is copied in?

I have files created into my home directory with only user read permission (r-- --- ---). I want to copy this file to another directory /etc/test/ which has the folder permission of 744 (rwx r-- r--). ...
0
votes
0answers
52 views

Shell script use ssh forwarding to send a file to a second system

I have ssh forwarding enabled and ssh to server A. On server A I want to run a script as root and take advantage of the ssh key being forwarded for USER to send a file to system B. I'm getting a ...
-2
votes
1answer
41 views

Copy a file into another directory's inside [closed]

I want to copy positionXYZ into another directory's inside I want both of them.I put: Tutorials myname $ cp -r positionXYZ Documents/Gerris\ Programs/Tutorials/tutorial6/ Then it says : cp: ...
1
vote
1answer
97 views

Will files created under source directory after running `cp` be copied?

Suppose I use cp to copy a directory to another place. If the process takes long, and I create a new file under the source directory, will it be copied, or does it depend on something?
1
vote
1answer
131 views

How to copy files within a remote server?

I would like to copy files in an remote server from one directory (in the remote server) to another (also in the same remote server). I tried this: scp -r myacc@remote.server:/folder_a/*myfiles* ...
0
votes
2answers
73 views

Can I copy a folder with a progress bar? [duplicate]

I want to copy a folder with some kind of progress bar. I tried "pv" (Pipe Viewer) but it seems there is no way to copy a folder. Actually I'm not interested in using a script for pv - I would ...
1
vote
3answers
270 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
votes
1answer
36 views

How can I set up a job to copy a directory, not overwriting existing files? [closed]

How can I create a job that copies the Directory /media/hdd/docs to the Windows share \192.168.1.3\Docs each night at 23:00, not overwriting existing files. The Windows share is shared to "Everyone" ...
6
votes
2answers
71 views

What is the best way to synchronize files to a VFAT partition?

POSIX filenames may contain all characters except /, but some filesystems reserve characters like ?<>\\:*|". Using pax, I can copy files while replacing these reserved characters: $ pax -rw -s ...
8
votes
2answers
3k views

Why is my PC freezing while I'm copying a file to a pendrive?

I have a really strange situation here. My PC works fine, at least in most cases, but there's one thing that I can't deal with. When I try to copy a file from my pendrive, everything is ok -- I got ...