Advertisement
Guest User

Untitled

a guest
Dec 9th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. #!/usr/bin/python
  2. import sys
  3. import subprocess
  4. file_size = input("Podaj minimalny rozmiar pliku [MB]: ")
  5. max_results = input("Podaj ilość wyników: ")
  6. show_size = (" -exec du -sh {} ';'")
  7. head_result = ("| head -n"+max_results+" ")
  8. sort = ("| sort -rh ")
  9. m = "M"
  10. command = ("find / -xdev -type f -size +"+file_size+m+show_size + sort+head_result)
  11. print(subprocess.Popen(command, shell=True, stdout=subprocess.PIPE).communicate()[0].decode('utf-8').strip())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement