Skip to content

Instantly share code, notes, and snippets.

@machuiwen
Created November 20, 2015 07:08
Show Gist options
  • Save machuiwen/612fe9ee65100d501b5d to your computer and use it in GitHub Desktop.
Save machuiwen/612fe9ee65100d501b5d to your computer and use it in GitHub Desktop.
Python script to empty trash
#!/usr/local/bin/python
# delete all files and folders in trash box
import os
import sys
os.chdir('/Users/YourUserName/.Trash')
if len(sys.argv) >= 2:
if sys.argv[1] == '-t' or sys.argv[1] == '-T':
os.system("tree ./")
elif sys.argv[1] == '-l' or sys.argv[1] == '-L':
os.system("ls -al")
os.system("rm -rf *")
@JOHNMARY-BORNICA-PRINCE19

indentation error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment