Questions tagged [mv]

mv is the Unix command to rename or move a file or directory.

mv is the Unix command to rename or move a file or directory.

Syntax:

mv - move (rename) files

Examples:

mv /my/dir /my/other/dir

References:

Related commands

625 questions
-1
votes
2 answers

How to copy a file in one directory and move it to the other?

So, I am currently in my lab6 folder. In that folder, I have a makefile that is very similar to the one I need in lab7. So, I just want to copy that makefile in lab6 and move it to lab7. My current directory is…
CodeFreak
  • 90
  • 1
  • 2
  • 15
-1
votes
2 answers

Rename a file that begins with "-"

Well it looks like I got myself stuck. There's no GUI on this system as I have to PUTTY in. File begins with the "-" sign and I can't seem to escape out of it with \, " or '. mv -output.txt output.txt mv: invalid option -- 'o' Try `mv --help' for…
Jon17
  • 73
  • 6
-1
votes
2 answers

ubuntu mv file disappeared

On ubuntu, I have the following directory structure: /var/www/html I am in www and I decided to move a file from this directory to html. I executed the following: mv myfile.iso /html Now I cannot see the file. Apparently I did not use the command…
Kamil
  • 968
  • 1
  • 8
  • 18
-1
votes
1 answer

Linux Bash Rename files

I got files like this: ./abc/woinewi.mp3 ./def/mqwoifkwe.MP3 ./ghi/ioqfnw.wmv ./xxx/powijfqiwj.WMV ./yyy/qjwdweo.Mp3 The sub-dir name is unique.I want to rename them by bash command or scipts to…
Leesy
  • 11
  • 1
-1
votes
1 answer

Rename multiple mp3 files using track number from old name

I wanted to organize my mp3 files and rename them using the pattern track##.mp3 where ## is track number. I need a regular expression that selects the track number, which is the first two characters in the old name. Example: 01 - Album Artist -…
janci
  • 49
  • 6
-1
votes
1 answer

Moved a file to another directory in Unix. File is no longer in the original directory, but never showed up in the destination directory. Why?

I am having a problem with something seemingly very simple in Unix. I used the following code to move a file to another directory: mv genes.gtf ./ ../.. The file is no longer in the original directory, but it has not shown up in the destination…
mshum
  • 257
  • 3
  • 15
-1
votes
2 answers

Linux mv command with time adding spaces

This is my bash script to copy a csv file to a new file that has the timestamp added to the end it is then copied to another server. #!/bin/bash timestamp=`date +"%Y%m%d%H%M%S"` ssh root@172.16.1.125 mv /var/log/asterisk/cdr-csv/Master.csv…
Jed
  • 929
  • 2
  • 19
  • 32
-1
votes
1 answer

Moving files to a relative directory matching - spam handling

I am setting up a script to learn spam from a maildir folder ".LearnAsSpam" After the spam is learnt, I'd like to move all spam to the ".Junk" folder for all users: ie: /home/vmail/domain1/user1/Maildir/.LearnAsSpam/cur/*…
FGiorlando
  • 1,121
  • 2
  • 12
  • 22
-1
votes
2 answers

Remove zeros inside file name

I have this file name 1006_12_000123123_000023126.data and I want this file name. I have arround 300000 files. 1006_12_123123_23126.png I tried som of these solution, but they are for filename like 00002323.jpg Bash command to remove leading zeros…
Maros Mayer
  • 67
  • 1
  • 7
-1
votes
1 answer

mv command not working as intended on linux CENT/REDHAT OS

This is with respect to recent issue that has been faced by me. Suddenly post exection of a mv command Linux box went un-responsive on various front, below is the overall description of the issue that happened. 1) move command executed with /* in…
-1
votes
1 answer

UNIX command to move multiple files to multiple subdirectories?

I work in an X11 window on a MAC OS X machine. Now I have hundreds of files in one directory, each file name containing a substring such as "1970", "1971",..., "2014", etc. indicating that the file is for that year. Now I have just created…
-1
votes
1 answer

Cannot stat mv, file not found

could somebody please help me find the problem with this code? getting this error "mv: cannot stat '~Desktop/RecyclingBin/testtest' : No such file or directory. It does exist and it is in the location ~Desktop/RecyclingBin/testtest…
user3437235
  • 92
  • 3
  • 9
-1
votes
1 answer

BASH: batch rename files with infix

I have files '/my/file_{01...10}.mat' that I'd like to rename to '/my/file_ABC{01..10}.mat' such that 'file_01.mat' becomes 'file_ABC01.mat', 'file_02.mat' > 'file_ABC02.mat',... and so on. I've found a number of ways to append strings in a script…
common_currency
  • 141
  • 1
  • 1
  • 5
-1
votes
1 answer

Bash Scripting: "Dump" directory using mv - current directory

I'm writing a bash script that dumps a specified directory into a destination directory (or the current directory if no destination is specified.) The script works fine if the destination directory is specified, but when I try to use the current…
sotrh
  • 386
  • 5
  • 13
-1
votes
1 answer

Bash rename via FOR

How can i batch rename my files with specific command by mv? find /opt/media/rec -maxdepth 1 -type f -name '*.mp4' -mmin +1 -exec basename {} \; | awk -F_ -v OFS="_"…
NZT
  • 53
  • 5
1 2 3
41
42