safer use of the shell / terminal

I included following lines into my ~/.bashrc to have a more secure shell experience.

1) Do not remove (unlink) a file, but move it to the trash-can. You have to install trash-cli,
 

sudo apt-get install trash-cli
alias rm="echo 'NOTE: !! not removing, but moving to trash-can!! '; trash-put"

If you want to use the normal rm command, use

/bin/rm file1ToRemove.txt file2ToRemove.png

2) ask before overwriting a file, if you accidentaly copy or move a file with the same name.

alias cp="cp -i"  # ask before overwriting a file
alias mv="mv -i"  # ask before overwriting a file

 

blog_tags: 

Add new comment

Filtered HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <img> <br> <p> <span>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Use [collapse] and [/collapse] to create collapsible text blocks. [collapse collapsed] or [collapsed] will start with the block closed.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Code snippets in <code>...</code> or <source>...</source> automatically will be pretty printed.
  • Use [collapse] and [/collapse] to create collapsible text blocks. [collapse collapsed] or [collapsed] will start with the block closed.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Target Image