Closed stottj closed 1 year ago
cp allows for a user to copy a file/groups of files/directories. Standard command goes: cd [option] source destination/directory.
ex cp a.txt b.txt
mv allows for a user to move and renaming files/directories. Standard command goes: mv [option] source destination/directory
ex mv filre.txt destination
Note: cp is like copy and past and mv is like cut and paste
rm allows a user to remove files,directories. Standard command goes: rm [option] file
ex rm a.txt
common options -i system warns user before overwriting destination -b creates backup of the destination file -f forces operation if user doesnt have permission -r recursive, for example cp -r will copy entire directory structure
becareful with options, such as -f -r as these can be used to delete/overwrite directories which shouldnt be touched.
common troubleshooting is not having rights to perform actions, destinations not existing, using wrong options or commands. Ensure spelling is correct and destination/source are correct.
👍🏻
Ticket: Copy, Move, and Delete Files Using
cp,
mv,
andrm.
Summary
Learn how to copy, move, and delete files and directories using the
cp,
mv,
andrm
commands in a Unix-like operating system.Description
Objective: Understand and practice the basic file operations—copying, moving, and deleting—using the
cp,
mv,
andrm
commands.Scope:
cp,
mv,
andrm.
Learning Tasks
Copy Files with
cp
:cp
command.Move Files with
mv
:mv
command moves files and directories.Delete Files with
rm
:rm
command for file and directory removal.Explore Options and Flags:
-r
for recursive operations or-f
for forcing actions.Best Practices and Warnings:
Troubleshooting:
Learning Goals
Priority