ncibtep@nih.gov

Bioinformatics Training and Education Program

BTEP Question Forum

BTEP maintains several Question and Answer Forums of interest to the NCI/CCR community.
Currently, there are forums on these topics listed below:

If you wish to ask a question go to the Ask Question Page and submit your question.

 Back to Questions

Asking before deleting

Hi, during the last session the instructor showed that her Terminal would confirm before deleting a directory or file.  I thought the instructions for how to set up our environment to do the same were going to be posted here.
Thanks for your help
Diana

1

1 Answer:


Hi Diana,

After you have done Part 1 of the computer set up described in the biostar handbook (https://www.biostarhandbook.com/computer-setup.html#computer-setup) the book has instructions for setting up the terminal here: https://www.biostarhandbook.com/terminal-init.html#terminal-init

Following the instructions on this page will get your environment set up such that the commands rm, cp, mv, will prompt before overwriting files.

Basically, this step creates two files that are processed each time you initialize (open) your shell/terminal.  In this case, one of the files (.bashrc) is the one that has the settings (also known as aliases)  to make the mv/rm/cp  commands always ask before overwriting files.  If you open the file ~/.bashrc in a text editor, you will find the following:

alias rm='rm -i'

alias mv='mv -i'

alias cp='cp -i'

Details about customizing your bash settings can also be found in the biostar handbook:  https://www.biostarhandbook.com/bash-profile.html#bash-profile


Answered on April 20th, 2020 by