Notes and examples for using Python in common Linux sysadmin tasks
Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
OO_data_structures.py
README.md
collapse.log
collapse.py
command.py
find.py
grep_generator.py
grep_regexp.py
keyboard_input.py
logging.py
ls.py
parsing_args.py
recursion.py
scores.py
scores.txt
sendmail.py
socket.py
tail.py
wc.py

README.md

Python-for-Linux-Sysadmin

  • Aimed at Linux sysadmins with knowledge of Bash or Perl that are learning Python or developers wanting to perform system administration or automate Linux stuff with Python
  • Based on Python 2.7
  • Examples based on usage of the Python modules that are most useful for sysadmin work

Basic Modules

  • Interacting with the Operating System: os
  • Interactign with the Interpreter (gettign args for ex) sys
  • Executing Linux commands: subprocess
  • High Level File Operations shutil
  • Command line options argparse
  • Config file parser ConfigParser
  • Logging logging
  • Network connections socket

Other Modules