MV and RM Options Flashcards

(10 cards)

1
Q

What does mv -i do?

A
  • Prompts for confirmation before overwriting existing files
  • Prevents accidental data loss when moving files to locations with existing files
  • Interactive mode that asks “overwrite filename? (y/n)” before proceeding
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How does mv -u work?

A
  • Updates - only moves files if source is newer than destination or destination doesn’t exist
  • Prevents overwriting newer files with older versions
  • Useful for backup operations and synchronization tasks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is mv -v used for?

A
  • Verbose mode - shows what files are being moved/renamed
  • Provides feedback on the operation’s progress
  • Helpful for confirming actions and debugging move operations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When would you use mv -n?

A
  • No-clobber mode - never overwrites existing files
  • Safer than default behavior when you want to preserve existing files
  • Opposite of -f (force) option
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does mv -f accomplish?

A
  • Forces the move operation without prompting for confirmation
  • Overrides any interactive prompts or write protection
  • Use with caution as it can overwrite files without warning
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does rm -i do?

A
  • Prompts for confirmation before removing each file
  • Interactive mode that asks “remove filename? (y/n)”
  • Essential safety feature to prevent accidental file deletion
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the purpose of rm -r or rm -R?

A
  • Recursively removes directories and their contents
  • Required to delete non-empty directories
  • Extremely dangerous - can delete entire directory trees
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does rm -f differ from regular rm?

A
  • Forces removal without prompting, even for write-protected files
  • Ignores non-existent files (no error messages)
  • Bypasses confirmation prompts and permission restrictions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does rm -v provide?

A
  • Verbose mode - shows each file as it’s being removed
  • Provides feedback on deletion progress
  • Useful for confirming what files are actually being deleted
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why is rm -rf considered dangerous?

A
  • Combines recursive deletion with force option
  • Deletes entire directory trees without any confirmation prompts
  • Can cause catastrophic data loss if used incorrectly (especially as root)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly