Questions tagged [mv]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
86 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. ...
Gerardo Zinno's user avatar
3 votes
3 answers
521 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 ...
Ralf Hütter's user avatar
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 ...
Lex King's user avatar
0 votes
1 answer
158 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 ...
user83433876's user avatar
0 votes
0 answers
161 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
Amany Abd Elmnem's user avatar
3 votes
1 answer
365 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, ...
Mandroid's user avatar
  • 133
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 ...
Neel's user avatar
  • 1
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: ...
Владимир Бычков's user avatar
0 votes
1 answer
50 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, ...
Warner's user avatar
  • 464
0 votes
0 answers
36 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 ...
unknownname's user avatar
1 vote
2 answers
182 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 ...
Andy A.'s user avatar
  • 133
9 votes
2 answers
984 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 ...
Jack Avante's user avatar
1 vote
1 answer
5k 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?
user42's user avatar
  • 11
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/...
always-learn's user avatar
0 votes
1 answer
97 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 ...
user88710's user avatar
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, ...
John Hurley's user avatar
-4 votes
2 answers
132 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 ...
bruh's user avatar
  • 1
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 ...
fixit7's user avatar
  • 3,127
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 ...
Vikki's user avatar
  • 539
0 votes
1 answer
124 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 ...
milintime's user avatar
  • 119
0 votes
1 answer
285 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/...
Nadine's user avatar
  • 1
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
Shubham's user avatar
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 ...
nidooooz's user avatar
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 ...
jumpman23's user avatar
0 votes
1 answer
142 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 ...
Fruglyish's user avatar
0 votes
0 answers
631 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 "...
Naeem Navjivan's user avatar
0 votes
2 answers
1k 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?
user avatar
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?
user avatar
0 votes
1 answer
196 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 ...
Luke F's user avatar
  • 1
1 vote
1 answer
480 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.
Nick's user avatar
  • 13
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
xerostomus's user avatar
0 votes
0 answers
33 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 ...
jkang's user avatar
  • 121
0 votes
1 answer
146 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 (...
user209405's user avatar
2 votes
1 answer
173 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 ...
Sir-Sorg's user avatar
0 votes
0 answers
268 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....
TheEagle's user avatar
  • 143
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")&...
Collins Smith's user avatar
-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 ...
Marinos TBH's user avatar
1 vote
0 answers
659 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 ...
Chris Han's user avatar
0 votes
1 answer
87 views

How to move a matched id of mat files in different folder

I have Matlab (.mat) files in a particular folder. In a text document, I have some IDs list marked as 0 and 1. First I need to match the IDs and separate the mat files that are marked as '1'. For your ...
Jammy's user avatar
  • 1
1 vote
1 answer
2k 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
Muaath Alhaddad's user avatar
1 vote
1 answer
141 views

Move files with extension in diffrent structure

I need move every file.tif to dir TIFF inside his parent dir.    ├── 1    │   ├── 240_01.tif    │   ├── 240_02.TIF    │   └── TEST    │   └── syg_240_test_1.tif    ├── 2-3     │   ├── 2   │...
mechmati's user avatar
0 votes
1 answer
351 views

Why is renaming files with sed and mv printing '$'\r'

I am using Ubuntu on a Windows 10 machine. I am trying to rename 5 files (file1.txt, file2.txt, file3.txt, file4.txt, file5.txt) so that each file is replaced by Sample#_VoucherID.fastq.gz. To do this,...
Justin's user avatar
  • 27
0 votes
1 answer
2k views

"Permission Denied" as root when moving files

Using sudo on the RPISEC-MBE virtual machine, I have mounted and copied my files that were on a USB flash drive to an admin folder (that I have access to). Unfortunately, even with sudo I can't seem ...
nanoman's user avatar
  • 103
0 votes
1 answer
864 views

Renaming the recent directory with spaces in its name

I am trying to rename the recent directory with spaces in its name. $ mkdir "foo bar" foo bar $ ls -c | head -1 $ mv $(ls -c | head -1) foobar Getting the following error: mv: target '...
Josef Klimuk's user avatar
  • 1,596
0 votes
2 answers
336 views

Problem with a mv script

I am having a problem with a mv script. I create a Test folder: mkdir Test In this folder I create subfolders: mkdir -p Pics20{18..23}/{01..12} In the Test folder I create many files: touch IMG20{...
Kanarise's user avatar
1 vote
1 answer
274 views

Rename file names with a parent directory name

I want to rename my files recursively, ending with *.fna.gz with the parent directory two-step-up i.e. "Aspergillus_neoniger". You can see the subdirectories details in this image tree ...
shahzad's user avatar
  • 43
0 votes
1 answer
369 views

Moving my folder from Desktop to Downloads (Folder)

I tried to move a folder from my Desktop into my Downloads folder several times, all my tries end up with renaming my folder name only. ex: tuxedo@cosmos:~/Desktop$ sudo mv myFolder Downloads I don't ...
0xy's user avatar
  • 15
2 votes
2 answers
399 views

Move all JPGs and rename them into one directory

.Hi. I have a bunch of jpgs in 100s of subfolders , I know I can move them all with this command find -type f -iname "*.jpg" -exec mv -av {} /home/root/private/pics/ \; But my all my jpgs ...
1014Noob's user avatar
0 votes
1 answer
1k views

Move and rename all files in dir to date and number

I would like to move and rename all files in dir with the date and a number on the end front as an indicator that the files are unique. I wrote a little bash script to do this but it places the number ...
troylatroy's user avatar
  • 1,275
2 votes
1 answer
143 views

cp .* /home/name erased all files in /home/name

A while ago, I got a new ssd for my laptop, so I dd'd everything onto the new drive, and used it for a while without issue. I decided to put the old drive back into my laptop, and put newer ssd into a ...
ruinedanothergoodinstall's user avatar

1
2 3 4 5