Questions tagged [file-copy]

Questions regarding copying files from one place to another

Filter by
Sorted by
Tagged with
1
vote
0answers
11 views

Why two folders with the same contents have different sizes? [duplicate]

I just created a copy of my music library, let's call it music_backup, and also have the original folder, called music. The backup folder was created using the trusted rsync, so no weird tools ...
10
votes
5answers
1k views

Moving millions of files to a different directory with specfic name patterns

I have millions of files with the following nomenclature on a Linux machine: 1559704165_a1ac6f55fef555ee.jpg The first 10 digits are timestamp and the ones followed by a _ are specific ids. I want ...
3
votes
4answers
258 views

gzip compress a local folder and extract it to remote server

I am new to these commands. I am trying to gzip a local folder and unzip the same on the remote server. The thing is, gzipping and unzip must happen on the fly. I tried many and one of the closest I ...
0
votes
1answer
37 views

copy paste from debian buster doesn't work on MS-Windows 10

I have been working on a computer which apparently has Debian buster as well as MS-Windows 10 1903 . On the said machine before you could copy and paste files and folders without an issue. In some ...
1
vote
1answer
21 views

Rsync stuck in D state

I'm moving about 1 TB data from an EBS mounted on my EC2 to another EFS mounted on the same instance. I've been able to copy about 840 GB of data using rsync within the past 2 weeks or so. Now when I'...
0
votes
1answer
28 views

copy-merge several folders contents, prioritizing newer files

I have few folders like this with their contents data/ -2011/ ---images/ ------logo.jpg ------banner.jpg ---reports/ ------monthly.pdf -2012/ ---images/ ------logo.jpg ---reports/ ------monthly.pdf -...
10
votes
2answers
2k views

Why are there no file insertion syscalls

To my understanding, for manipulating files there is only the sys_write syscall in Linux, which overwrites the file content (or extends it, if at the end). Why are there no syscalls for inserting or ...
0
votes
1answer
56 views

cp command saying directory does not exist when it does [duplicate]

I'm writing a bash script and in it I'm doing something like the following: #!/bin/sh read -p "Enter target directory: " target_dir cp some/file.txt $target_dir/exists/for/sure/ When I run this ...
0
votes
5answers
87 views

Special “copy and rename” case

I have a deeply nested folder structure in which there are hundreds of files called data.log. I need a script to rename each of these data.log files according to the name of the parent folder they are ...
4
votes
1answer
85 views

Move/copy millions of images from Macos to external drive to ubuntu server

I have created a dataset of millions (>15M, so far) of images for a machine-learning project, taking up over 500GB of storage. I created them on my Macbook Pro but want to get them to our DGX1 (GPU ...
0
votes
0answers
9 views

Can the USB subsystem copy only one file at a time?

Xubuntu 18.04 up-to-date $ uname -a Linux haggis 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux In one session, I'm copying a lot of files from a LV with ...
2
votes
1answer
41 views

How to write a script to move files with a specific name from folder “A” to folder “B” in my Google drive?

How can I write a script that moves files with a certain name from a certain folder to another certain folder in my Google drive? Example: I have a folder named 'A' with three files named 'X', 'Y', ...
0
votes
2answers
60 views

Copying files based on partial names in a file

I have millions of xml files in a folder. The name of the files follow a specific pattern: ABC_20190101011030931_6049414.xml In this I am interested only in the last set of digits before xml ...
5
votes
1answer
494 views

systemd and copy (/bin/cp): no such file or directory

While manually copying the file the following works, as below: userx@x:~$ cp -rv /opt/test-bak/* /opt/test/ '/opt/test-bak/file1' -> '/opt/test/file1' '/opt/test-bak/file2' -> '/opt/test/file2' ...
0
votes
1answer
42 views

Copy files from folders and sub folders without preserving directory structure

I have a folder(A) which is structured like this Main Directory(A) | | Subdir------Subdir2-----Subdir3 | | | | | |...
0
votes
1answer
144 views

Finding files and copy with folder structure intact

I am searching files who have either been created or modified for the last 60 minuts. I find these via find ~/data/ -cmin -60 -mmin -60 -type f ~ the home directory /usr/wg/ After that I want to ...
0
votes
2answers
44 views

Copy folder to multiple (similar) locations simultaneously

I have around 90 websites I need a plugin installed on (wordpress) and I was wondering if there's a way to copy the plugin folder to all of them in a single run (i.e., simultaneously / in parallel).  ...
5
votes
1answer
250 views

In what order does sftp fetch files when using “get -r folder”?

I'm doing a file transfer using sftp. Using the get -r folder command, I'm surprised about the order that the program is downloading the content. It looks like it would be selecting the files it ...
2
votes
4answers
293 views

How to copy the rest of lines of a file to another file [duplicate]

I have the string xyz which is a line in file1.txt, I want to copy all the lines after xyz in file1.txt to a new file file2.txt. How can I achieve this? I know about cat command. But how to specify ...
0
votes
3answers
85 views

How to copy an image from one directory to another in unix?

Okay so for a research project, I am charged with working on a digital video game that happens to be formed by the use of Unix and emacs (don't know if they are the same thing because I just started ...
0
votes
1answer
34 views

Copy or move large file with transient name till the file is completely transfered to destination in linux

I am trying to copy/move a large file (15 GB) to a directory in Linux and want to have a dependency on that event. Now lets say I have a file named abc.txt, and I am running below command: mv /usr/...
0
votes
1answer
51 views

How to resolve btrfs errors? copying from btrfs to another partition?

I had a working system that was running out of space. So I added space to the end of the disk. Boot from gparted ISO launched gparted moved partition 3 of 3 to the right. Went to resize partition ...
1
vote
2answers
21 views

Get filepath of every file that's copied from one folder to another

I am using Ubuntu 18.04 LTS and I wish to copy files from one folder to another and along with it also wish to store the filepath of each file that's being copied from folder1 to folder2 in a third ...
0
votes
0answers
36 views

Linux | Copy open files to a different directory and keep them Synchronized

I want to copy files while they are in use by an application to a separate directory on my Ubuntu system. These files in the source directory should be in continuous synchronization with their copies ...
5
votes
1answer
494 views

What happens when you rsync without a destination path? [duplicate]

I copied a file to destination without providing the path. It seems to have copied successfully, but i cant find the file in the destination, where could it be located? rsync -av --progress file.txt ...
0
votes
3answers
71 views

Copy a file in a destination folder

I have a file in a very long path, for example: /opt/very/long/path/file1 I want to copy the file in this directory: cp /opt/very/long/path/file1 /opt/very/long/path/file2 I don't want repeat this ...
0
votes
3answers
87 views

How to find the first X gb of data?

I've been trying to find a way to free up some space on a drive by moving folders to another. I have a folder full of stuff I can move, doesn't need to be all of it, to free up some space. In Windows ...
1
vote
2answers
106 views

Find and copy with exec not working

I'm using the following command to get the most recent file in a directory /usr/bin/find /home/user1/folder1/ -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" " | cut -f5 -d"/" This ...
1
vote
0answers
34 views

Open USB off specific port in linux

I am using a raspberry PI. I want to create a USB bridge, meaning I can transfer the files from one USB to another automatically. My problem is finding the specific USB I want to take the files from,...
0
votes
2answers
555 views

How should I merge two folders on the same filesystem?

I have two directories that look something like the following but with many more files. folder1/pic1.png folder1/test/readme.txt folder2/guest.html folder2/backup/notes.txt I want to "merge" these ...
0
votes
0answers
67 views

Did this dd command run too fast? [duplicate]

Usually people want to speed dd up but I want to slow it down, because I think there is something fishy going on with its speed. sudo dd if=hannah-montana-linux-amd64.iso of=/dev/sdb1 bs=512k 5988+...
2
votes
1answer
272 views

rsync keeps previous partial file when resuming

I often transfer large files from a remote server using rsync with the following command : rsync -rvhm \ --progress \ --size-only \ --stats \ --partial-dir=.rsync-partial \ "user@...
2
votes
4answers
98 views

Is there a linux command to copy a file to multiple other files based on the filename? [closed]

Is there a Linux command to copy a_b_c_d.jpg into a.jpg, b.jpg, c.jpg, and d.jpg so that each file is a copy of the original? It should extract the name from the original name, separated by _ and ...
-1
votes
1answer
49 views

How to externally copy an old UFS hard drive?

Here at work our machines are required to run off of old Sun Sparc5's (1995) all running a UFS architecture on the hard drives due to a Solaris 5.3ish base. The way they are configured it is not ...
0
votes
2answers
98 views

Methods to copy a file or a folder one linux server to another linux server [closed]

What is the most accurate way to copy a file or a folder from one linux machine to another using commands?
1
vote
0answers
34 views

xclip copy file so it can be pasted as a file (not file content) [duplicate]

How can I copy a file with xclip, so that it is pastable as a file in file explorers? I searched on google an so on and found stuff like this Copy file to xclip and paste to Firefox, but there it is ...
0
votes
1answer
669 views

Only copy files from a particular date from s3 storage

I would like to only copy files from S3 that are from today out of a certain bucket with 100s of files. I tried the following: $ aws s3 ls s3://cve-etherwan/ --recursive --region=us-west-2 | grep ...
0
votes
2answers
33 views

How to copy all files in all directories with specific filename to one destination?

Let's assume that I have these files: /1/tEst.mp4 /1/Test.mP4 /1/subdirectory/TEST2.mp4 /1/.20181106Test2.mp4 How can I copy all of these files into /2/Videos with a single command line? All files ...
0
votes
1answer
57 views

On copying, which is considered: actual or apparent size?

I was wondering if I have a file that has apparent size of 1 GiB but actual size of 0 B can get copied to, for example, a USB flash stick with 512 kiB free space? You can create a file as such using: ...
0
votes
1answer
2k views

Copying a file from ROOT to home directory

I am trying to copy a file from Root directory over to my home directory. I had to execute the extraction of a file as ROOT user. I can see it is extracted into root directory but I now want to access ...
1
vote
2answers
272 views

rsync thinks the source host is a command

So I was trying to download a file from a remote host connected with SSH to a local folder on my Mac using rsync. The command I used is: $ rsync --progress -avz -e "ssh root@1.2.3.4 -i ~/.ssh/keyFile"...
13
votes
2answers
846 views

Timestamps of files copied to USB drive

I have a problem with the timestamps of files copied from my PC or laptop to USB drives: the last modification time of the original file and that of the copied file are different. Therefore, ...
1
vote
1answer
124 views

How to manage to read files unreadable due to bad sectors?

I am having ext3 filesystem, and recent Linux distribution. I need to copy (read) a file(s) over to a new destination. Unfortunately cp / mv or MC (Midnight Commander) stop / fail at certain point ...
1
vote
1answer
536 views

Makefile: Copy using make variables --> error; Not so without variables!

In the following makefile InputLocation:=./Test OutputLocation:=$(InputLocation)/Output Input:=$(wildcard $(InputLocation)/*.md) Output:=$(patsubst $(InputLocation)/%, $(OutputLocation)/%, $(Input:...
1
vote
0answers
31 views

how to move files based on birth time in hadoop [closed]

I have some 200k files in a folder, i want to organize them based on time of birth(creation time). i wrote the below script but it is way too slow. i want to improve it. how can i do it? #!/usr/bin/...
0
votes
1answer
1k views

How to copy files with grub console?

I have a notebook which can't boot up Ubuntu and I want to copy all of the files to an external hard drive with USB connection to save them. After I want to install a new Ubuntu to the notebook, how ...
1
vote
1answer
13k views

cp: cannot create regular file: Permission denied

I am running a PHP script on my Apache server and from the script I need to copy some files (to run a Bash script that copies files). I can copy to a directory /tmp with no problems, but when I want ...
22
votes
2answers
2k views

What happens when I kill 'cp'? Is it safe and does it have any consequences?

What are the consequences for a ext4 filesystem when I terminate a copying cp command by typing Ctrl + C while it is running? Does the filesystem get corrupted? Is the partition's space occupied by ...
0
votes
1answer
45 views

How to overwrite a file with shell script without using extra device space?

I'm trying to overwrite a file using: cp source.txt target.txt But I get "No space left on device". I also tried using dd with no success, even with super user. How can I overwrite using only the ...
-1
votes
1answer
72 views

How copy files from file-name list and unconditional keep existing file in destination?

How copy files from file-name list and unconditional keep existing file in destination? Note cpio is overwrite older existing files by default: $ dpkg -L libgcc1 libstdc++6 |grep -e '^/lib/' -e '^/...