<commit_before>---
title: Bash mv
---

## Bash command: mv

The mv command is used to move files and folders.

### Usage

```
mv <source> <path + filename>

```

The first argument is the file you want to move, and the second is the location to move it to. It can also be used to rename a file, by inputting 2 file names as parameters, like so: `mv originalFilename.txt newFilename.txt`

Commonly used options:
- `-f` to force move them and overwrite files without checking with the user.
- `-i` to prompt confirmation before overwriting files.
- `-n` do not overwrite an existing file

### Warning

This command is capable of modifying many files at once with ease.  This can be beneficial, but also dangerous. Use at your own risk

### More Information:
* [Wikipedia](https://en.wikipedia.org/wiki/Mv)
* [SS64](https://ss64.com/bash/mv.html)<commit_msg>Added the text "-T to prompt confirmation before overwriting files." to the article (#28217)<commit_after>---
title: Bash mv
---

## Bash command: mv

The mv command is used to move files and folders.

### Usage

```
mv <source> <path + filename>

```

The first argument is the file you want to move, and the second is the location to move it to. It can also be used to rename a file, by inputting 2 file names as parameters, like so: `mv originalFilename.txt newFilename.txt`

Commonly used options:
- `-f` to force move them and overwrite files without checking with the user.
- `-i` to prompt confirmation before overwriting files.
- `-n` do not overwrite an existing file
- `-T` to rename a file named source to destination

### Warning

This command is capable of modifying many files at once with ease.  This can be beneficial, but also dangerous. Use at your own risk

### More Information:
* [Wikipedia](https://en.wikipedia.org/wiki/Mv)
* [SS64](https://ss64.com/bash/mv.html)
{'fraction_non_alphanumeric': 0.09940249864204237, 'fraction_numerical': 0.008147745790331342, 'mean_word_length': 3.8219895287958114, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '911385', 'n_tokens_mistral': 563, 'n_tokens_neox': 523, 'n_words': 265}