Monday, May 18, 2015

Python Execute Unix / Linux Command Examples

http://www.cyberciti.biz/faq/python-execute-unix-linux-command-examples/

http://www.analyticsvidhya.com/blog/2016/01/complete-tutorial-learn-data-science-python-scratch-2/






https://askubuntu.com/questions/377438/how-can-i-recursively-delete-all-files-of-a-specific-extension-in-the-current-di

You don't even need to use rm in this case if you are afraid. Use find:
find . -name "*.bak" -type f -delete
But use it with precaution. Run first:
find . -name "*.bak" -type f
to see exactly which files you will remove.
Also, make sure that -delete is the last argument in your command. If you put it before the -name *.bak argumentit will delete everything.
See man find and man rm for more info and see also this related question on SE:

No comments:

Post a Comment