How To Delete Files And Folders Or Directories In Ubuntu Linux Command Line
Websplaining
How To Delete Or Remove Files And Folders Or Directories In Ubuntu Linux Command Line
In this video I will show you how to permanently delete or remove files and folders or directories in Linux. The operating system I installed on my Server during this video tutorial was Ubuntu Linux. These commands will work on other Linux operating systems too.
Commands To Remove Files:
There are two ways to delete or remove files in Linux. You can use either "unlink" or "rm".
unlink filename.extension rm filename.extension
You can delete or remove multiple files in a single command using "rm" and separating your each file you want to delete with a space. The files you delete do not have to have the same extension to be deleted using a single command. You can't use the "unlink" command to remove multiple files.
rm filename.extension filename.extension
Commands To Remove Directories or Folders: rm -rf directoryname or foldername
To remove files or folders beginning with a letter such as "b" type the following command:
rm -rf b*
You can also add more letters or even words to the above command before the star (*)
To remove files with a specific file extension such as ".json" type the following command:
rm -rf *json
Command Syntax: rm -rf *extension
To delete an entire directory or folder, leaving it empty, type the following command:
rm -rf *
To list all the files and folders in your current directory type the following command:
ls
Abbreviation Key rm = Remove r = Recursive (Remove files and folders without being prompted) f = Force (Remove files and folders with write-protection) -rf = Recursive Force
- = All ls = List
Timestamps: Intro & Context 0:00 How To List Files In Current Directory (ls) 0:10 unlink and rm Commands To Delete A Single File In Terminal 0:25 How To Remove Directories Or Folders In A Linux Terminal 1:44 How To Delete An Entire Directory to Empty It Completely 2:36
Need A Cheap Server To Practice Linux Commands On? $100 Vultr Promotional Credit when you use this Referral Link https://www.vultr.com/?ref=8668725-6G
What is Vultr? Vultr is a Cloud Hosting company. Vultr allows customers to deploy a cloud server in 15 Cities around the globe in less than 60 Seconds.
Grow your YouTube Channel with vidIQ https://vidiq.com?afmc=70s
Ubuntu Linux Tutorials (Playlist) https://www.youtube.com/playlist?list=PLco3v23oibTXMcX9Eh80_8OcnVs1SqsR2
Social Media SUBSCRIBE to my YouTube Channel https://bit.ly/2EKOR4a Instagram (Thumbnail Collection) https://www.instagram.com/websplaining Twitter (For Newest uploads) https://twitter.com/websplaining Reddit (Discussions) https://www.reddit.com/r/Websplaining Personal Website https://www.websplaining.com
#DeleteFoldersInLinux #DeleteFilesinLinux #DeleteDirectoriesinLinux
DONT FORGET TO LIKE COMME ... https://www.youtube.com/watch?v=klJ8EKnQxRc
15364144 Bytes