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

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

Linux remove non empty directory

rm -rf dirnameCopy
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 :: linux linebreaks script bash 
Shell :: linux tar gz 
Shell :: linux see group memebers 
Shell :: restart mac 
Shell :: extract rpm in linux 
Shell :: find process on linux 
Shell :: Bash file permission 
Shell :: make mp4 smaller using ffmpeg 
Shell :: how to rename folder in cmd 
Shell :: bash Creating help function 
Shell :: check disk space linux 
Shell :: docker fatal: not a git repository (or any of the parent directories): .git 
Shell :: bash redirect output to null 
Shell :: zsh: command not found: protoc mac 
Shell :: install oh my zsh linux 
Shell :: permissão de execução linux 
Shell :: double quotes inside double quotes bash 
Shell :: ubuntu change directory owner 
Shell :: powershell delete folder contents 
Shell :: gitlab set global username and password 
Shell :: convert increase size linux command line 
Shell :: unzip to directory 
Shell :: delete all files with specific name ubuntu 
Shell :: how to make all directory 775 
Shell :: git push origin master 
Shell :: conda install jupyter notebook 
Shell :: video editor linux 
Shell :: heroku rebuild 
Shell :: git revert merge 
Shell :: check library installed in google colab 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =