I agree with most of the previous answers. I consider shell commands most suited to do filesystem-oriented tasks (copy and move files, grep, etc). Shell is better, in my opinion, if you have to read and write to file, since a single >>file.txt
redirection appends to file instantly, instead of needing, say, file=open('file.txt','a'); file.write()
, etc.
Currently, for my personal use, I mix both, creating a python script and calling os.system('command') or os.popen('command') every time some action is easier in shell than in python.