Skip to content

Commit 8b750b3

Browse files
authored
Merge pull request #407 from kyorkston/feat/mv-commandline
Add 'mv' command to command line intro tutorial
2 parents ab9e938 + d9a9dba commit 8b750b3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

command-line/introduction/tutorial.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@ $ touch bobs.txt
122122

123123
Do an `ls` to check whether the file has been created. Inside bits, there should be a new file called bobs.txt. We used `touch` to create files. With touch you can create files with any extension, just don't forget to specify what kind of file you are creating: for example, `index.html`, `script.js`, `style.css` are all valid extensions.
124124

125+
### `mv` or move item
126+
127+
What if you created a file in the wrong place? There's a command for that. Let's move `bobs.txt` to somewhere new. Inside the `bits` folder type:
128+
129+
```bash
130+
$ mv bobs.txt ..
131+
```
132+
133+
Type `ls` and the file is no longer there. Type `cd ..`, this moves you one folder up to the `stuff` folder. Then type `ls` and the bobs.txt file will be there. There are 3 parts to this command, the `mv` command, the item to be moved, here it's `bobs.txt`, and the new destination for the item, here we have it as `..` or one directory up the structure. You could also type the destination directory, replacing the `..` with `stuff` and it would do the same job.
134+
125135
### Exercise 2: `cd` back into temp and create a couple of new folders with files in them
126136

127137
### Bonus: if you are on a Mac, type this into your terminal:

0 commit comments

Comments
 (0)