People who code: we want your input. Take the Survey

Questions tagged [mv]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
25 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 ...
1
vote
1answer
41 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 '...
0
votes
2answers
42 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{...
2
votes
1answer
88 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 ...
0
votes
1answer
25 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 ...
1
vote
2answers
45 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 ...
0
votes
1answer
64 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 ...
2
votes
1answer
128 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 ...
14
votes
1answer
4k 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 ...
0
votes
0answers
22 views

How to overwrite contents of a dir without deleting anything? [duplicate]

In the curr directory, I have folder certs. certs - a - b - c /another/location may or may not contain certs(a,b,c) folder already. Problem: mv certs /another/location gives error - directory ...
0
votes
2answers
227 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 './*....
0
votes
1answer
67 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 ...
0
votes
0answers
47 views

How to Copy All Image Files On Entire Disk Into One Directory

I'm looking for a command to copy all image files (.jpg, .jpeg, .png, .avi ...) from entire disk (all directories and sub) into one directory. I've seen other question/responses on this topic on other ...
0
votes
1answer
38 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 ...
0
votes
1answer
77 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 ...
0
votes
0answers
47 views

No rename/move on mounted fritz.nas usb harddrive (touch,cp,rm works)

Trying to rsync files from my little ubuntu nas to a fritz.nas (7490) with usb harddisk attached as a simple BackUp solution. fritznas / hardisk ist mounted. I may touch, copy, remove, change (eg. ...
0
votes
1answer
55 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 ...
0
votes
1answer
96 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 ...
0
votes
0answers
56 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 '...
4
votes
1answer
162 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 ...
0
votes
3answers
980 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-...
0
votes
1answer
104 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 ...
1
vote
1answer
961 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: ...
0
votes
0answers
50 views

Lost my qcow2 images trying to make a backup and move them

In the past I've used DD to make backups- however it was late, and I resorted to just googling how to move my qcow2 VMs (using virsh) which resulted in losing everything. I created a subdirectory and ...
0
votes
0answers
57 views

mv or cp all but one file/directory [duplicate]

I often use mv ./* DEST or cp -r ./* DEST to move/copy all files and directories from the current directory to another. But what if I want to move/copy all but one file/directory?
0
votes
1answer
506 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 ...
1
vote
1answer
127 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
1
vote
2answers
179 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 ...
0
votes
0answers
73 views

I tried this command now I cannot find my file after running sudo mv K8s.odt /Desktop [duplicate]

I used this command from home to move the file to my desktop and now I cannot find it sudo mv K8s.odt /Desktop
5
votes
1answer
211 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 ...
2
votes
0answers
250 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%)...
0
votes
0answers
190 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. ...
3
votes
2answers
168 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. ...
0
votes
0answers
872 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 ...
1
vote
2answers
82 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 ...
0
votes
0answers
14 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 ...
0
votes
1answer
232 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 ...
1
vote
1answer
77 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 ...
1
vote
2answers
1k 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. ...
0
votes
1answer
794 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 ...
0
votes
1answer
371 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,...
1
vote
1answer
1k 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 ...
1
vote
2answers
358 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?
0
votes
2answers
153 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: ...
1
vote
1answer
159 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 ...
1
vote
2answers
1k 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?
0
votes
1answer
70 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 ...
0
votes
1answer
163 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 ...
4
votes
2answers
668 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 ...
9
votes
2answers
5k 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 ...

1
2 3 4 5