What does the -i option do in the mv command?

The -i option in the mv command stands for "interactive." When you use this option, it prompts you for confirmation before overwriting an existing file in the destination.

Example:

If you run:

mv -i file.txt destination/

And if destination/file.txt already exists, you will see a prompt asking if you want to overwrite it. You can then choose to proceed or cancel the operation.

Purpose:

This option helps prevent accidental data loss by ensuring you confirm any overwrites.

0 Comments

no data
Be the first to share your comment!