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.

1
vote
1answer
87 views

Why do I get 'X' and 'Y' are the same file when using mv, even though they are clearly NOT the same file?

I am attempting to move a file from one directory to another on a CIFS mounted file system using the command: mv /mnt/development/Backup/NagiosServer/latest/* /mnt/development/Backup/NagiosServer/...
0
votes
1answer
32 views

mv error in destination file in Ubuntu 18.04 LTS and my system does not use apt-get or yum,

I'm trying to install FDR on Ubuntu. whenever I want to install FDR4 in /usr/local with this: mv ~/Downloads/fdr4 /usr/local/fdr4 but error occurs with message mv: mising destination file operand
0
votes
0answers
36 views

Missing file after mv

Hope you can help me with this issue. I did the following: mv filename .foldername after that the file is gone and a hidden folder foldername was created .foldername when cd .foldername I got a ...
0
votes
0answers
33 views

move folder from mounted cifs to ntfs take ages

I'm running on Ubuntu 18.04 and have a network drive mounted via cifs. When I try to copy a dir from that network drive the copying took ages (ubuntu says 596.523 hours). Neither mv (shell) nor copy (...
10
votes
5answers
3k views

Why doesn’t `mv file /dir` move the file to a subdirectory of the current working directory?

I was in my /etc directory and typed the command me@mylaptop:/etc$ sudo mv MyFile.conf /openvpn I thought that would move the file into the directory openvpn which is a subdirectory of the /etc ...
0
votes
1answer
83 views

Copy file from Pi to USB

So I am trying to copy a file from my home pi directory to USB on my Pi zero as root using sudo mv command and it still says permission denied. I am a root user. How do I copy this file if I don't ...
1
vote
1answer
28 views

Install MV without installation [duplicate]

I have the problem that whenever I want to Install something, there is this lovely error: /usr/sbin/update-initramfs: 158: /usr/sbin/update-initramfs: mv: not found I could trace this error back, ...
0
votes
1answer
39 views

Can I use a list of file names that I saved to file to have each file on the list copied/moved/deleted?

How can I use cp rm or mv commands to manipulate files saved to a list, for example one made like so: ls Downloads/ | grep example > example.tmp The point is to be able to view/edit the file list ...
0
votes
1answer
47 views

Use find to find a directory and move it to a different path

I have hundreds of thousands of files in hundreds of directories. An example directory structure is ./main/foo1/bar/* ./main/foo2/bar/* ./main/foo3/bar/* ./main/foo1/ran/* ./main/foo2/ran/* For ...
0
votes
1answer
67 views

Rename multiple files of different name and extensions with parent directory name

I'm trying to figure out how to rename multiple files (100s) that have different extensions to their respective sub directory name. Here is the structure: Parentdir |--subdir1 |---name1.txt ...
0
votes
2answers
1k views

No such file or directory?

Im installing SquirrelMail in Ubuntu Server 18.04. I got it from here: wget https://sourceforge.net/projects/squirrelmail/files/stable/1.4.22/squirrelmail-webmail-1.4.22.zip Then I unzipped using ...
1
vote
2answers
706 views

How to move multiple folders to another directory? [duplicate]

How can I move multiple folders into another directory ? For example, I would like to move the folder 000/ 001/ 002/ to train/000/ train/002 train/003. Is there a simple command that I can use like ...
0
votes
0answers
21 views

Windows Ubuntu Subsystem mv folder disappeared but works with file

I am using Windows Ubuntu Subsystem 18.04. The command I run is mv venv ../d/ and the folder can neither be found in current directory nor in d. This command is double checked from .bash_history. ...
0
votes
1answer
61 views

How do you bulk move files into folders corresponding to the name of each file?

I have several movies in a folder. For example: ~/Downloads/Movies/Movie A (1998).mkv ~/Downloads/Movies/Movie B (1999).mkv ~/Downloads/Movies/Movie C (2000).mkv I would like to put each file ...
1
vote
0answers
23 views

Moving files that meet extension and size criteria to a different folder via terminal [duplicate]

Due to a series of unfortunate incidents, I lost all my data during a botched system update (noob here). I managed to use photorec to recover files to a specific folder "temp" on my desktop. I want to ...
1
vote
1answer
37 views

Moving 1M of files on 5M

Is there a command line to move 1M of files from a directory with 5M of files? I tried: sudo mv `ls | head -1000000` <destination> But I get this message: -bash: /usr/bin/sudo: Argument list ...
1
vote
2answers
58 views

How do I move one directory to another in Ubuntu

For example, how would I move a directory called "menu" into the "data" directory? Also, I am using Ubuntu and I am new to all of this so I am unsure.
-1
votes
2answers
413 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 ...
0
votes
0answers
37 views

mv command - lost files - directory turned into a file

I am starting to learn about linux commands, and today i did something, that I can't find the solution nowhere ! I tried to move a file "test.txt" to the "Subfolder2", to do so, I entered the ...
0
votes
0answers
88 views

Error accessing a file no such file or directory (I want to rename it)

I am struggling to rename a file, I had a similar issue sometime ago but in that case I wanted to delete, this time I simply want to access it. I have cleared the directory, so only this single file ...
2
votes
1answer
27 views

Running a mv command on large amount of data caused disappearance of other folders [closed]

I messed up by running a mv command on the entire contents of an old external drive to my Desktop without making a destination folder first. I ran sudo mv /my/external/path/* /home/myself/Desktop/ ...
4
votes
3answers
3k views

How to move multiple files with rsync while showing progress?

I can move files with this command: mv -t /mnt/hdd /home/me/movies/movie1.avi /home/me/movies/movie2.avi The problem is, that it shows no progress at all, so I don't know if the operation is 1% done ...
1
vote
0answers
226 views

ls without parameters - No such File or Directory

while creating a backup of a Windows PC I encountered an odd File. I first discovered it while copying the parent backup where exactly the same error came up. Note that I masked all [A-Za-z0-9] with ...
-1
votes
1answer
267 views

mv command problem

I try to use the mv command, but it throws an error like this: adi@LMToshi2 ~ $ mv ~/compass-icon-theme /usr/share/icons mv: cannot move '/home/adi/compass-icon-theme' to '/usr/share/icons/compass-...
1
vote
1answer
68 views

How to move files under multi-directories into same directory?

i have so many files under 300 different directories, file tree like: --s1 - ----abc - ----bcd --s2 - ----123 - ----234 ... etc. I want to put them together under the same directory, like: --...
0
votes
1answer
374 views

Rename files to match parent folder [duplicate]

I want to rename all files within a directory to match the parent folder's name. Now I've found several results that sort of do what I want, but they all seem to rely on a static filetype, path, ...
7
votes
4answers
1k views

Replace a word in a directory name and in the filenames in that directory

I have a directory structure like this: Bookname Edition 1 Bookname Edition 1 type1.pdf Bookname Edition 1 type2.pdf Bookname Edition 2 Bookname Edition 2 type1.pdf Bookname Edition 2 type2....
1
vote
1answer
44 views

Output log for bash

So I am executing a move script for some files that is older than 1 month every week as follow: #!/bin/bash echo "Moving Recordings Older than 30 days!"; /bin/find /var/services/homes/recordings/...
1
vote
1answer
70 views

I want to move both .h and .c files from src to dst

I managed to do so using mv *.c *.h ~/ but I was wondering if I can compact it into a shorter command. I tried the below which didn't work: mv *.[c|h] ~/
12
votes
1answer
2k views

How to move some files to their parent directory?

I want to pull all mp3's that accidentially have been put into a flac folder out of it, to their parent folder. It should not matter how deep the folders are, I just want to move the matching files ...
0
votes
1answer
868 views

MV command deleted file? [duplicate]

Have an odd occurrence (or at least I think? still pretty green in linux) where I tried running the mv to move a .png file to my Pictures directory, I copied the command directly from the terminal ...
3
votes
2answers
7k views

How to exclude a folder when using the mv command

I have this situation where I want to exclude a directory while using the mv command. I saw this example where the syntax would be !(exclude_dir), but when I set up a scenario to test it I get results ...
0
votes
1answer
75 views

Changing files' extention in loop [duplicate]

I want to change extentions of a few files, using loop. #!/bin/bash read -p "type the path for folder " folder read -p "type the extention of files to be renamed " ...
2
votes
2answers
148 views

Where did my files go after using mv?

I used this command: mv Records/1711*D.org /media/geek/SimEx/5\ Data/17-18/Journal/ (this is the command I copy-pasted from the terminal. This session is still live on my terminal.) This executed ...
6
votes
4answers
2k views

Renaming multiple files with complex numbered names

I have 365 files named MOD11A1.A2010001.h24v06.006.2016025150444.hdf MOD11A1.A2010002.h24v06.006.2016025151748.hdf MOD11A1.A2010003.h24v06.006.2016025163706.hdf and I want to rename these files as: ...
6
votes
1answer
564 views

Moved file to typoed-folder

I moved mv ~/...path.../myFile.py ~/a/b/c/typoedFolder I understand now that I should always have a trailing / to prevent these issues, but given that it happened - is there any hope of recovering ...
0
votes
2answers
463 views

How can I copy all pdfs from folders and sub folders? [duplicate]

I need to move all my pdf files from one folder to another folder. How can I do this in terminal?
0
votes
3answers
241 views

how to explicitly use mv to rename a folder(Pen-drive)?

I am trying to rename the my pen-drive by using mv command but it tries to move it and fails. uman@uman-All-Series /media/uman$ sudo mv USB\ STICK/ Videos mv: cannot move 'USB STICK/' to 'Videos': ...
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-...
0
votes
2answers
28 views

Having issues moving file and folder from one directory to another

I have used this code but this is the error message: xxxxxxx~$ mv -v ~/var/www/html/* ~/var/www/ error message - mv: cannot stat '/home/tall/var/www/html/* But I was able to open the directory ...
0
votes
1answer
135 views

Can't rename each 'file' to 'file.text' (using xargs)

I have received a task to do these commands on a text file: Choose each second field from the file Sort and choose first 3 unique values Print the contents of each value.text while redirecting ...
2
votes
2answers
334 views

How does “mv *” know where to move to?

I had a directory structure like this: ravikumar@ravikumar-RV409-RV509-RV709:~$ tree test test | ├── 1 ├── 2 ├── 3 ├── 4 ├── a ├── b └── c I executed mv command as: ravikumar@ravikumar-RV409-RV509-...
0
votes
2answers
761 views

I accidentally used `sudo mv /*` [duplicate]

I have a wordpress site and my current directory was wp-content I just wanted to backup and move the current files of the wp-content/ folder to a folder called wp-content-backup20170907 and clone a ...
3
votes
1answer
174 views

Rename and convert dates in filename without file extension

My set of files are named according to GMT time zone. I successfully renamed and converted all files into the required time zone using the following steps. 1. This code removes all file extensions ...
0
votes
0answers
52 views

I ran an mv command and then two of my hard drives on reboot disappeared

This is what I ran: brian@capitalist:~$ cd /media/brian/Matt3TB/WD/Locale/zh_TW.lproj brian@capitalist:/media/brian/Matt3TB/WD/Locale/zh_TW.lproj$ mv Differet/ .Differet When I rebooted two of my ...
6
votes
3answers
2k views

Accidentally moved home folder?

I'm not quite sure what just happened, all I did was running: ~/Desktop$ mv sublime.desktop \~/.local/share/applications/ The \ sign before ~/.local came up as autocomplete, so I thought it was okay ...
0
votes
2answers
649 views

mv: cannot move 'DVWA-master' to '/var/www/html/DVWA-master': Permission denied [duplicate]

$ mv DVWA-master /var/www/html mv: cannot move 'DVWA-master' to '/var/www/html/DVWA-master': Permission denied How can I fix it? I want to move a folder in /var/www/html.
0
votes
0answers
336 views

extundelete used after mv command

I needed to move a directory temp/ between sda1 -> sda2 partition to free some space in sda1. Some how I ended up: sda1: the directory temp/ is not shown sda2: no directory moved here. I used ...
1
vote
1answer
77 views

Where does `mv myfolder ..myfolder` move my file to? [duplicate]

I am inside /home/me/examplefolder and tried to move the folder myfolder to /home/me like this: root@linuxserver:/home/me/examplefolder# mv myfolder/ ..myfolder The folder myfolder dissapeared, but ...
1
vote
1answer
206 views

How to move some file to a subdirectory?

I have - |Books |--LaTeX |--LaTeX_wikibook.pdf |--LaTex_advanced.pdf |--vim_wikibook.pdf |--vimLaTeX.pdf I want - |Books |--LaTeX | |--LaTeX_wikibook.pdf | |--...