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 [mv]

Tag for questions about the terminal command "mv" to move and rename files.

4
votes
2answers
8k views

File disappeared on move

I had a directory with a file and another empty directory in it like this: . .. file.ext folder I did: mv file.ext /folder The file disappeared now, not in folder too not where it was before! ...
7
votes
4answers
2k views

Move only the last 8 files in a directory to another directory

I'm trying to move the last 8 files from the Documents directory to another directory, but I don't want to move them one-by-one to that specific directory. Is it possible to move them with a ...
6
votes
4answers
38k views

How to copy (or move) files from remote machine to local machine?

I SSH tunneled from my local Ubuntu machine to a remote Ubuntu machine and I want to copy/move files from the remote Ubuntu to the local one. I need to do that from within the SSH session (i.e, from ...
7
votes
3answers
2k views

Accidentally moved directories under root

I've accidentally run this command sudo mv /* /applications/minced/ instead of sudo mv ./* /applications/minced/ This is all that's left in the root directory $ / applications/ dev/ ...
137
votes
12answers
424k views

How to move multiple files at once to a specific destination directory?

I got a bunch of files in some directory (along with many other files) that I want to move. Luckily, all the files I want to move contain a certain identifier in their names, so I can ls | grep ...
14
votes
3answers
3k views

Revert moving root directory recursively

I have an Ubuntu Desktop used as a Server. This morning I accidentally moved all my root to ../ root@server:/tmp/UPS/up/upsilon# mv /* ../ mv: impossibile spostare "/dev" in "../dev": Dispositivo o ...
3
votes
2answers
3k views

Using wildcards to do mass renaming? [duplicate]

I realized I had named a bunch of files in an off-by-one fashion so I wanted to rename any file starting with "1" to the same thing except starting with 2. For example mv 1.4.5.txt 2.4.5.txt or mv 1-...
144
votes
5answers
285k views

mv: Directory not empty

I want to move content of a directory within another directory with the same folders. Here's an example: I have ./backup wich have the directories base and test. Now I want to move these directories ...
12
votes
3answers
27k views

mv files with | xargs

I'm just trying to move a bunch of files (not symlinks) out of my /etc/apache/sites-enabled folder into the /etc/apache/sites-available folder with the following: /etc/apache2/sites-enabled$ find . -...
4
votes
2answers
5k views

mv error in shell script “are the same file”

I'm trying to get a script that will rename and move videos. Here is what I have: #!/bin/bash src="/mnt/Files_Apps/temp/" dest="/mnt/Files_Apps/TFTP root/" for file in "$src"*.*; do newfile="${dest}...
3
votes
1answer
2k views

Nautilus sometimes refuses to rename files or folders - terminal works

I sometimes have the following issue: I'm working with Nautilus (Ubuntu 14.10 with Unity) and for example create new folders. But when I want to rename them, I can select that in the context menu and ...
1
vote
1answer
640 views

Tried to move a file and now i cant find it [duplicate]

I am using Ubuntu 15.10 and I had a file name __app.zip and I was wanting to move that inside the folder name testing To move the file i used the following command after which I cant find the file ...
4
votes
2answers
10k views

How to delete to trash via terminal (with mv command)? [duplicate]

I would like to know how can I delete a file and/or move it to trash with mv command? I know where the trash located is, then I tried with this commands to move it to trash: mv somefile /home/...
2
votes
2answers
1k views

Eclipse installation process - initial “sudo mv eclipse /opt” Not working

I am following this thread: How to install Eclipse? I downloaded eclipse-jee-mars-1-linux-gtk-x86_64.tar.gz into ~/Documents and ran the tar command that extracted the package into an eclipse folder ...
0
votes
1answer
523 views

Find-move-replace files from /folder1 to /folder1/sub-folders

Situation: folder1 have about 2000 files, folder2 have over 300 sub-folders and each sub-folder have 500 files. What I'm asking is to move/replace files from /folder1 to /folder2/sub-folders, but only ...
-1
votes
2answers
539 views

Can't rename file using mv

Am trying a published solution to remove systemd-shim error after upgrade from 16.04 to 18.04 but get a bash syntax error as follows (you can see I tried different permutations of the same command in ...