By default a lot of Linux systems will let users copy over or delete data without warning. We can turn on interactivity using the -i option to cp, mv and rm. However, if we wanted to make this behavior the default we can by aliasing these commands in our bashrc file. We also source the bashrc file so our aliases are active immediately.
- [Instructor] In many Linux systems,…the default behavior is to not warn the user…when carrying out destructive operations.…On the command line, we can pass the -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,…we need to place an alias in our shell start up file.…We'll want to edit our bashrc file in an editor.…I'm going to use Vim,…but you can use a graphical gEdit, if you'd like.…So in a terminal, I'll type vim (space) ~/.bashrc…and hit enter.…
We'll want to go into insert mode by pressing the I key…or the insert key.…And we'll want to go to the end of the last line,…which is User specific aliases and functions…and hit enter.…Here we'll add our aliases.…Type in alias (space) cp=…(single quote) cp (space) -i(single quote)…To add interactivity to mv,…type in alias mv=…(single quote) mv (space) -i(single quote)…To add interactivity to rm,…type in alias (space) rm=…(single quote) rm (space) -i(single quote)…
- Getting file attributes and extended attributes
- Creating and copying files and directories
- Moving and renaming files and directories
- Creating links to files and directories
- Reviewing standard Linux permissions
- Setting permissions using numeric method and symbolic method
- Reading and setting ACLs
- Managing default ACLs
Skill Level Intermediate
Linux: Desktops and Remote Accesswith Grant McWilliams1h 44m Intermediate
1. Linux Files
2. Manipulate Files
3. Standard Unix Permissions
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.