rm -r in unix command - How to delete files and folders on Linux
Homeunixmanual unix command

rm -r in unix command - How to delete files and folders on Linux

You're working on a Linux /Unix distribution and do not find the shell command that lets you erase the contents of a directory ...

Learn basic unix commands with examples
What is Unix operating system - Characteristics & Features of Unix
You're working on a Linux/Unix distribution and do not find the shell command that lets you erase the contents of a directory without deleting this same, ie the folder container. Or you want to delete the contents of folders recursively, etc.

Well ! First of all, to solve any problem on Linux or any operating system based on the Unix kernel there are many methods, procedures and algorithms which we can use and all them work perfectly. So on the web you can find many solutions and tutorials about UNIX command which we can manipulate to delete files and folders but the shell commands which I will mention in this article are the most used.


$ rm Default command to erase files and folder on Linux 


$ rm: The default Shell command for deleting ordinary files and directories on Linux or UNIX distributions.


Example:


$ rm File_Name:  This command Shell serves to remove empty file or folder named "File_Name"

$ rm -r Unix Command: Remove a folder and its content recursively


Example:


$ rm -r Folder_Name: This command Shell serves to remove a folder called "Folder_Name" and its content recursively.

$ rm -rf Shell command: Erase the content without the container folder on Linux


If you want to delete the content of a folder without removing the same container folder you can displace on the container folder with $ cd Folder_Name Unix command then use $ rm -r * or without $ cd command you can directly execute $ rm -rf Folder_Name/*

Note:


We have added the -f option to force the deletion of files and to do not ask us the confirmation.

Another simple solution is with the following Shell command: $ rm Folder_Name/* -Rf
Another trick and the last: $ rm -rf Folder_Name ; mkdir Folder_Name

What makes this last command is to delete the folder and its contents recursively with the -r option, no confirmation message with -f and eventually create new empty folder with the same name with the $ mkdir command and separate the two commands with ;

That is all !! If you know another trick to delete files, documents and folders with the command shell in unix comment it down in the comments section to discuss it. See you in another tutorial ^_^
Nombre

adsense,1,adware,1,android,11,android 5.0,1,android app,1,Android App Development,1,android apps,4,android developer,1,android development,4,android error,1,android games,2,android interface,1,android launcher,1,android programming course,1,android puzzle games,1,android studio,1,backlink,3,bash,1,best android games,1,best linux distro,1,best paid android games,1,blog,1,blogger,3,blogging,3,connexion,1,delete files and folders on Linux,1,dofollow backlink,3,download,1,editor for programmers,1,edu backlink,1,fedora,1,fedora 22,1,fix,1,free backlink,2,free courses,2,free messages,1,gedit editor,1,gnu,1,gnulinux,1,hacker,1,high authority backlink,1,high pagerank backlink,3,host,1,hosting,1,how to,1,ide,1,internet,1,ios,1,java,1,keylogger,1,linux,4,linux command,1,linux distros,1,linux plugins,1,linux tutorial,1,make money,1,manual unix command,2,manuals,1,MCSE,1,microsoft,1,Microsoft Certified Systems Engineer Program,1,mobile,1,networking,1,new offers,2,opensource,1,operating system,3,oracle,1,os,2,paid android apps for free,1,paid android games for free,1,pdf,1,play store,2,play store error,1,programing,3,programming,1,ranking,1,registry fix,1,seach engine optimization,3,Search Engines,1,security,4,seo,4,shell,2,shell bash,2,shell command,1,shortcuts,1,smartphone,2,smartphones,1,smartphones discount,1,software,1,spam,1,spy keyboard,1,spyware,2,terms,2,text editor,1,unix,3,unix commands,2,unix operating system,1,update,1,update smartphone vesion,1,virtual machine,1,virtual pc,1,virtualbox,1,vmware,1,web server,2,website hosting,2,which smartphone should i buy,1,xiaomi,1,
ltr
item
DROIDUNIX : Android apps, games, GNU/Linux, Unix and smartphones: rm -r in unix command - How to delete files and folders on Linux
rm -r in unix command - How to delete files and folders on Linux
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCmCvz80HpAaSxSwaGcSyeU6TtTgqVFIYYdy9cr8hNB6zt1QkgEV5SePXsNQqJPDPcbl67ESCC6cb_dGN_VWU5mYapttdHAmkJCfhhrp-uoYCoKqMs6d8zlYzgVsR4YrfhyOEgXatmGao/s1600/comman+shell+unix+gnulinux+1.jpg
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCmCvz80HpAaSxSwaGcSyeU6TtTgqVFIYYdy9cr8hNB6zt1QkgEV5SePXsNQqJPDPcbl67ESCC6cb_dGN_VWU5mYapttdHAmkJCfhhrp-uoYCoKqMs6d8zlYzgVsR4YrfhyOEgXatmGao/s72-c/comman+shell+unix+gnulinux+1.jpg
DROIDUNIX : Android apps, games, GNU/Linux, Unix and smartphones
https://appdroidunix.blogspot.com/2015/12/rm-r-in-unix-command-how-to-delete-files-and-folders-with-shell-command-on-linux.html
https://appdroidunix.blogspot.com/
https://appdroidunix.blogspot.com/
https://appdroidunix.blogspot.com/2015/12/rm-r-in-unix-command-how-to-delete-files-and-folders-with-shell-command-on-linux.html
true
5400849346614048641
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy