Questions tagged [mv]

mv is a move/rename file in Linux

mv is a tool to move/rename files/folders under *nix.

Command manual.

56 questions
0
votes
1 answer

Cannot move folder to a subdirectoy of itself - What's going on?

O.K I am trying to do the following very simple command and it is failing as follows... mv '/home/admin/Downloads/folder1' '/home/admin/MyLibrary/MyVideos/TV/folder1/' mv: cannot move `/home/admin/Downloads/folder1' to a subdirectory of itself, …
calumbrodie
  • 182
  • 1
  • 2
  • 12
0
votes
3 answers

linux mv command weirdness

can anyone tell me why when I type: mv -f ./tmp/members ./ I get: mv: cannot move `./tmp/members' to a subdirectory of itself, `./members' And moreover the correct way to move this directory? Also, there is already a directory at ./members ... I…
Eric
  • 160
  • 8
0
votes
1 answer

Variables on set-hostname and mv command in shell script

I have the below script in Shell: read n for ((i=1;i<=$n;i++)) do echo "Connecting to $publicip" ssh -i ./key.txt root@$publicip 'hostnamectl set-hostname autotest$i.domain.com && mv /etc/letsencrypt/live/autotest.domain.com…
serverstackqns
  • 722
  • 2
  • 16
  • 39
0
votes
1 answer

`mv` command did not rename, but move into existing directory, from ansible

I am running an ansible task (inside a role): - name: Rename dir become: yes shell: mv /data/files/1.6.5 /data/files/1.7.0 The intended effect is that 1.6.5 is renamed to 1.7.0 Now, on the target host, in one instance I had 1.7.0 existing: ~$…
transient_loop
  • 459
  • 1
  • 4
  • 11
0
votes
0 answers

Move files older than day

I am looking for some solution, where I have to move all the directories and files under the source directory to the destination a day before. I want to move the directories till yesterday but not today’s. find /temp/source/* -mtime +1 -exec mv -t…
nasa
  • 1
  • 2
0
votes
1 answer

Bash: How to move files and directories from one directory to another?

I'm trying to write a script that moves files and (sub)directories from within one directory to another. That move operation should include not only regular files and directories but also any dot-files. So far I've come up with this: mv -f…
Regis May
  • 103
  • 2
0
votes
1 answer

Fired mv wordpress /* ./ while in /var/www

I don't why that happened but I was in /var/www and I fired the command mv wordpress /* ./ And now I'm not able to access my server via ssh, rdp or teamviewer. I really gotta fix it. What should I do (If I get SSH access somehow)? And can anyone…
-1
votes
1 answer

How to check if a unix based system supports a specific option on a command (mv -T)

I'm working on a deploy script which wants to update a symlink atomically. I intend to use a command like $ ln -s new current_tmp && mv -Tf current_tmp current (Credit to here for details on why this works). However, not all versions of mv support…
Luke Cousins
  • 377
  • 1
  • 3
  • 18
-1
votes
1 answer

Can't move large files, always get Input/output error after some time

I want to move a large file (hdd of a paralells vm, 81G) from one hd to another. After some time I get the error message: Input/output error. What can I do to move the file? I checked source and target drive (with the osx internal tools), they…
markus
  • 1,050
  • 5
  • 18
  • 37
-1
votes
3 answers

Rename tons of files

How can I rename all the files with a pattern like…
ninjascorner
  • 121
  • 1
  • 4
-1
votes
1 answer

Safest way to move a mount point that is a parent of other mount points on Linux to a new physical device

I goofed up and /var/lib/kubelet was not mounted on a server. So it was on the root. I noticed this and I want to fix it. I did the stupid thing and just tried to stop the associated services (kubelet), rename the existing directory to…
tacos_tacos_tacos
  • 3,220
  • 16
  • 58
  • 97
1 2 3
4