![How to delete files, folders or directories in Ubuntu Linux command line](https://ytimg.googleusercontent.com/vi/klJ8EKnQxRc/hqdefault.jpg)
In this video I will show you how to delete or permanently delete files, folders or directories in Linux. The operating system I installed on my server during this video tutorial was Ubuntu Linux. These commands will also work on other Linux operating systems.
Commands for deleting files:
There are two ways to delete or delete files in Linux. You can use /"unlink/" or /"rm/".
unlink filename.extension
rm filename.extension
You can delete or delete multiple files in a single command by using /"rm/" and separating 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 cannot use the /"unlink/" command to delete multiple files.
rm filename.extension filename.extension
Commands to delete directories or folders:
rm -rf directory name or folder name
To delete files or folders starting with a letter such as /"b/", type the following command:
rm -rf b*
You can also add more letters or even words to the command above before the star (*)
To delete 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 files and folders in your current directory, type the following command:
ls
Abbreviation key
rm Delete
r Recursive (delete files and folders without prompting)
f Force (delete write-protected files and folders)
-rf Recursive force
* Wildcard
ls list
Timestamp:
0:00 Introduction and context
0:10 How to list files in current directory (ls)
0:25 Unlink and rm commands to delete a single file in terminal
1:44 How to delete directories or folders in Linux terminal
2:36 How to delete an entire directory to completely empty it
Need a cheap server to practice Linux commands?
Get 100 Free Vultr Cloud Credits https://www.vultr.com/?ref8941242-8H
What is Vultr?
Vultr is a cloud hosting company. Vultr allows customers to deploy a cloud server in 15 cities around the world in less than 60 seconds.
Grow your YouTube channel with vidIQ https://vidiq.com/70s
Ubuntu Linux Tutorials (Playlist) https://www.youtube.com/playlist?listPLco3v23oibTXMcX9Eh80_8OcnVs1SqsR2
Social networks
SUBSCRIBE https://www.youtube.com/@Websplaining?sub_confirmation1
Instagram (collection of thumbnails) https://www.instagram.com/websplaining
Twitter (for most recent uploads) https://twitter.com/websplaining
Reddit (Discussions) https://www.reddit.com/r/Websplaining
Personal website https://www.websplaining.com
#DeleteFoldersInLinux #DeleteFilesinLinux #DeleteDirectoriesinLinux
DON'T FORGET TO LIKE COMMENT AND SUBSCRIBE!
Please take the opportunity to connect and share this video with your friends and family if you find it useful.
No Comments