Questions tagged [file-copy]

Questions regarding copying files from one place to another

Filter by
Sorted by
Tagged with
0
votes
1answer
36 views

How could I write the total number of files copied to a variable?

I've used: sed -n '/.*/=' With the copy command to count the files copied but can't figure out how to get the count total into a variable.
0
votes
1answer
42 views

Moving a file from local drive to a remote machine

I'd like to move a folder that contains multiple files within it from my local folder to a ssh user@xxx.xxx.xx.xx machine's temp drive. What would be the best method in doing this? Thanks for your ...
0
votes
1answer
18 views

rsync recursively copy files downstream of subdirectories matching pattern

I am a novice to rsynch and have a rather deep directory looking something like this: source | +--foo | | | +--bar1 | | | | | +--bla (more dirs down the line) | +--bar2 ...
0
votes
1answer
72 views

smbclient copy from linux to windows (SMB)

Want to copy directory from linux machine to windows (SMB) with shell script. [user@host home]$ smbclient -W WORKGROUP --user='admin%admin$123' -c "put /data/directory" "//192.168.1.1/share" Domain=[...
0
votes
1answer
14 views

get number files and folders under a given folder [duplicate]

in Microsoft Windows you can right click on a folder for Properties and it will report Contains # files and # folders Is there a way to do this in linux on the command line? I want to know the total ...
0
votes
1answer
30 views

Automate copying between same places of similar directory trees

I am maintaining large filesystem tree on two machines and ofter need to copy one or few files from one to another. Is it possible to automate copying between same places of two trees and void need ...
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
2k 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
324 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
46 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
42 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
31 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
94 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
88 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
88 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
43 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
113 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
558 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
43 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
219 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
45 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
284 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
352 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
110 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
37 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
59 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
503 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
90 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
94 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
117 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
35 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
632 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
81 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
279 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
99 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
53 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
103 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
40 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
845 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
58 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
282 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
899 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
135 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
636 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:...