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 - 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Understanding filesystem paths4m 18s
-
(Locked)
Creating files and dirs4m 38s
-
(Locked)
Copying files and dirs4m 39s
-
(Locked)
Moving and renaming files and dirs4m 11s
-
(Locked)
Deleting files and dirs3m 44s
-
(Locked)
Creating links to files and dirs6m 24s
-
(Locked)
Making file manipulation safe2m 12s
-
(Locked)
Challenge: Linux files3m 21s
-
(Locked)
Solution: Linux files3m 45s
-
-
-
-