14. Terminal Commands#

mv <source> <destination>

Move and optionally rename file or directory.

-f, --force

Do not prompt before overwrite. Not safe so use carefully.

-i, --interactive

Interactive mode. Prompt before overwrite.

-n, --no-clobber

Do not overwrite an existing file. Do not prompt if a move has been skipped to avoid overwrite.

If more than one of -f, -i, and -n only the final one will take effect.

mv <source> .

Move <source> to current directory.

TIP: In most cases use -i to avoid overwriting unintended existing files.


su <username>

Switch the current user to <username>.