mv is a move/rename file in Linux

learn more… | top users | synonyms

-4
votes
1answer
35 views

Bash script to move certain files to specific directories? [closed]

I'm looking for a script that can move files from one directory into another, however each file has a different name and its name corresponds to what folder it should be moved to. For example: file ...
0
votes
0answers
30 views

how to rename multiple files by replacing string in file name? this string contains a “#” [migrated]

How to replace a text string in multiple files in Linux How to rename multiple files by replacing word in file name? Replace string in files with certain file extension Searching a number of files ...
2
votes
1answer
44 views

CentOS - Accidentally Moved and Removed /home/ folders

I ran (stupidly) these commands: mv ncdu/ /home/* mv ncdu/ /var/* Trying to move the ncdu folder into these directories. And it caused me to remove all my Apache directories in my /home/ folder, ...
0
votes
2answers
15 views

used mv file.sql /folder instead of mv file.sql folder/

Hello I made the mistake of using mv file.sql /destinationfolder instead of mv file.sql destinationfolder/- using su root. Now I can't find my sql file. is there a way to find it/recover it?
2
votes
1answer
517 views

FREENAS: Why isn't mv command instant within a RAIDZ1 volume?

I'm currently 'reorganizing' file structure within a RAIDZ1 volume. Moving directories from one dataset to another, which are both contained on the same volume. SSH'ed into the machine and did a ...
0
votes
1answer
65 views

SSH find directories with uppercase letters [closed]

Using SSH how can I find sub-directories that begin with uppercase letters within a directory and then rename them, including merging if the lowercase named directory already exists? e.g. if there is ...
0
votes
1answer
103 views

Script to move Maildir contents to its parent dir but for multiple folders

I totally suck at Bash/Python/Ruby/Perl Scripting (need to practice/learn some more) so I'm asking for a little help :-) I need to move about the contents of about 60 Maildirs to their parent folder ...
0
votes
1answer
277 views

Root cannot move files

I'm on Debian 5, I want to move files, but I'm getting a permission denied error, even if I'm root. Do you have any solutions? -rw-rw-rw- 1 scusr scusr 49901 Jun 17 09:04 ...
0
votes
1answer
186 views

Permission denied with mv under apache

I have a bash cgi script called by apache which should move one file in /var/www/html to another in the same directory. I've set up the relevant permissions with selinux (e.g. chcon to ...
1
vote
1answer
124 views

Remote rename of a file on Samba share via Bash script

I'm running a Bash script under Cygwin, but this question applies more broadly. I have a remote file: //someremoteserver/somefile.db That "//" path is under Cygwin--it's essentially a UNC pathname ...
1
vote
4answers
516 views

move files from one device to another

I am trying to automate a remote backup on our centOS server, I run the current command : nice -n 10 mv -vfb /media/localbackup/* /media/remotebackup/ however when this is ran I get the following ...
0
votes
1answer
37 views

Linux directory moved

a directory was moved with mv command in a Linux box, what logs should be looked at for such action? in root bash_history i can see the command was used, unfortunatly bash_history was not recording ...
1
vote
1answer
116 views

Error when using mv

I am receiving an error when trying to mv some files that really doesn't make sense. I receive this error: mv: cannot move `thatDir' to a subdirectory of itself, ...
0
votes
1answer
814 views

Can't move large files, always get Input/output error after some time

I want to move a large file (hdd of a paralells vm, 81G) from one hd to another. After some time I get the error message: Input/output error. What can I do to move the file? I checked source and ...
-1
votes
3answers
105 views

Rename tons of files

How can I rename all the files with a pattern like this: thumb_f318d8a580ca5717d686a323b6c2ca0d.jpg0000777 thumb_f18d8aup90ca5717d686a323b6c2c5uh.jpg0000777 ...
2
votes
2answers
883 views

linux shell script: how to move all sub folders with a given name?

I'd like to move all sub-folders starting with a given suffix (Blah_ in the example) into an other directory using a linux bash script. Here's what the script looks like: srcDir="/home/me/" ...
3
votes
6answers
656 views

How to mass move files one directory up

I have about 200 directories in /home/. The problem is that they all exist in this way: /home/{user}/homedir/ While it should just be: /home/{user}/ With what command can I mass move all content ...
1
vote
2answers
139 views

Delete all files via mv date?

Everyday new audio files are created in dir1. Sometime I move (mv) some files from dir1 to dir2 I want to delete all the files in dir2 that was moved before 20th June Is this possible?
3
votes
1answer
5k views

Command: move all files inside a directory to another directory (including hidden files)?

I tried to move all files inside a directory to another directory like this: $ mv /directory_one/* /directory However, the hidden files (such as .htaccess) in /directory_one won't be moved. What ...
4
votes
5answers
241 views

How to rename libc.a back

I am working on AIX 6.1 and inadvertently renamed /usr/lib/libc.a to usr/lib/libc.a_ Just as I renamed I realized my stupid mistake. Almost all of the commands mv, cp, ftp etc ( except cd ) have ...
2
votes
2answers
70 views

*nix behavor, when overwriting a file that's open by another process using mv

Will the other process be able to finish reading the old file even though it's been replaced?
1
vote
2answers
3k views

What's faster for copying files from one drive to another? [closed]

Running linux. I have two identical drives mounted on the same machine. What is faster CP, MV, or RSYNC? Why is one faster than the other? Are there any faster alternatives?
1
vote
2answers
708 views

used mv command and my whole filesystem is missing

Alright, so I was in /var/www/forum/newrelease What I wanted to do was copy all of the files in newrelease to the directory forum, so I was thinking the command mv /* ../* would work, but now ...
1
vote
2answers
190 views

File move in Perl that stops the current script?

how can I do this mv ($file $new_file/$1) or die("Errors 2"); so it would stop the script in terminal if the file is not found? otherwise it keeps repeating and repeating and I need to restart putty ...
0
votes
3answers
2k views

copy and rename files

Here are my access logs those I want to backup. /var/log/httpd/access_log /var/log/httpd/access_log.1 /var/log/httpd/access_log.2 /var/log/httpd/access_log.3 ... I want to copy all these files but ...
12
votes
1answer
4k views

mv, rename if exists

I need to assemble a lot of images into one directory. Many of those images have the same file names. Is there some safe version of mv that will automatically rename files if the target filename ...
0
votes
2answers
1k views

cannot move to a subdirectory of itself

I have 2 folders: /home/sphinx/articlesdb/ and: /home/sphinx/tmp/articlesdb/ I want to move and overwrite all of the files from tmp into the main folder. I am currently using: mv -f ...
0
votes
1answer
954 views

Cannot move folder to a subdirectoy of itself - What's going on?

O.K I am trying to do the following very simple command and it is failing as follows... mv '/home/admin/Downloads/folder1' '/home/admin/MyLibrary/MyVideos/TV/folder1/' mv: cannot move ...
14
votes
9answers
34k views

Linux (mv or cp) specific files from a text list of files?

I have a directory of many files, something like 50,000 pdf's and other files on a server. I need to move specific ones to another directory. I can generate a list of the files that need to be moved ...
1
vote
3answers
3k views

mass mv using find?

there are a bunch of filename.gif scattered in /home/ directories. I want all the filename.gif replaced by a /home/shared/filename_default.gif. I tried something like find /home/ -name ...
0
votes
3answers
308 views

linux mv command weirdness

can anyone tell me why when I type: mv -f ./tmp/members ./ I get: mv: cannot move `./tmp/members' to a subdirectory of itself, `./members' And moreover the correct way to move this directory? ...
2
votes
1answer
3k views

mv directory to overwrite another

I may be going bonkers here, but I'm trying to move a directory to a new location, overwriting the contents (on Linux, using bash). Everytime I try it, it responds with "mv: cannot move `./src' to a ...
12
votes
6answers
26k views

How to recursively move all files (including hidden) in a subfolder into a parent folder in *nix?

This is a bit of an embarrassing question, but I have to admit that this late in my career I still have questions about the mv command. I frequently have this problem: I need to move all files ...
0
votes
3answers
1k views

How can I recursively change the case of files and folders under bash

I have some files and folders that are all in uppercase that I want to rename to their lowercase equivalent. What would be the best way to go about doing this in bash on a Linux system? As an example ...