Skip to content

Commit

Permalink
NEW - add safety check for some dangerous bash commands
Browse files Browse the repository at this point in the history
  • Loading branch information
sohaibafifi committed Sep 9, 2013
1 parent d672231 commit 5104f05
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ bash/bashrc.d/*
!bash/bashrc.d/sudo.bash
!bash/bashrc.d/tollerance.bash
!bash/bashrc.d/new_commands.bash
!bash/bashrc.d/safety.bash
gnupg/*
!gnupg/*.conf
mutt/muttrc.alternates
Expand Down
13 changes: 13 additions & 0 deletions bash/bashrc.d/safety.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Safety features ## {{{
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -I' # 'rm -i' prompts for every file
# safer alternative w/ timeout, not stored in history
alias rm=' timeout 3 rm -Iv --one-file-system'
alias ln='ln -i'
alias chown='chown --preserve-root'
alias chmod='chmod --preserve-root'
alias chgrp='chgrp --preserve-root'
alias cls=' echo -ne "\033c"' # clear screen for real (it does not work in Terminology)
# }}}

0 comments on commit 5104f05

Please sign in to comment.