Questions tagged [mv]

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

Filter by
Sorted by
Tagged with
13 votes
1 answer
5k views

How do I get back files after "mv * .*"?

I hid some files using the command: mv * .* but now I am unable to find them. I tried using: mv .* * but nothing happened (an error was shown). If I run: ls -la it's showing: total 8 drwxrwxr-x 2 ...
code by Abhishek Bharti's user avatar
0 votes
2 answers
848 views

How to move several folders using double wildcard?

I am trying to move all the folders that have the digit 1 in between (glove.6B.60d.txt) and (model) mv "./*.txt)(1)(m*" "/home/e1" but I get the error message mv: cannot stat './*....
Kong's user avatar
  • 1,241
0 votes
1 answer
315 views

Writing a script to rename and move files

Current work server has images arranged in the following folder structure: . └── Plans ├── Area 1 │   ├── Location 12.jpg │   ├── Location 34.jpg │   └── Location 37.jpg └── Area 2 ...
cworner1's user avatar
  • 123
0 votes
1 answer
76 views

Files and folders disappearing after using mv

Hi firstly I have looked through other questions similar to mine and I couldn't find relevant answers to me. Running Ubuntu 16.04.7 LTS Command Line In my home directory I have 2 folders 11100 world ...
user avatar
0 votes
1 answer
388 views

Cannot move Linux Wifi Driver into the specific directory

I am currently trying to put the driver's folder into the WiFi directory but it is giving me a error every time I execute it. The instructions on the website are super vague on what to do step by step ...
Marrth 64's user avatar
0 votes
1 answer
287 views

Interrupt `mv` command by ctrl+c, and disk space is lost

To transfer large amount of data, I used mv from the first HDD called /KRX to other HDD called /data_tmp. But I interrupted the mv process using Ctrl+C, and I fill /KRX with other data. Then when I ...
Seung Hyeon Yu's user avatar
0 votes
1 answer
845 views

When moving all files but-one using mv, how do you escape filenames with dashes?

In How to move all files in current folder to subfolder?, the solution to moving all files from a folder but one is: mv (!dontmovethis) /new/path/ When trying to move a file that includes a dash, a ...
aphid's user avatar
  • 123
0 votes
0 answers
58 views

How to find and move files between certain dates? [duplicate]

I have two repertories named 'test1' and 'test2' with multiples files with .jpg or .mp3 extensions. I want to find and move all files between 22-juin-2016 and 21-September-2018 to a new folder called '...
Neo Capo's user avatar
4 votes
1 answer
192 views

Use the '*' in shell script

I am trying to run a command example: sudo mv /home/vaishnavi/Downloads/*.ttc /home/vaishnavi/Downloads/*.ttf /usr/local/share/fonts/ms_fonts/ It works fine in the terminal, but when I try to add ...
Ubuntovative is here's user avatar
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-...
tucanco's user avatar
  • 39
0 votes
1 answer
132 views

I need help simultaneously moving the same file type in multiple folder from one subdirectory to another

Example: I have 3 folders A, B, C in each folder(A, B, C) there is a subdirectory called T1. In this subdirectory called T1, there is a file name called T1.nii.gz. I want to simultaneously move with ...
Masud Hussain's user avatar
1 vote
1 answer
2k views

mv: missing destination file operand after with grep

Kia ora, I have a build script where I do a bunch of file operations and if they succeed, I print stuff to stdout as part of a report generated for the build. However I am getting the error "mv: ...
Finn LeSueur's user avatar
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 ...
Jonathan's user avatar
  • 1,280
2 votes
1 answer
6k views

Command to move a file to a directory even if the directory is not present

Is there a way to move file to a new directory without explicitly creating the directory using mkdir command and then move the file using mv
AbhishekGowda28's user avatar
1 vote
2 answers
988 views

How do I move all files from one folder to a subfolder except .html file using the command line?

I would like to know how can I move all files from folder-A to folder-A's sub-folder except .html file with a command line. Suppose I am in dist folder and there are 50 files and 5 folders. Now I ...
i.maddy's user avatar
  • 13
5 votes
1 answer
1k views

How to move found files to another directory?

Hello to everyone I have the following script that works fine except the mv argument. The script basically searching for the files that were created at a specific time and the I need to move all of ...
michaelpnrs's user avatar
2 votes
0 answers
641 views

zip command throwing error Ubuntu (14.04.5 LTS), Please suggest [closed]

when I am running(zip t3.zip t1.txt) in Ubuntu CLI, its showing error, but generating a random binary file (eg: zin6e9Tx, you can see in 3rd line). # zip t3.zip t1.txt adding: t1.txt (stored 0%)...
ksingh's user avatar
  • 21
0 votes
0 answers
798 views

Accidentally ran the command mv lib/* /usr/lib/* and now many commands like "sudo" and "java" don't work anymore

mv lib/* /usr/lib/* I ran this to move all my files in lib into /usr/lib directory it did move them but up with the above mentioned errors. I was in /home/appu/ directory when I ran the command. ...
Siddharth Pandey's user avatar
3 votes
2 answers
3k views

How do you rename files from one incrementing pattern to another?

I have a group of files that are named as follows: 048. banana.mkv 049. apple.mkv 050. mango.mkv 051. pear.mkv 052. grape.mkv I need to rename those files with the following naming convention 01. ...
GooberHimself's user avatar
0 votes
0 answers
2k views

mv: missing destination file operand when special characters are involved [duplicate]

This one's silly. I saved my vim session with :Obsess -S Session.vim instead of :Obsess Session.vim, so now I have a -S/ Session.vim file in my project and can't open it with vim as the following is ...
arshbot's user avatar
  • 153
1 vote
2 answers
1k views

Use "find" to select a zip file and deplace them with mv

First Im beginning on Linux, I try to select zip files only and move them in an other folder, but it's not working :/ Please help Im completely loosed. The code: find . -type f -name "*.zip" | xargs ...
Maxitonor's user avatar
0 votes
0 answers
25 views

Getting back a moved file from tmp

I used the following command to move my driver file from Downloads to tmp folder, however, after I ran this command the file disappeared: mv ~/Downloads/amdgpu-pro-17.40-492261.tar.xz ~/tmp Now ...
Rick's user avatar
  • 101
0 votes
1 answer
427 views

Moving files into sorted folder based on the filename

So I have this folder of movies that looks like Current movie1 (1962).mkv movie 2b (1993) movie 2b (1993) cd1.mp4 movie 2b (1993) cd1.srt movie 3 (2019).avi movie 1942 (2012).mkv And ...
user289455's user avatar
1 vote
1 answer
172 views

How do I rename files in a directory one-by-one in a loop following a specific pattern set by me?

#!/bin/bash ls > ls_file.txt #item="Variation of gm with constant Vgs and constant drain current bias-mod03lec05.mp4" ############## Above line is just a comment for testing purposes for item ...
Shouvik Das's user avatar
1 vote
1 answer
3k views

Find files and rename and move to another directory

When I run the command find dir_1 -type f -name 'f*' I found 2 files there "file_11" and "file_22". Now I want to move those files to another directory "dir_2" using -exec with the "find" command. ...
mbx20's user avatar
  • 13
0 votes
1 answer
2k views

Bash script automatitation name change using date

I'm new to the shell/bash area. I've created this little script to change a name using the date command. The idea is to get something like this 1.txt=>2020-02.txt And it works, but I get the ...
Alejandro Ruiz's user avatar
0 votes
1 answer
1k views

Moving files inside multiple directories to the root directroy of the folder structure

In this directory listing below I'm trying to move all 'example*.file' into the 'test' directory. I've tried doing something like mv * ./test/ but that only moves the folders and not just the files,...
basod3's user avatar
  • 37
3 votes
1 answer
5k views

Moving files to a different folder, ignore the existing files

I want to move all the files from parent folder to child folder... and ignore the existing files in the child folder, i.e. if img1.jpg exists in both parent and child folder, it should not be replaced ...
Hooman Bahreini's user avatar
2 votes
2 answers
2k views

Files missing after using mv command

I ran /$ sudo mv -f -i FileSystem/* After using the command all my files are missing. Where my files have gone to?
Don Cornell's user avatar
0 votes
2 answers
1k views

zero padding of file names

I want to do zero-padding for names of files. what should I do if not all images exist like 1.JPEG doesn't exist or 99.JPEG or 110.JPEG ? $ for n in $(seq 9); do mv $n.JPEG 0$n.JPEG; done; mv: ...
Mona Jalal's user avatar
  • 4,545
1 vote
1 answer
348 views

Rename all empty folders with `$ empty`

I have many folders that I have ended up with too many empties in the folder names and I need to remove all the empty and leave the folders with $1.empty Of course my logic is flawed here as I am not ...
Jamie Hutber's user avatar
1 vote
2 answers
4k views

How to remove end of file names?

I want to rename a lot of files like 1_16_video1.mp4?1578683110081 & 54_127_video7.mp4?168302 to 1_16_video1.mp4 & 54_127_video7.mp4. How can I rename them?
Mohammad Kholghi's user avatar
0 votes
1 answer
77 views

Are my files lost after I executed mv /parentdir/otherparentdir/somedir/* /parentdir/destdir/?

I was trying to move all the files in a dir to another dir. I got errors at the first 2 attempts but at 3rd attempt it appeared the command did succeed. However the source dir is now empty but the ...
mogarick's user avatar
0 votes
1 answer
352 views

Files disappearing after mv command

I trying to learn how to move files around. I made some test files and directories to practice with. When I try to move a file from one directory to the other, the file just completely disappears. I ...
marcello1988's user avatar
4 votes
2 answers
2k views

How to update timestamp when moving files

In source directory, I have multiple files which all has dot (.) to it. So, when I move I can give like below mv *.* /destination/ But my issue is I want to give timestamp to all the files in ...
Mani Wisdom's user avatar
9 votes
2 answers
10k views

Moving files accidentally to an not existing directory erases files?

I moved all files from one directory using mv and accidentally made a typo in the target location path. The system returned a message that the directory does not exists, but my files from source ...
ben berizovsky's user avatar
2 votes
1 answer
861 views

When moving a directory to another file system, and it runs out of space, are files removed?

Given /mnt/source/ and /mnt/target/ which are two different places / filesystems. mv /mnt/source/dir /mnt/target/ It runs out of space part-way (and stops) Imagining that /mnt/source/dir is full ...
spiralofhope's user avatar
1 vote
1 answer
352 views

How to mv files one by one?

When mv is used between different storages, it first copies all files and then unlinks the source. How to mv files one by one, so that each file is unlinked after being copied, and the folder ...
Barafu Albino's user avatar
0 votes
1 answer
640 views

stop ignore message N: Ignoring file '20auto-upgrades.merge-error' in directory '/etc/apt/apt.conf.d/

When attempting to mv the file I get a permission denied. I am trying to fix the message I get when trying to update N: Ignoring file '20auto-upgrades.merge-error' in directory '/etc/apt/apt.conf.d/'...
postaprayer.org -post a prayer's user avatar
1 vote
1 answer
42k views

mv: missing destination file operand

I am trying to install poweriso, but facing this error. I had successfully extracted the poweriso on the desktop,and found the following code as instruction for further installation- sudo mv -v /home/...
ANIKET JHARIYA's user avatar
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/...
M. Webb's user avatar
  • 711
0 votes
1 answer
189 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
Sehrish Khan's user avatar
0 votes
0 answers
156 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 ...
Felipe Galaz's user avatar
1 vote
0 answers
123 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 (...
user3237111's user avatar
10 votes
5 answers
10k 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 ...
whitelightning's user avatar
0 votes
1 answer
3k 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 ...
stefmz 7's user avatar
1 vote
1 answer
1k 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, ...
Jac O' B GmbH und co. KG's user avatar
0 votes
1 answer
54 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 ...
Rulent's user avatar
  • 9
0 votes
1 answer
394 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 ...
Umer's user avatar
  • 103
0 votes
1 answer
203 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 ...
Rob Pomarico's user avatar