Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Shell/Bash
ubuntu remove all folders but keep some
rery
Programming language:
Shell/Bash
2021-05-24 18:57:43
0
Q:
ubuntu remove all folders but keep some
Austin Curtis
Code:
Shell/Bash
2021-03-04 02:03:17
find ./myfolder -mindepth 1 ! -regex '^./myfolder/test2\(/.*\)?' -delete
1
Tags
remove
folder
ubuntu
Related
remove folder in all sub folders linux command
linux remove all files same extension in directory
how to remove all images in folder mac terminal
how to remove folder and its contents in linux
linux delete files in folders without deleting the folder
how to delete a folder in ubuntu using terminal
ubuntu remove git from folder
delete all files with specific name ubuntu
where to find the zipped folder from google drive in ubuntu
ubuntu delete all files with extension
powershell delete all files with specific extension in sub directories
copy all files from a folder to another ubuntu
remove folder ubuntu
linux zip all folders except one
linux remove folder and all his content
remove all files inside directory linux
ubuntu remove directory
New to Communities?
Join the community