Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [move]

The tag has no usage guidance.

1
vote
0answers
13 views

Move (mv) file that starts with a hyphen (-) [duplicate]

I have a file called -my-file-name.txt. I'm trying to move it using the mv command, however it fails because the hyphen in the name is acting like an option. mv -my-file-name.txt /some/new/folder ...
3
votes
1answer
54 views

Find files then move them and rename them at the same time?

Currently I use three steps to gzip some static assets and then use s3cmd to an S3 bucket (technically it's a Digital Ocean Spaces bucket). Here's what I do: $ find . -type f -name '*.css' | xargs -I{...
0
votes
1answer
38 views

Move Files Recursively but only if they are not open by another process

I want to modify the script text below, to change the file permissions, owner and move it, only if the file is not open by another process. cd /mnt/usbdrive/DVR sudo chown 777 -R /mnt/usbdrive sudo ...
0
votes
4answers
174 views

Recursively moving contents of directory

I wanted to recursively move files from a folder (Pictures) to another (Picturesnew). The "Pictures" Folder had many subfolders and and hence I used this command after following up the posts here. ...
1
vote
2answers
43 views

How to recursively move one file type but only when another file type is also present?

In my directory tree, some subfolders contain both *.flac and *.mp3 files, but other subfolders contain only *.mp3 files. I'd like to move all of the *.mp3 files to another destination (a different ...
0
votes
1answer
33 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
45 views

How to move physical disks content (rsnapshot content in there) to another physical disk?

Situation: simple linux system, with external removable usb media (rdx), single primary partition with ext4 filesystem on them for backups. Using some external usb disk media (rdx disks) for ...
0
votes
2answers
29 views

Move contents of all sub subdirectories up into just their subdirectories

The problem I am facing is that I have a directory that contains thousands of subdirectories, each of those subdirectories contain more subdirectories, and inside of all of those are images. What I ...
0
votes
0answers
17 views

Batch moving a custom set of images with Ranger? [duplicate]

This is a question for the Ranger (file manager) Let's say that I have a directory with five files.. for i in $(seq 1 5); do touch "$i.jpg"; done; mkdir subdir How would I move 1.jpg, and 4.jpg, ...
0
votes
2answers
43 views

Moving A Specified Number Of Files From One Directory To Another in Linux Redhat [closed]

Does anyone actually know how to move X files at a time from one directory to another? Every 'example' on this page displays an error and is useless. I can only move fifty (50) files at a time, then '...
0
votes
1answer
321 views

Moving file with wildcard and add timestamp to the file name

I need to move a file to an archive folder, and add a timestamp in front of the file name. mv /dev/DataStage/myProject/source/TEST/MyFile_*.csv /dev/DataStage/myProject/Archive/TEST/MyFile_*.csv ...
1
vote
3answers
57 views

Moving folders with a specific keyword in the name to a new folder

I want to move all my FLAC music folders to a new folder called lossless. Currently the FLAC folders are inside a folder with lossy formats such as MP3 and AAC. I want to filter the folders with "...
1
vote
1answer
142 views

Move directory structure and preserve symlinks [duplicate]

I'm trying to work around a makefile issue where libraries are installed in the wrong place. Someone else wrote the makefile and it is not easy to fix. I'm trying to move the libraries after they have ...
0
votes
2answers
2k views

move multiple directories in one directory - recursively

I have a directory which contains multiple directories including subdirectories too. I want to move some of them to a single one at the same time (with one command) Example Main Directory Sub1 ...
0
votes
1answer
123 views

Find from a file list of and move in Unix

I have a list file with names of files, i want read one file name from the list at a time and look for it under a directory structure with multiple sub folders and then once found move it into a diff ...
1
vote
2answers
94 views

Unix: it there a way to make a file writable, but not deletable nor movable nor copyable?

We have some "living documents", which are accessed by multiple peaple. Is there a way in unix to make a file only readable and writeable, but not moveable nor copyable nor deleteable? The purpose of ...
0
votes
2answers
569 views

Move all files with matching prefixes to folder based on a csv list

I have thousands of files with various prefixes, and those prefixes are grouped in a csv list. Now I want to move all of them to their folder according to their list. For instance: file A1B1C1_{...}....
0
votes
1answer
83 views

Find directories by file extension and copying/moving somewherelse [closed]

I want to search by file extension and by texts and then copy a binary file inside the same folder. For instance, I am in directory A and finally like to copy all *.gdx files (in B,C,D) to somewhere. ...
1
vote
1answer
32 views

How do I replace a folder with its only subfolder of the same name in CLI?

Suppose that I have only the following in ~/foo: . .. foo With file managers if I cut the subfolder foo and paste it into ~ it automatically replaces the contents of ~/foo with that of ~/foo/foo. ...
1
vote
2answers
114 views

How to move the files to new directory based on names in text file?

I have tar.gz files like below in a directory df: A.tar.gz B.tar.gz C.tar.gz D.tar.gz E.tar.gz F.tar.gz G.tar.gz I also have text file move.txt with following columns information: ID Status ...
0
votes
2answers
60 views

Move files containing Brackets and Year eg (1999)

I want to selectivly move all files that are movies with the year at the end of the filename. I have a program that renames movies and fixes the format which always uses Moviename (YEAR).extension ...
0
votes
2answers
31 views

What's a convenient way to move files and subdirs “up a subdir” with possible name clash?

I've some files and directories within the directory /var/foo/bar/baz. Now, I want to move all of them up into /var/foo/bar, and get rid of baz. Easy, right? cd /var/foo/bar mv baz/* . rmdir baz (I'...
0
votes
2answers
2k views

Move all .txt files into one directory [duplicate]

I have almost 6000 directories with thousands of files: all/recup_dir.1/1.txt all/recup_dir.1/2.jpg ... all/recup_dir.5987/1.txt all/recup_dir.5987/2.txt ... and I want to move all .txt files in the ...
2
votes
3answers
111 views

Moving files to directories named after the first 6 digits in the file name

I've got thousands of raw photos (.nef) and relative settings (same filename but .xmp extension) in a single directory on a QNAP nas. My goal is to automate the creation of subdirs named like yyyy-mm ...
1
vote
2answers
37 views

copying files recursively without preserving directories

I have a bunch of directories that contain MP3 files inside. These directories contain no other directories inside. How do I delete all directory structure without deleting the files? That would be ...
4
votes
5answers
288 views

Move folder structure across multiple directories [duplicate]

I am trying to move one a bunch of files at once, one directory up. This is what I tried, but did not work: mv ./*/__test__/index.js ./*/data.js . ├── alpha │ ├── __test__ │ │ └── index.js │...
-1
votes
2answers
1k views

Need to loop through folder and move files to different directory? [closed]

I have a bunch of files in sub-directories that I want to move to a different directory. The directories are organized in one parent directory like this: Apr1995 Apr1996 Aug1995 etc... (month then ...
0
votes
2answers
77 views

Bash Image Processing

All, OK! Trying to move image file to central images folder. Here is my script: img_dir='/home/filies/images/' img_fil='/home/files/img_dump.txt' i='0' while read -r fline do fpath=$(dirname "$...
-2
votes
2answers
2k views

Bash command to create a folder and move specific files into it

I am trying to achieve this using bash I have a directory of files, a sample to get the picture is below: January 2010 MA - C3 Edexcel.pdf January 2010 MS - C3 Edexcel.pdf January 2010 QP - C3 ...
4
votes
1answer
230 views

Moving millions of small files results in “out of space” error

I't trying to move around 4.5 million files (size ranges from 100 - 1000 bytes) from one partition to other. The total size of the folder is ~2.4 GB First I tried to zip it and move the zipped file ...
2
votes
2answers
499 views

find + xargs - copy/move files from one subdir to another

My folder structure is like this: /volume1 /photoTest /folderA /@eaDir /eaDir_tmp /folderB /@eaDir /eaDir_tmp /folder with space /@eaDir /eaDir_tmp ...
16
votes
1answer
1k views

Approximating atomic move across file systems?

I have to move some files from one filesystem to another under Ubuntu. However, it is very important that the files never exist as partial or incomplete files at the destination, at least not under ...
-2
votes
1answer
56 views

I can copy file but can not move it from my Mac Terminal [closed]

I can copy file but can not move it on my Mac Terminal. I want to execute following command: mv /apps/gfss/ipt/files/R2R/Japan_WHT/21940000/DATA.xlsx /apps/gfss/ipt/files/R2R/Japan_WHT/21940000/...
0
votes
1answer
92 views

How to move many different sub folders one level down?

I have a LARGE amount of files in the following structure all files in /base/, then 4 folders with 2 "random" letters, and then a series of files related to each other. Example: /base/ab/12/13/37/...
0
votes
3answers
1k views

how to move files with multiple patterns to specific directory, bash?

Need move files with multiple, defined patterns, like: Z_*ana_bwk_na_N*.png Z_*ana_bwk_dwda*.png Z_*ana_bwkman_dwdna* Z_*ana_bwkman_dwdc* Z_*EDZW*_nwv01*_p00_na_N*WV11.png Z_*EDZW*_nwv01*_p00_nh_N*...
0
votes
1answer
543 views

Is there a command for secure move equivalent to scp and srm?

I'm looking for a command that allows me to securely move a file or directory. If it doesn't exist, is my only option to write a shell script that securely copies the item to the destination ...
0
votes
1answer
36 views

find command also includes the current dir in the result which is not required to be moved

I am trying to write a script where I can find files larger than a certain size and then move them to another dir but the find command also includes the current dir in the result which is not required ...
1
vote
2answers
83 views

If foldername equals “somestring”, move all files in the folder one level up

Due to an old backup concept I have some hard drives here, that contain file structures like: /1.1 /2.1 /3.1 /FOLDER.DUPLICATE.$DRIVEBENDER/1.1 /FOLDER.DUPLICATE.$DRIVEBENDER/3.1 /FOLDER.DUPLICATE.$...
2
votes
3answers
1k views

Why can I not hardlink to a file I don't own even though I can move it?

Example script: #!/bin/sh -e sudo useradd -m user_a sudo useradd -m user_b -g user_a sudo chmod g+w /home/user_a set +e sudo su user_a <<EOF cd umask 027 >> file_a >> file_b >&...
0
votes
3answers
326 views

replace everything and move word to end position

maybe my question should answered in two ways but I hope it could be done with in one "sed": I have the following lines, with different IDs: ID1_TRINITY_DN120587_c0_g1::TRINITY_DN120587_c0_g1_i1::...
0
votes
0answers
64 views

How to move files to a folder per day

I have a folder that contains a lot of photos. I'd like to move them on a more practictal structure, with a folder per day. The date is extracted from the filename (e.g. ...
9
votes
1answer
6k views

How can I move all `marked` files to another directory in ranger?

When I select multiple files within ranger (using <Space> or V), how do I move these selected files to another directory? I've tried to use dd and pp, but this only moves the file that's ...
0
votes
1answer
134 views

rsync - update sync list while rsync is running

I have a large compute job running on a remote machine that generates ~40 data files every ~20 minutes. I would like to pull the generated files from the remote machine to my local machine as soon as ...
-1
votes
1answer
495 views

Shell script to move files and rename it with index [closed]

Consider two directories A and B. A contains a text file A.txt which changes its contents every 3 seconds. The shell script is to move A.txt to directory B and rename it to A_1.txt. After 3 seconds ...
1
vote
1answer
20 views

Unable to free drive under Linux

I have 8K remained on one of my drives: > df ... /dev/sdb1 3845577736 385295296 3264915224 11% /NAS/data /dev/sdc1 3845577736 3650210512 8 100% /NAS/media I take big folder ...
1
vote
2answers
392 views

Can't overwrite a file by moving another over it

I have file /some/foo which is a plain text file. I can edit it with vim and I can cat something else to it. But whenever I try to automate the editing process with sed, it says sed: cannot move '/...
1
vote
0answers
166 views

How can I copy/move the same x files from one directory to another?

I have multiple directories with a few thousand files each. Each directory contains files with the same names, but with different extensions. I would like to move x files each from these sets of ...
1
vote
2answers
105 views

Change permission of folder based on list.txt

I have 3 massive folders containing lots of other folders that I need to give access to a third party for downloading via SFTP. At the moment every folder in the main directory is set for download ...
0
votes
1answer
44 views

Are there any shortcuts to jump up/down directly across the manually-typed lines of a bash terminal?

Consider that we write on terminal cat file0.csv, and then get 1000 lines of code. After that, we write cat file1.csv and then we get other 1000 lines of code. And so forth till cat file5.csv. ...
36
votes
4answers
9k views

Wrong mv command. Where did my files go? [duplicate]

I used the command mv folder_name .... I thought by using .. twice, it would move it back two folders. Unfortunately my files disappeared. I need to recover them.