Avatar of MrTV
MrTVFlag for Thailand

asked on 

delete file inlinux

How can i delete directory in linux and every file inside directory
Thank
LinuxLinux Distributions

Avatar of undefined
Last Comment
Reisswolf
ASKER CERTIFIED SOLUTION
Avatar of bstrauss3
bstrauss3

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Reisswolf
Reisswolf

Alternatively, you could also open the parent directory in the nautilus graphical browser, right-click on the directory you wish to delete and send it to the trash can.  Then right-click on the trash can and empty it.

Example:  suppose the directory you wish to delete is called directory_to_delete, and it resides in /path/to/parent_directory.  Perform the following steps:

1.  Type "nautilus /path/to/parent_directory &" (without the quotes) at a terminal window.

2.  In the graphical browser, right-click directory_to_delete, and send it to the trash can.

3.  Empty the trash can.

*****

But yes, I prefer the command-line method, since it is quicker.
Linux
Linux

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.

71K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo