Skip to content

Commit 856f1be

Browse files
authored
feat: added alias for 'rm' sample (#322)
1 parent 2a2c44d commit 856f1be

File tree

1 file changed

+9
-0
lines changed
  • docs/05-building-your-toolkit/24-configuring-the-shell

1 file changed

+9
-0
lines changed

docs/05-building-your-toolkit/24-configuring-the-shell/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ alias gocode='cd ~/repos/github/dwmkerr'
9696

9797
If you are not familiar with aliases, check [Chapter 10 - Understanding Commands](../../part-2-core-skills/understanding-commands).
9898

99+
You might also use aliases to change the behaviour of existing commands. For example, we can change the `rm` command to automatically ask for confirmation before a file is deleted:
100+
101+
```bash
102+
# Always run 'rm' in interactive mode.
103+
alias rm='rm -i'
104+
```
105+
106+
Be aware that the more you customise default commands the more that you run the risk that tutorials or samples you use may not work as expected, as those samples will expect the _default_ behaviour of the command.
107+
99108
#### Functions
100109

101110
If you have more complex operations that you regularly perform, you could add them to your _~/.bashrc_ as a function:

0 commit comments

Comments
 (0)