The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
2answers
2k views

Terminal command vs. GUI drag & drop when copying large no. of files: Any tangible benefit?

I'm finding myself in a terminal more and more often these days as I learn to do certain types of things quicker or more conveniently. However, when it comes to copying a large amount of data (i.e. ...
3
votes
1answer
2k 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--). ...
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 ...
3
votes
2answers
2k views

SELinux: Can I disable copying of certain files?

Please excuse me if this is too basic and you're tempted to throw an RTFM at me. I want to prevent users from copying certain files while granting them read access to the same files. I thought this ...
3
votes
2answers
77 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? ...
3
votes
2answers
126 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
991 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
105 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
784 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
65 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
190 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
163 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
5k 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
1k 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
10k 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
269 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
96 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
130 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
4k 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
713 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
6answers
326 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
48 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
397 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
71 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
1k 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
103 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
1answer
35 views

top not showing the memory usage of cat

I wanted to generate some waste file of 50 GB. so i wrote this eightnoteight@mr:~/ while true; do > cat txt >> tmp > cat tmp >> txt > done and when i ran top,watch to observe. ...
2
votes
3answers
76 views

Copy files by date/time order contained within filename?

I have a bunch of files with a pattern like this: {UID}-YYMMDD-HHMMSSMM-NEW.xml Or a real example: 56959-140918-12465122-NEW.XML I want to copy these files to another directory in date and time ...
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 ...
2
votes
1answer
268 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
654 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
234 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
49 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
73 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
303 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
215 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
158 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
8k 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
766 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
55 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
64 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
97 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
334 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
415 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
2k 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
237 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
129 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 ...