The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
2answers
120 views

Advanced file filtering

I have 3 distinct folders: history, inbox, backup. I need to copy all the files from 'history' to 'inbox', only if they are not present in 'backup'. How to do this?
3
votes
2answers
863 views

How to add/replace only modified/updated files recursively for some 2 folders?

So I currently do stuff like: rm -rf ../../../$CLOUD_INSTALL_SUBDIR/lib_boost mkdir ../../../$CLOUD_INSTALL_SUBDIR/lib_boost cp -r ../../../$BOOST_ROOT_DIR/$BOOST_INSTALL_SUBDIR/lib/* ...
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 ...
3
votes
1answer
717 views

Contiguous copy – How do I copy files contiguously?

I want to copy a number of files onto a flash drive such that each individual file is contiguous. They do not need to be contiguous with each other, and can be in any order. The files will be very ...
3
votes
0answers
60 views

How do I recursively set the date created attribute to the date modified attribute on NTFS-3G?

In my first question, I asked how to get the "Date created" field in NTFS-3G. Now, that I know I can get the "Date created", I have started adding files onto my NTFS-3G partition and would like to set ...
2
votes
3answers
2k views

Copy files from a list to a folder

I have a text file abc.txt and its contents are: /lag/cnn/org/one.txt /lag/cnn/org/two.txt /lag/cnn/org/three.txt If I use: $ tar -cvf allfiles.tar -T abc.txt I'm getting the tar of ...
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 ...
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 ...
2
votes
1answer
3k views

Copy multiple files into one (append, merge) in single invocation without shell redirection?

I'm looking for some sort of a command that I can use, to copy/append multiple files into one; but without shell redirection (I'd like to try it in call_usermodehelper, see similar issue in ...
2
votes
2answers
979 views

How to make duplicates with different names from a single file? [closed]

I want to duplicate the contents of a file. Suppose there is a file named "Hydrogen.element". I want to duplicate the contents of this file with a different name ie.make another file named ...
2
votes
2answers
9k views

How can I get the address of my local machine?

I'm on a macbook running Lion. In Terminal I'm connected to my schools server with ssh. I navigated to a folder on the server and have a file I want to copy to my local machine, but I don't know what ...
2
votes
3answers
233 views

How to copy a list of files and adjust destination filenames on the fly?

When I don't need to adjust destination filenames I can do something like this: $ find -type f -name '*.pat' -print0 | xargs -O cp -t /path/to/dest It is safe because the filenames may even ...
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 ...
2
votes
5answers
80 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.
2
votes
1answer
2k views

Can i transfer files using ssh?

I am using PuTTY on Windows 7 to ssh to my school computer lab. Can I transfer files from my windows machine to my user on the school machines using ssh?
2
votes
1answer
1k views

Finding corrupted files

I have a directory that have zillions of files. As soon as I try to copy this directory, I receive a message that a file could not be copied (corrupt ?) and the copy stops. Is there any command I ...
2
votes
2answers
630 views

Upload file over ssh and execute command on the remote machine

I am trying to find the simplest way to upload a file using ssh and after that run a command on the remote machine within the same ssh session for some post-processing, so that I don't need to login ...
2
votes
1answer
3k views

rsync all directories that start with a specific digit

I have directory loaded with thousands of sub directories: /home/tmp/ 1 12 123 1234 2345 234 3456 345 34 ...
2
votes
6answers
304 views

Copy/Move whole folder but with certain extentions

I have a backup copy of my site located in /tmp/backup and want to copy it to /home/mysite/public_html But my aim is to copy only the .php files (with nested folders) and replace. If I don't have ...
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 ...
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 ...
2
votes
2answers
66 views

How to copy a very large video file with error in it?

I have a very large video file on a USB external HDD. It is about 13GB. I can play the video directly, and it seems there's no problem. But if I try to copy the file to other places, I got a strange ...
2
votes
2answers
786 views

How to download the latest file in a folder using a scp?

I'd like to run an scp transfer to download the latest (newest) file in a certain directory to my local directory. Something like this: source: root@rimmer.sk:/home/rimmer/backups/ destination: ...
2
votes
2answers
94 views

Replicate a directory and file names n times

I have folder which has some data (files) in that with the name 201311261418 And a file 201311261418.eob In my scenario I need to replicate this folder and file names n times with the appended ...
2
votes
3answers
3k views

read only access to all files in a specific sub-folder

I have got a specific folder located in "/home/.../reboot/". I have a series of users that require read-only access to the ever changing files within. My problem is that the same users are not ...
2
votes
2answers
69 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 ...
2
votes
1answer
224 views

Find Directory and copy another directory to found directory?

I'm attempting to find a directory A that could be in a variable location and copy another directory B into the found directory. So, I'd like to find directory A, and copy Directory B into Directory ...
2
votes
2answers
605 views

How to copy a partition over network

I want to copy a Windows 7 partition that came installed on my laptop to my desktop computer. I've tried: # bzip2 -c /dev/sda5 | nc 192.168.1.1 2222 # on laptop # nc -l 2222 | bzip2 -d > ...
2
votes
2answers
229 views

Interesting Secure Copy Behavior

I'm not entirely sure where to ask this question, so if this is not the right place just let me know and I'll move it. Today I was trying to using recursive scp to copy a directory between two Linux ...
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
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
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 ...
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 ...
2
votes
2answers
156 views

RPM skipping files on install

I am installing an rpm package and it appears to be skipping certain files without giving me any notice as to what the issue is. When I execute rpm -ivh package_name.rpm the rpm provides me with ...
1
vote
2answers
7k views

faster alternative to cp -a

For a simple transfer of /home to another disk i use cp -a that seems to me an extremely slow way. Should like know a more efficient way to complete the task. I have /home mounted as logical volume, ...
1
vote
5answers
662 views

How do I disable copy permissions?

Can we set permissions, on a Linux box OR for a particular directory (Scientific Linux in my case) that, one can read files but cannot copy, move or delete them? Update: My Scenario is, We developed ...
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?
1
vote
3answers
54 views

How to copy the home directory in the home directory?

I need to make a copy of my home directory and place that copy in the same home directory. The exit code of the command must be 0. Currently, my home directory does not contain any other directories. ...
1
vote
1answer
76 views

Copy files via a complex ssh connection?

Suppose I have host A from which I ssh to host B, where I sudo -U some_role and from under it ssh to host C. My goal is an interactive shell on C. Assume that from C I cannot ssh back to A. What is ...
1
vote
2answers
303 views

Copying files based on a condition

Here's the problem I'm attempting to solve: Let's say I have a directory "A", containing some files as well as some other directories. I want to copy all the files directly under directory A to ...
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?
1
vote
2answers
822 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 ...
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* ...
1
vote
3answers
108 views

How do I iterate the list and copy the files from machineB and machineC efficiently?

I need to scp the files from machineB and machineC to machineA. I am running my below shell script from machineA. I have setup the ssh keys properly. If the files are not there in machineB, then it ...
1
vote
1answer
214 views

Copying to an external NTFS partition: slows down when I copy many files at once

I have made my peace with the fact that NTFS(-3g) on Linux will be slower than NTFS performance on Windows. I can write to my external NTFS-formatted USB 3.0 HDD at about 100+ MB/s on Windows while I ...
1
vote
2answers
48 views

Translating user id when creating image

I want to create an image (for example ext3 image) from a given directory hierarchy. This directory hierarchy is owned by a given user. But on the final image, I want the files to be owned by ...
1
vote
1answer
777 views

Need small and light stand-alone one-file ftpd server

Can somebody suggest a small one-.c-file ftpd server, so I can run it on any port and it would accept ftp upload with any l/p on that port and put a file into a folder where it runs? No config files ...
1
vote
3answers
58 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
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
3answers
269 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 --> ...