Questions tagged [move]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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.
21
votes
2answers
2k views

How do I move all files output from a command?

I have this grep command to find files without the word Attachments in them. grep -L -- Attachments * I want to move all the files that are output from that command. How do I do that in bash? Do I ...
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 ...
13
votes
3answers
2k views

Can the filesystem become inconsistent if interrupted when moving a file?

I have two folders on the same partition (EXT2) If I mv folder1/file folder2 and some interruption occur (e.g. power failure) could the file system ever end up being inconsistent? Isn't the mv ...
11
votes
3answers
7k views

Is mv atomic on my fs?

How can I check if mv is atomic on my fs (ext4)? The OS is Red Hat Enterprise Linux Server release 6.8. In general, how can I check this? I have looked around, and didn't find if my OS is standard ...
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 ...
7
votes
7answers
8k views

Linux command line. Move all files and directories in directory, except some files and directories

I have a folder A which has files and directories, I want to move all those files and directories to another folder B, except file, file2, directory, and directory2. How can this be done?
5
votes
1answer
3k views

Rename files with spaces in a BusyBox shell

I'm trying to rename some files on my Synology Diskstation via SSH. The available shell is the BusyBox built-in shell: BusyBox v1.16.1 (2013-04-16 20:13:10 CST) built-in shell (ash) The move command ...
4
votes
5answers
303 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 │...
4
votes
1answer
286 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 ...
3
votes
1answer
240 views

move the search content to different directory

I am on Oracle Solaris. I am using: grep "searchstring" filename.* above command returns my search result. Now I want to move the all the files in above search result (all the files not the search ...
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{...
2
votes
1answer
48 views

Had an extra > character when moving a file, now the folder is missing

I tried moving a file in Linux from one directory to another and accidentally had an extra > character. mv /u01/app/oracle/product/12.1.0.2/db_1/dbs/>test2.dbf /u01/shared_data/oradata/TEST/test....
2
votes
3answers
120 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 ...
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 >&...
2
votes
2answers
121 views

Moving files and renaming using a portion of directory structure and a portion of current filename

So here's current path: ../CAMERA3/serialnum/2016-12-19/001/dav/07/07.02.53-07.03.14[M][0@0][0].dav here end goal: ../CAMERA3/2016-12-19_07.02.53-07.03.14.dav So I'm basically trying to figure out ...
2
votes
1answer
114 views

Is it possible somehow to tell if a laptop is moved in a bash or python script?

I'm trying to figure out if there's a way to use a bash or python script to tell if my laptop gets moved. I had the idea of using wifi signal strength to do it, but the problem with that is that you ...
2
votes
2answers
1k views

How to move files to files with same name, but different extension

I have a folder A with many small files. In the parent folder there are many folders with other files in them. now in folder A there are files that have the same name as in the other folders, but they ...
2
votes
2answers
545 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 ...
2
votes
0answers
627 views

Move lxc container to a different host

Is it possible to move a lxc container from one lxc host to a different one? Here are the specs of the machines: Current LXC host: Gentoo: Linux 3.7.10-gentoo #1 SMP x86_64 New LXC host: CentOS 6....
2
votes
1answer
588 views

expanding boot, moving LUKS root

GPT > Partition2 > LUKS > btrfs I need some additional space for my boot volume, so far I did: Shrink my btrfs volume by 250MB. btrfs resize -250M / Shrink the LUKS root volume cryptsetup ...
1
vote
2answers
117 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 ...
1
vote
1answer
25k views

How do I properly allow user jenkins to write to a specific directory under user minecraft home directory?

I am using Jenkins, I want to copy a file from the Jenkins directory in to the minecraft user directory, but I am not sure how to go about this, as when I run cp build/versions/*.info /home/*...
1
vote
1answer
4k views

Find all tar.gz files and move them to a one level down directory

I have tar.gz files accessible from ./parent/subfolder/tar_file_folder/*tar.gz And I want to find them and move them into the ./parent/ directory, therefore one level up. However, there are several ...
1
vote
1answer
183 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 ...
1
vote
2answers
38 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 ...
1
vote
1answer
21 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
292 views

How can I move a ZFS pool to a child pool?

I have created a pool in zfs using: zpool create data001 mirror /dev/sda /dev/sdb but in hindsight I wanted to create zpool create data/001 mirror /dev/sda /dev/sdb None of the rename/move ...
1
vote
1answer
520 views

lost directory cannot find it with testdisk

I was moving a directory on my parents computer using a teamviewer session. The session responds slow and somehow, when I was moving the directory (location: /sdb/synchronisatie/nel/) something went ...
1
vote
2answers
47 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 ...
1
vote
3answers
62 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
33 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
108 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 ...
1
vote
1answer
941 views

Changing home directory path with usermod doesn't work

When I try to use this command (as root) # usermod -d /media/erez -m erez I get usermod: user erez is currently used by process <number> Lot of examples on this issue but none of them ...
1
vote
1answer
151 views

Move files several directories up for several directories with similar layout

I have a directory with the following layout (the layout in Directory 1 is repeated in every other Directory <num>): Parent directory Directory 1 some directory another ...
1
vote
2answers
248 views

Nautilus-script to move file into same name directory

How can I create a Nautilus script that moves a the selected file into a new folder with the same name? My starting point: /home/user/123 here 123 is a file with no extension My goal here is to ...
1
vote
2answers
454 views

Find and move directory to a new directory based on name [duplicate]

I would like to move all the folders contained in the folder "/example" named e.g. "*_jony" to a new directory call "/jony". I have try several way without success! It would be great to have some ...
1
vote
4answers
1k views

How to move all files (excluding sub-directories) from one directory to another?

How do you move all the files (excluding sub-directories) from one directory to another. I'd prefer if the solution used just basic shell scripting.
1
vote
1answer
96 views

How do I merge (without copying) two directories? [duplicate]

I have: $ find 1 2 -printf '%i %p\n' 40011805 1 40011450 1/t 40011923 1/a 40014006 1/a/e 40011217 1/a/q 40011806 2 40011458 2/y 40011924 2/a 40013989 2/a/e 40013945 2/a/w I want: <inode> <...
1
vote
2answers
940 views

LVM move logical volumes across physical volumes without data loss

I wonder how can I move my logical volumes from current physical volume to another without data loss. I have read mans but I haven't found this information there. I would be grateful for any help. ...
1
vote
0answers
14 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 ...
1
vote
2answers
87 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.$...
1
vote
0answers
176 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
1answer
53 views

find matching file and change dirname path

I need to find a very efficient way of moving a file of matching -mtime from one directory tree to another directory, maintaining the same subdirectory path where it doesn't exist yet. eg. move /dirA/...
1
vote
1answer
60 views

how to track the time taken for a move operation from one folder to another in linux

how to track the time taken for a move operation from one folder to another in linux I have been performing a move operation like the sample below. I would like to know how much time in seconds does ...
1
vote
0answers
607 views

using left mouse button to move window can cause freeze (XFCE4/Ubuntu 15.10)

I use xfce4 under Ubuntu 15.10. Fairly often some action with my mouse causes the cursor to change into the closed hand icon and my session freezes in a useless state. When this happens the cursor ...
1
vote
0answers
48 views

Bulk move files back to where they came from

What happened I'm in quite a mess right now after having clamscan scan over my windows part of the system and move all found files (which apparently includes PUA's) to a directory on another drive. ...
1
vote
0answers
35 views

Will booting the system get affected if root partition moved, though boot partition is separate

I need to move the root partition to the right after shrinking it. I have separate boot partition as seen below. The free space I want to allocate to boot partition so as to increase it's size. I've ...
1
vote
0answers
1k views

Why is moving file within an ext4 partition so slow?

The short question is why is a move operation, moving within the same ext4 partition taking longer than a copy of the same files from a different drive? The longer description of the scenario: I ...
1
vote
0answers
415 views

Properly mount a windows share to move files on the mountpoint

This question resulted from a question of mine on stackexchange. I mount a windows share with mount -t cifs -o username=username,password=password,rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=...