In the linux terminal i can delete all files from directory including hidden ones with:
sudo rm -rf /path/to/folder/{*,.*} 2> /dev/null
I'm trying to run the following command via os.system in python:
>>> os.system('sudo rm -rf /path/to/folder/{*,.*}')
this will exit without any error (exit code 0) but do not delete nothing.
I understand here probably the curly braces have a special meaning but trying \{*,.*\}
will not change nothing.
Wondering what going one here and how to tell python to use the Curly braces as in the terminal.
Of corse to make the job done i can do:
os.system('sudo rm -r /path/to/folder/* /path/to/folder/.myHiddenFile') # or other combination
But i want to understand how to play with the Curly braces here.