Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

windows how to delete a file in all subfolders

:: to delete the file named 'foo.txt' from all subdirectories of the current 
:: working directory
:: run this command in the windows cmd.exe shell:
for /f %f in ('dir /d /b') do del /s /q %ffoo.txt

:: if 'foo' is a directory, the previous command merely empties the directory
:: to clean up and remove the empty foo directories afterwards run this command
for /f %f in ('dir /d /b') do rd /s /q %ffoo
Comment

batch delete all files in subfolders of type

del /S *.jpg

del - del command is used delete files from a computer
/S - recurses subdirectories and checks their contents
* - wildcard for the filename
.jpg - the type (extension) wanted
Comment

batch delete all folders and files

for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q)
Comment

PREVIOUS NEXT
Code Example
Shell :: mac generate ssh private key 
Shell :: how to kill process 
Shell :: set head of branch at specific commit 
Shell :: whereis 
Shell :: prevent pushing to master github 
Shell :: install postman 
Shell :: pip install pytorch==1.4.0 
Shell :: git pull override local changes 
Shell :: bash if set variable 
Shell :: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/pgdg.list:1 and /etc/apt/sources.list.d/pgdg.list:2 
Shell :: bash command substitution 
Shell :: npm cors api use 
Shell :: bash length of array 
Shell :: linux get ownership of own user directory folder ubuntu chown operation not permitted 
Shell :: docker map folder 
Shell :: SSH key passphrase reset 
Shell :: cmd flutter doctor says android studio is not installed 
Shell :: etherum for ubuntu 
Shell :: linux change date and then change files ctime 
Shell :: gh ubuntu 
Shell :: install oh my zsh! 
Shell :: install app in kali linux 
Shell :: Conditional variables in gitlab-ci.yml 
Shell :: sh or bash validate if file no exist 
Shell :: genymotion install ubuntu 
Shell :: bash script to clean up log files in /var/log 
Shell :: delete a github repository using bash 
Shell :: generate new ssh key 
Shell :: Using git reset to Undo a Merge 
Shell :: hide hidden files mac 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =