Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to delete a non empty directory in linux

1. To recursively delete use

$ rm -r dirname

2.To forcefully delete use

$ rm -rf dirname
Comment

rmdir directory not empty windows

rmdir /s /q mydir
Comment

rmdir not empty

rm -rf dir-name
Comment

rmdir directory not empty

To remove(delete) a directory use:
rmdir *directory name* 
e.g: rmdir "my directory"

To remove a non-empty directory use:
rm -r *directory name*
e.g: rm -r "my non-empty directory"


Use "" when your directory path (absolute or relative) or name contains spaces
Comment

How to remove a non empty directory

//remove a non empty directory
rm -r dir1

//remove a directory within directory without being promopted
rm -rf dir1
Comment

rmdir directory not empty

rmdir folder1  folder2 #remove empty directory folders
rm -rf folder1 folder2 #remove non-empty folders and its content recursively
Comment

remove a non empty directory

sudo rm -R [Directory name]
Comment

PREVIOUS NEXT
Code Example
Shell :: raspberry pi change permissions /var/www 
Shell :: git remove last pushed commit 
Shell :: copy folder from ssh to local 
Shell :: pod install react native failed 
Shell :: kali tools 
Shell :: how to hide hostname mac terminal 
Shell :: conda install tokenizers 
Shell :: installing k3d 
Shell :: how to run jar file mac 
Shell :: linux get folder size 
Shell :: centos epel-release 
Shell :: google font npm install 
Shell :: apk add build-essential 
Shell :: linux find all files name containing string 
Shell :: brew install xcode 
Shell :: laravel sail install php extensions 
Shell :: export display connection for wsl 
Shell :: tail command in linux 
Shell :: @mui/material npm 
Shell :: docker images only name 
Shell :: check linux file size 
Shell :: install aws cli version 2 
Shell :: rpi install chomedriver 
Shell :: install glfw debian 
Shell :: change username and home directory linux 
Shell :: sh vs bash 
Shell :: where are fonts on linux 
Shell :: facebook for linux 
Shell :: converting mp3 with FFMPEG 
Shell :: git CAfile: none CRLfile: none 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =