mv -i not working [SOLVED]

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
chowse
Level 2
Level 2
Posts: 87
Joined: Sun May 14, 2017 10:02 am

mv -i not working [SOLVED]

Post by chowse »

Title says it all.
instead of prompting me it just executes the mv
isn't mv built into bash?
I can't think of a way to fix this.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Some people make happiness wherever they go, others whenever they go.
User avatar
karlchen
Level 23
Level 23
Posts: 18173
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: mv -i not working

Post by karlchen »

Hello, chowse.

I assume that you over-interpret the option -i ... interactive. It does not ask before every single move, but only in case a move operation would overwrite an existing file.
Cf. the output of:

Code: Select all

mv --help
Usage: mv [OPTION]... [-T] SOURCE DEST
  or:  mv [OPTION]... SOURCE... DIRECTORY
  or:  mv [OPTION]... -t DIRECTORY SOURCE...
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.

Mandatory arguments to long options are mandatory for short options too.
      --backup[=CONTROL]       make a backup of each existing destination file
  -b                           like --backup but does not accept an argument
  -f, --force                  do not prompt before overwriting
  -i, --interactive            prompt before overwrite
  -n, --no-clobber             do not overwrite an existing file
  [...]
Regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
chowse
Level 2
Level 2
Posts: 87
Joined: Sun May 14, 2017 10:02 am

Re: mv -i not working

Post by chowse »

Thanks for the reply.
so this is not an overwrite? $ mv -i while.sh WHILE.SH
Could you please give an example?
Last edited by karlchen on Thu Jan 20, 2022 6:25 pm, edited 1 time in total.
Reason: removed unneeded full quote of the post right above this one
Some people make happiness wherever they go, others whenever they go.
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: mv -i not working

Post by Flemur »

chowse wrote: Thu Jan 20, 2022 5:00 pm so this is not an overwrite? $ mv -i while.sh WHILE.SH
Could you please give an example?
Linux is case-sensitive, so those are two different files. This would be an over-write:

Code: Select all

mv -i while.sh while.sh 
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
chowse
Level 2
Level 2
Posts: 87
Joined: Sun May 14, 2017 10:02 am

Re: mv -i not working

Post by chowse »

GOT IT!!
Thanks very much
Last edited by karlchen on Thu Jan 20, 2022 6:26 pm, edited 1 time in total.
Reason: removed unneeded full quote of the post right above this one
Some people make happiness wherever they go, others whenever they go.
Locked

Return to “Software & Applications”