Questions tagged [mv]

mv is a move/rename file in Linux

mv is a tool to move/rename files/folders under *nix.

Command manual.

56 questions
2
votes
1 answer

NGINX and log rotation: is missing log entries possible?

In it's simplest realization, one can implement NGINX log rotation as following: mv access.log access.log.0 kill -USR1 `cat master.nginx.pid` My question. Do we have a concurrency issue here? I mean, if NGINX writes a log entry between two actions…
user1065145
  • 295
  • 4
  • 9
2
votes
1 answer

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, except virtfs (cPanel). As you can imagine, It's…
Moe
  • 167
  • 1
  • 1
  • 8
2
votes
4 answers

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 error and no files are moved mv: inter-device move…
Neo
  • 187
  • 3
  • 10
2
votes
2 answers

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/" archiveDir="/Archive/" prefix="Blah_" mv -v -f…
Tolaksa
  • 165
  • 1
  • 1
  • 6
2
votes
2 answers

*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?
user533020
  • 23
  • 2
1
vote
1 answer

UNIX Copy/Move files in same directory preserving timestamp

Following is the scenario. There are multiple files in a directory created by users belonging to same unix group. Unix Group: Prod. User in Prod Unix Group: User1 User2 User3. All 3 users have same privileges. Scenario 1 If user3 wants to become…
Jolly J
  • 21
  • 2
1
vote
0 answers

The command "mv test_file TEST_FILE" fails with "mv: ‘test_file’ and ‘TEST_FILE’ are the same file" in a CIFS filesystem

I have a CIFS filesystem mounted in an Oracle Linux 7 server: //win-server/shared-folder on /data1/shared_folder type cifs…
1
vote
1 answer

Recovering original filename after renaming in Ext4

If I rename a file with mv command like: mv original_file_name new_file_name Is this possible to recover the original filename on Linux Ext4 file system and if so how that can be done?
user164863
  • 117
  • 7
1
vote
1 answer

Unix move folders with pattern

How can I move subfolders with a pattern to the new location? Example list of sources: /data/aaa/_old/ /data/bbb/_old/ The destinations should be: /archive/aaa/_old/ /archive/bbb/_old/ Is there a way to do this with a regular expression and…
Oliver
  • 121
  • 3
1
vote
0 answers

LMD/Maldetect: Missing target-file operand after

After running mallet 1.5 in screen-mode (# maldet -a /var/www) I'm getting this return: maldet(6070): {scan} 618017/618044 files scanned: hits 0 cleaned/usr/bin/wc: /usr/local/maldetect/tmp/.sess.6070: Datei oder Verzeichnis nicht…
MyFault
  • 893
  • 3
  • 14
  • 35
1
vote
1 answer

Detect USB driver plugged in and run a certain file on it

I have some kind of a kiosk Ubuntu set up based on Ubuntu Server 14.0.2 which runs an application on chrome. The kiosk has no internet connection thus the updates to the application should be done manually. I want the update process to be as easy as…
kfirba
  • 111
  • 1
1
vote
2 answers

On Debian, what command will return the file with the "smallest" filename from a directory?

I have a directory containing three files, for example, 5.war, 6.war and 7.war. What command will return the file with the "smallest" filename from this directory? (In this case, 5.war.)
Jerome Ansia
  • 261
  • 1
  • 2
  • 9
1
vote
1 answer

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 on a Windows network (in this case), so call it…
Dan
  • 61
  • 2
1
vote
1 answer

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, `/usr/local/apache-tomcat-6.0.32/webapps/thatDir' When running the following command…
Inversus
  • 123
  • 5
1
vote
2 answers

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?
I'll-Be-Back
  • 693
  • 3
  • 9
  • 24