Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [mv]

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

Filter by
Sorted by
Tagged with
2
votes
2answers
363 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
981 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 ...
2
votes
1answer
190 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
53 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
986 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
383 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
83 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
403 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 | |--...
1
vote
0answers
29 views

error using mv to rename files in shell script [duplicate]

I am trying to rename all files in a directory using mv but it isn't working. My code is: id= '29 10 15' for zzvar in ${id} ; do mv /media/storage/DTI/vgcross_sj${var}* /media/storage/DTI/...
0
votes
1answer
475 views

Moving large files with cronjob: What happens if mv still running when next run? [duplicate]

On a Ubuntu 16.04 headless system, I have two directories. I want a cronjob to move every file from directory A to directory B (same partition, same hard drive, same file system etc.). The problem is/...
0
votes
2answers
55 views

Moved some files and they're no longer found

I had some times in /var/WWW/html, I wanted to move them into a directory in same folder but since I couldn't move folder into itself so decided to move all files from /html to `/var/WWW, so I did: ...
4
votes
3answers
828 views

How do I dissolve all subfolders

Is there a command line one-liner to move all the contents of all the direct subfolders of a folder to the folder itself and deleting the subfolders (which are now empty)? I.e., eliminate a level in ...
1
vote
2answers
65 views

Move folders that have an apostophe in their name

Hoping this is an easy one - can't quite get it to work. I need to move all folders, and content (no sub folder) that have at least one apostrophe/quote in their name. Any pointers?
1
vote
0answers
48 views

Recover data from external hdd that was moved

I have moved some files from my external HDD (NTFS system), then had some problems with PC where I had to format it. Is there any way to recover data that I moved from the HDD two days ago?
6
votes
4answers
45k views

How to copy (or move) files from remote machine to local machine?

I SSH tunneled from my local Ubuntu machine to a remote Ubuntu machine and I want to copy/move files from the remote Ubuntu to the local one. I need to do that from within the SSH session (i.e, from ...
1
vote
1answer
82 views

mv files from one folder to another 40GB at a time

I have a folder /x/ with lots of sub folders and sub files. I need to move everything in /x/ to /y/ but I need to do so 40GB at a time. I was doing mv /x/a* and then the next day mv /x/b* but ...
9
votes
6answers
2k views

How to move Only the files in current folder to a sub folder?

I don't have to move the folders, only the files. I have tried mv * but this command moves the folders also.
3
votes
3answers
822 views

Renaming date-stamped files to the previous day

I want to rename the files in a directory to sequential numbers, based on this rule : filename-[some date] => filename-[previous day's date] For example, file20170329 file20170328 and file20170327 ...
6
votes
4answers
1k views

with mv, consider the path/name of the original file when choosing destination [duplicate]

Say I need to move the file /etc/dir1/dir2/dir3/a.out to /etc/dir1/dir2/dir3/b.out Typing the whole path twice is tedious, and going to the directory might not be ideal. Is there a way to do such a ...
1
vote
0answers
1k views

move error mv: cannot stat 'foldername': Input/output error

I try to move a folder to another one, but this error appears: mv: cannot stat 'Anim': Input/output error I even can not open that directory in file manager. Why this happens?
12
votes
3answers
1k views

Change directory to target of move operation

Occasionally, I have edited some file and want to move it to a different folder. (Typically: to a Dropbox folder, where I did not want to work to avoid giving the other owners of the folder constant ...
3
votes
1answer
15k views

mv: cannot create directory permission denied

:/usr/share/blender/datafiles$ mv "/home/bob/Documents/uncompressed files/filmic-blender-master" /usr/share/blender/datafiles mv: cannot create directory '/usr/share/blender/datafiles/filmic-blender-...
3
votes
2answers
4k views

What is the easiest method to move files into current directory in terminal? [duplicate]

I was wondering if there was a cleaner method to move files into the current directory than this: mv path/to/file ../current_directory If I wanted to move a file to the directory above I could go: ...
1
vote
2answers
130 views

Recursive rename to remove the end of multiple filenames in a folder

I would like to rename multiple files in one folder. I am looking to keep all of the original filenames minus the tag at the end. for example I have: FILE1[file].doc FILE2[file].doc FILE3[file]....
0
votes
1answer
4k views

Move folder into another folder using sudo

I'm trying to move a folder into another folder with sudo. (I'm a beginner!) I tried this: sudo mv /home/mirko/Documenti/Bifurcation%20%20Control/PROPAC/ProPac_53 /usr/local/Wolfram/Mathematica/11.0/...
2
votes
1answer
66 views

what happened and why? moved file to wildcard, now cannot find moved file, contents of new location has missing files

Sleepy me this morning moved folder from location A to B I was currently in the directory of B and instead of using . i used an * mv /home/user/temp/ * Before doing this, directory B had 4 folders ...
3
votes
1answer
214 views

Move files to parent directory, prefixing file name with former subdirectory name [duplicate]

I have a folder parentdir with many directories like this: $ tree parentdir/subdir_1 parentdir/subdir_1 ├── important.txt ├── important_001.txt ├── important_002.log ├── important_007.bmp ├── ...
1
vote
1answer
768 views

Copying files from home directory to computer directory

I am trying to copy a .php file from my Documents directory to /var/www/html. I would do this in the GUI, but I don't have root access, only in the terminal. How would I go about doing this?
0
votes
1answer
137 views

How do I remove/overwrite “phantom” files?

I was moving a pile of MP3s from my Music folder to an external HDD (it is fat32, if that matters), when I realized that I should not have selected "apply to all" when I told it to "Overwrite" for one ...
4
votes
3answers
1k views

Renaming files with last modified time on file name

I am trying to rename a file with the mv command and I would like to add the last modified date of this file (with YYYYMMDD format) on the file name and move it to other folder. I got the current ...
0
votes
2answers
94 views

Do not understand where files have been moved by find + exec

I wanted to copy all my pdfs to a pdf folder, for that I used this find command with the -exec option. Before I started, I created a folder named pdf in this current folder sudo find . -type f -...
0
votes
1answer
295 views

mv file back to orginal folder in Linux

I'm relatively new to Linux and had a bit of help so far (thank you all) My delete code works exactly how I wanted. Now I'm looking to expand it and restore the file back to the original folder. ...
2
votes
1answer
75 views

moving (user input) files to another location

I'm totally new to Linux and trying to do a simple move with user input like this: echo "where do you want to move the file to?" read location mv ~/my-applications/bin/trash/* $location This works ...
6
votes
2answers
3k views

How to move output of find command to another directory?

I want the output of this command find /home -name *.pdf to move the files in the search result to another directory, e.g. with a pipe. How can I do that?
1
vote
0answers
347 views

Moved bin directory and other folders

I have done the typical newbie error and have moved important bash folders by mistake using the command; sudo mv /* ../../../../../programmingajax.com/ This has then gone and moved lots of important ...
7
votes
4answers
2k views

Move only the last 8 files in a directory to another directory

I'm trying to move the last 8 files from the Documents directory to another directory, but I don't want to move them one-by-one to that specific directory. Is it possible to move them with a ...
3
votes
1answer
656 views

mv command deleted a folder

I am new to linux. I had a folder called "Código" where I kept all of my .h's and .cpp's when I programmed. I wanted to move said folder up one directory and into a new folder called "Code", so in the ...
5
votes
3answers
818 views

Move to directory that was no directory

I did this: mv couchpotato_11-08-2016_09-35.tar.gz ~/AtoMiC-ToolKit/backup mv transmission-daemon_11-08-2016_09-36.tar.gz ~/AtoMiC-ToolKit/backup mv sickrage_11-08-2016_09-35.tar.gz ~/AtoMiC-ToolKit/...
1
vote
2answers
1k views

Moving only the first file from any directory to current one

I have two directories which are called 1 and POSCARS and there are files in the POSCARS directory. I want to move only the first file from the POSCARS directory to 1 directory while I am in the 1 ...
0
votes
1answer
538 views

File lost using mv [closed]

Went to directory where 7z file was located. Used this command mv file.7z /Home I was logged in as root to get to the directory where the file was located and launched the command as root. Now I ...
2
votes
1answer
279 views

How to pass to tar.gz a file after rename using xargs?

I'm trying to rename log files and make tar them as 'tar.gz', I ended with below command but it doesn't get the renamed file name from STDIN (output of mv command) and it causes the tar command to ...
4
votes
2answers
6k views

mv error in shell script “are the same file”

I'm trying to get a script that will rename and move videos. Here is what I have: #!/bin/bash src="/mnt/Files_Apps/temp/" dest="/mnt/Files_Apps/TFTP root/" for file in "$src"*.*; do newfile="${dest}...
0
votes
2answers
5k views

How to move all files from one folder of a different partition in terminal?

I am new to GNU/Linux, but I'm trying to learn it and already deleted my Windows OS (yeeeaahhhhh). Now I've already done the operation dragging the files in Nautilus, but i wanna know how to do it in ...
1
vote
1answer
738 views

Moved a file with mv, now I can' t find it anymore!

This is the command I used! sudo mv '/home/alex/Desktop/elementaryos-0.4-stable-amd64.20160921.iso' Computer I can't find it anymore, I wanted it to put it on Computer to make sure that UnetBootin ...
0
votes
1answer
122 views

Why does mv work so slowly renaming files in my SD card?

The SD card is in a phone which is tethered to the computer. % pwd /run/user/1000/gvfs/mtp:host=%5Busb%3A003%2C007%5D/SanDisk SD card % date && mv f759fdradio_ga_ga.mp3 radio_ga_ga.mp3 &&...
5
votes
3answers
391 views

Renaming files by adding “cycling” suffix

I have a directory containing subdirectories containing many files named as: file1.tif file2.tif file3.tif file4.tif file5.tif file6.tif file7.tif... I want to add a "cycling" suffix c1, c2 and c3, ...
2
votes
1answer
227 views

Move files that are different to another folder

OK, so I have a very large iTunes library and recently decided to sort through it and organize it in a much neater way than just throwing all my music in a folder and hoping for the best. So after ...
2
votes
1answer
503 views

Accidentally moved the Desktop to nowhere and it's gone even on restart

Damn! That's why someone said once, "Don't do other things while you are hungry". Basically, I was hungry and at that point of time I had to move a directory inside Desktop to another directory. What ...
0
votes
1answer
635 views

How to move files in perl recursively

How can i move all files in a directory to the previous directory in Perl using system command ? I tried the following method and it showed error system('/bin/mv "test/*" , "./"'); bash: syntax ...