Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

argument list too long rm delete in directory

// description of your code here

find . -maxdepth 1 -name '*.jpg' -exec rm {} \;

Handling file names with initial dash character

export PATH=/usr/bin:/bin:/usr/sbin:/sbin
export IFS=$' \t\n'

mkdir -p ~/Desktop/TestDir
touch ~/Desktop/TestDir/file{1,2,3,4,5}.txt
open ~/Desktop/TestDir

cd ~/Desktop/TestDir

touch -i

touch ~/Desktop/TestDir/-i

touch -- -i
chmod 000 -i
touch -- --i.txt
chmod 000 --i.txt

rm -f -i
rm -f -i -R *

rm -f -- -i
rm -f -- --i.txt

#rm -f ./-i
#rm -f ./--i.txt

rm -f -i -R *