From the course: Linux: Files and Permissions

Unlock the full course today

Join today to access over 24,500 courses taught by industry experts.

Making file manipulation safe

Making file manipulation safe - Linux Tutorial

From the course: Linux: Files and Permissions

Making file manipulation safe

- [Tutor] In many Linux systems, the default behaviors do not warn the user when carrying out destructive operations. On the command line, we can pass the dash I option to cp, mv and rm to turn on interactivity which asks for confirmation before doing anything destructive. To make this behavior persist across reboots you need to place an alias in your shell startup file. If you want to edit your hidden dot bashrc file with an editor. I'm going to use Vim, but you can use the graphical Gedit if you'd like. Type in vim space tilde slash dot bashrc and hit enter. Go into insert mode by pressing the I key or the insert key and go to the end of the file. Now, add these lines. Alias space cp equals single quote cp space dash i single quote. New line, alias mv equals single quote, mv space dash i single quote. New line, alias rm equals single quote rm space dash i single quote. What this does is create an alias. So…

Contents