Linux – Make, Rename, Move, Delete Folders (mkdir, mv, cp, rm)

Linux – Make, Rename, Move, Delete Folders (mkdir, mv, cp, rm)

HomeOther ContentLinux – Make, Rename, Move, Delete Folders (mkdir, mv, cp, rm)
ChannelPublish DateThumbnail & View CountActions
Channel AvatarPublish Date not found Thumbnail
0 Views
Find code and diagrams at: https://www.EliTheComputerGuy.com

Managing folders is much like managing files in Linux. Just remember to use the -r option (recursive) for copying and deleting.

Make Directory

mkdir newfolder – Creates a folder called folder
Rename Directory

mv newfolder newfolder2 – Renames folder to be folder2
Move Directory

mv newfolder folder/newfolder – Moves newfolder into the folder directory.
Warning: You can move AND rename a folder at the same time even by accident.
Copy Directory

cp -r newfolder newfolder.bak – Copies newfolder and contents to newfolder.bak
-r means “recursive” and so copies both the folder and all contents.
Delete Directory

rm – rf newfolder – Deletes newfolder and all contents
-f is the “force” option and may be needed if files within the directory are protected for some reason.

Please take the opportunity to connect and share this video with your friends and family if you find it useful.