Questions tagged [mv]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
4k views

Device or Resource busy when trying to use mv

I am attempting to recover from finger problems where some data was moved to the wrong place when using Ubuntu 20.04. Below are my attempted command and the result. jgossage@JFGPER:/media/jgossage$ mv ...
0 votes
0 answers
80 views

Did by mistake sudo mv /usr/bin /usr/local/bin

By mistake I did sudo mv /usr/bin /usr/local/bin and forgot to put the filename. Now my terminal is not usable. Is there a way to recover from this? I'm from a company laptop and I cannot reformat. ...
3 votes
3 answers
504 views

Remove apostrophe from multiple filenames

I'm new with Linux and I have the following problem. I have several different filenames like: 'Name1.mp4' 'Name2.mp4' ... I would like to have the apostrophe ' removed from the filenames. Meaning, in ...
0 votes
3 answers
4k views

How can i move multiple files to folder with same name

I have multiple files like this: round3-bcF_01_bcR_01.R1.fastq round3-bcF_01_bcR_01.R2.fastq round4-bcF_01_bcR_01.R1.fastq round4-bcF_01_bcR_01.R2.fastq round3-bcF_01_bcR_02.R1.fastq round3-...
13 votes
5 answers
11k views

Simulate action of mv command

I'm moving some files around, and I want to make sure that the mv command I've typed is correct before I go ahead and run it. If I was using apt-get, I could use the -s flag to perform a simulation ...
1 vote
1 answer
49 views

Move Files from .txt

I have all my files in a parent directory, "Folder". I have a Text document with all their appropriate locations. What I want to do is to move them from Parent directory back to their ...
0 votes
1 answer
142 views

Losing files on external BitLocker encrypted drive

I am using Ubuntu 22.04 and have an external encrypted with BitLocker HDD which I use to store sensitive data such as personal and family photos and videos. Today, as usual, I decided to move some ...
0 votes
0 answers
158 views

rename file with name contains variable part

If i have file name (file_$i.txt). How I can change variable part in the name to be (file_$var.txt) $i >> number of lines in file $var >> content of other file
3 votes
1 answer
355 views

mv command: moving only certain extension files, not having a string in their name

I am trying to incorporate 'mv' command in a dockerfile. I want to move only those files having certain extension, but not having a string in their name. Suppose src directory has abc.txt, abcu.txt, ...
0 votes
0 answers
38 views

How to move files from one directory to another

I downloaded a few files under a folder that was stored in the "downloads" option on my pc, as usual. But I need to move it to the working directory of Ubuntu. What is the proper way to do ...
0 votes
0 answers
53 views

I have renamed "/usr" folder in Ubuntu, now trying to rename to "/usr", but I have problems I think because "/usr" folder does not exist [duplicate]

I have tryed to restoresome data and moved "usr" folder in Ubuntu. For any command I tr, for example "mv", "cp", the system writing "/usr-new/bin/mv: cannot execute: ...
31 votes
4 answers
64k 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 . -...
0 votes
1 answer
49 views

Moved a file with mv but now I can't find it

It seems I made a mistake in the command. It still executed a move, but now I can't find the file. My command was this: mv /tank/incoming/myfile.mov \(2017\)/ /tank/myfiles/ The command was executed, ...
0 votes
0 answers
35 views

moving multiple files

i have a downloadsfolder that contains 9 items backup.sh ,bestanden.sh, tara.tar.gz, nmap.tar.bz2, demo11.zip, contract.pdf, cleaning.pdf, GNU-linux.jpg and video.mp4. these have to get sorted in the ...
292 votes
8 answers
681k 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 which has the directories base and test. Now, I want to move these directories ...
1 vote
2 answers
181 views

Performant sort files into subdirectories by content of metafile

-edit: more details, correct code- I want to move files from a directory into sub directories by data out of a metadata file. There are groups of files like <name>.<extension>. Each group ...
9 votes
2 answers
952 views

Move duplicated folder name up one level

I have a folder structure: /mnt/data/mydata/mydata/several-files-and-folders-here I would like it to instead be: /mnt/data/mydata/several-files-and-folders-here I tried mv but it complains the folder ...
27 votes
2 answers
10k views

mv fails with "No space left on device" when the destination has 31 GB of space remaining

I've been trying to move 32.6 GB of files to a folder on an external flashdrive to free up space on my laptop's SSD. After opening up the source folder in Terminal (and running ulimit -S -s unlimited ...
1 vote
1 answer
4k views

Anyway to undo overwriting file by mv or recover replaced file?

I accidentally mv a new file to an existing file and overwrote it. Is there anyway to undo mv or recover the replaced file?
0 votes
1 answer
45 views

lost file after do "mv" file in filename.sh

I try to run filename.sh which contains: mv /home/newdir/test1.jpg /home/backupdir mv /home/newdir/test2.jpg /home/backupdir mv /home/newdir/test3.jpg /home/backupdir mv /home/newdir/test4.jpg /home/...
0 votes
1 answer
93 views

Remove parent folder but keep subfolder intact?

Hullo all, i've seen this question asked before but I am hoping for a different solution. I have this folder structure; /home/radamand/folder1/folder2 folder1 ONLY contains folder2, however folder2 ...
0 votes
2 answers
39 views

Copying a downloaded file into my current terminal folder

I am compiling WRF on my HP Desktop. I'm in Ubuntu terminal and trying to use the cp command to copy from my D Drive, but it just won't work. Using cp D:\MyWRF/file.tar . All I get is cannot stat, ...
-4 votes
2 answers
131 views

mv renaming files deleted it [closed]

if i had a playlist filled with music, i would want it to shuffle and play because i wouldn't want to hear the same song order over and over again as it gets old real fast.. same thing here but with ...
231 votes
15 answers
745k 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 ...
4 votes
1 answer
14k 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
0 answers
32 views

Move 700 mb of files to another directory

I have a directory with a lot of mp3 files. I want to be able to move up to 700 mb of those files to another directory. (700 mb is the limit of my blank CD size) I want to create an audio CD. How can ...
0 votes
1 answer
115 views

Cannot locate file after moving

The thing is that I am starting after a few months of experience in linux to use the command line. I was trying to use a new "cursor theme". I found on reddit that I needed to move the file ...
0 votes
1 answer
280 views

FSL error: fsl_vbm_1 -b problem imglob not found

I am trying to run the command fslvbm_1_bet -b but get the following errors: /usr/local/fsl/bin/fslvbm_1_bet: 1: /usr/local/fsl/bin/imglob: not found /usr/local/fsl/bin/fslvbm_1_bet: 1: /usr/local/fsl/...
7 votes
3 answers
4k 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/ ...
0 votes
1 answer
36 views

I move folder to * file type how to get file form it [closed]

I try mv Some.txt A* but there is not any folder name of A so it converts into 'A*'file ls screenshot
0 votes
1 answer
69 views

Moving contents of a directory to another

I want to move all the contents including files and sub directories from /home/storage_new/nidhal/foldertest/ to /home/storage_new/nidhal/foldertest1/. When I use the command ... while true; do ...
1 vote
1 answer
8k views

Attempting to move folder from C drive to folder in WSL/Ubuntu

I am making a website for my online book/media business, and I have some photos on my C drive (cover photos) that I would like to copy into my project directory in VSCode via WSL. The file is stored ...
0 votes
1 answer
141 views

Cannot find folders / files after mv on ubuntu

Having cd /poolf/sharef I have a folder named media. I issued the command sudo mv -T media Media The folder renamed media to Media as expected but the contents have disappeared. Can someone tell me ...
0 votes
0 answers
626 views

unable to copy files from ssd to hdd in ubuntu 20.04

I'm trying to copy media files like .mp3,.mp4, .mkv etc. from my ssd to hdd as to save time complexity of ssd but unable to do so. Everytime I try to copy or move files it shows me this error "...
9 votes
4 answers
35k 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
2 answers
963 views

Is mv the only command that we can use to move files/folders?

Is mv the only command that we can use to move files/folders on Ubuntu 20.04?
1 vote
2 answers
230 views

Does moving a file/folder makes disk fragmented? [duplicate]

Does moving a file/folder causes fragmentation in Disk on Ubuntu 20.04?
6 votes
3 answers
24k views

mv command with *-wildcard shows error "No such file or directory"

I have 6 .txt files on my desktop that I am trying to move using the Terminal. However when I try to mass move them all into the texts folder that is on my Desktop, I get the the following error: mv: ...
0 votes
1 answer
195 views

Using Ubuntu on SSD with a Separate Data Drive

I have been researching this for quite some time coming from Windows that there is no “Path” that you can give to a program during installation, but instead the program downloads where it needs to. Is ...
12 votes
3 answers
33k views

mv command - don't overwrite files

I want to mv files and not overwrite duplicates. The -b switch only makes a single backup file, whereas I may have many. According to the mv man page: The backup suffix is '~', unless set with --...
1 vote
1 answer
477 views

Move files with specific number of characters in the extension

How do I move all files that only have three characters in the extension to the parent directory? E.g. I want to move all the .mp3 and .zip but not all the .sh to the parent directory.
1 vote
1 answer
80 views

How to rename files: picture.jpg.~1~ to picture_~1~.jpg [duplicate]

I have say 30000 files of this type: picture.jpg.~12~ They are remnants of a backup (mv -v --backup=numbered ...). I needed to switch the extensions to: picture.~12~.jpg
0 votes
0 answers
32 views

Recursively move certain folders to other folders of the same name

I have the following structure: dir1 - subdir0 - subfile00 - subfile01 - subdir1 - subfile10 - subfile11 - file0 - file1 dir2 - subdir0 - subfile00 - subfile01 - custom_file ...
0 votes
1 answer
142 views

moving multiple files in multiple directories

I have a directory, within are many directories (abc1 abc2 abc3 etc.) that contain a sub-directory - always the same name (MATCHING_STRING) - full of files. I want to remove that sub-directory (...
2 votes
1 answer
167 views

Rename some files to their own name + something else

I have a directory like Photo and I want to change the names of the directories inside it -> to what they are, but without it [www.faraDa...] like the first one that I change by mv command. but I ...
0 votes
0 answers
264 views

Cannot mv file into a subdirectory of itself

I was trying to rename a file in /media/user/TOSHIBA EXT/Fotos/Chronologisch using mv, and I get the following error: /media/user/TOSHIBA EXT/Fotos/Chronologisch$ mv "DSC00001.JPG" "12....
3 votes
1 answer
240 views

all files in the folder disappeared because of a typo while using `mv`

I am new to bash and I was trying to rename all files in a directory to their md5 checksum in the following way. r@r:~g$ sh $ for F in *; do > mv "$F" "$(md5sum "$i")&...
-2 votes
2 answers
1k views

File is gone on mv command :

I was trying to move file.py to the existing directory Modules ... wm@my-laptop:~/Desktop/1linuxandpython$ mv Modules_and_packages.py /Modules_and_packages_Game it said permission denied , so i did ...
1 vote
0 answers
648 views

Why is mv so slow - local disk to local disk?

I'm moving a single large file from /mnt/z to /mnt/y on a bare metal Ubuntu 20.04.3 install. Both disks are capable of sustaining 2 GB/s in writes, and do in other operations, but mv caps out at ~200 ...
1 vote
1 answer
1k views

Accidentally moved directories and files under root and reboot the machine

I've accidentally run this command sudo mv /* /applications/minced/ instead of sudo mv ./* /applications/minced/ Unfortunately, I rebooted the machine And now I am getting this error please help me

1
2 3 4 5