Questions tagged [move]

146 questions
36
votes
4 answers

Wrong mv command. Where did my files go?

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.
Adam Gosztolai
  • 755
  • 2
  • 7
  • 10
32
votes
2 answers

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

When I select multiple files within ranger (using 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 currently highlighted.
Matt
  • 757
  • 1
  • 8
  • 9
22
votes
2 answers

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 use a pipe? Do I use a more wordy if/then statement…
bernie2436
  • 6,505
  • 22
  • 58
  • 69
18
votes
3 answers

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 POSIX.
Tizianoreica
  • 297
  • 1
  • 2
  • 6
16
votes
1 answer

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 the correct file name. So far, my only solution is…
Niels2000
  • 273
  • 1
  • 7
13
votes
3 answers

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 operation atomic? Update: So far on IRC I got the…
graphtheory92
  • 245
  • 2
  • 7
8
votes
7 answers

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?
somethingSomething
  • 5,721
  • 18
  • 58
  • 98
5
votes
1 answer

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 to the new location. It is able to paste only ~800k…
deathholes
  • 807
  • 1
  • 6
  • 11
5
votes
1 answer

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 always yields two errors when I try using a…
Karl
  • 65
  • 1
  • 6
4
votes
2 answers

Moving directories based on their size overall, and then based on the quantity of files within them

I’m trying to clean up all of my music folders (and there are a lot) - but rather than delete, I want to move the ones that are empty, or have only a few Mb, or have just a few files in them. I’ve managed to use the following find command to move…
nodecentral
  • 141
  • 1
4
votes
2 answers

Parent child directory same name , move files to parent directory

I need a way to search directories for child directories with the same name and then move all files in the child directory to the parent. Thus from /recup-dir1/recup-dir1/files to /recup-dir1/files. The child directories can be left empty because i…
TomDerks
  • 43
  • 4
4
votes
5 answers

Move folder structure across multiple directories

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 │ ├── index.js │ └── test.js └── beta ├──…
ThomasReggi
  • 277
  • 1
  • 12
4
votes
3 answers

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 <> file_a >> file_b >> file_c ls -l file_* EOF sudo su user_b <
Petr Skocik
  • 28,176
  • 14
  • 81
  • 141
3
votes
1 answer

How would the mouse behave in a mirrored environment?

Sorry if it sounds confusing, but this is not a biology inquiry. I'm planning to switch to Linux, but I have a few questions need answered. If a single monitor is mirrored like described in this link, then will we see the pointer onscreen move…
longtry
  • 43
  • 6
3
votes
1 answer

Moving /var onto different disk/partition

I moved the /var directory to a new disk/partition, this part worked well, but I forgot to delete/move the old /var path and it is still using space on / (root) partition. How could I delete the old /var without redo all the process? Any ideas? This…
1
2 3
9 10