views:

756

answers:

7

Python for Unix and Linux System Administration is aimed at sysadmins. Any other favorites besides this.

+4  A: 

http://www.diveintopython.org/

Thomas David Baker
+1  A: 

If you don't know Python, you can start from here: Dive into Python (if you know a bit of coding). It's a free download. The Python tutorial at Python.org is also very good, I learned mostly from here and Dive into Python. You can also start by watching this Google Tech Talk Video. The title says Python for programmers, but it's still helpful. Once you know this, from what I heard, Python for Unix and Linux System Administration you mentioned is a very good and sufficient one. I highly recommend that you learn the basics of it before going into the specifics of system administration using Python.

Happy Python.

artknish
+1  A: 

I also started from the Python tutorial on python.org and it got me started rather quick, after this i'm reading O'Reilly's Programming Python.

amo-ej1
+1  A: 

I think you'd want to include Python in a Nutshell on your bookshelf. Excellent, thorough reference, by Alex Martelli.

Kevin Little
This one is always on my desk and dog-eared from use.
Anon
+3  A: 

+1 for Dive into Python and Python in a Nutshell. I also highly recommend effbot's Guide to the Standard Library. You'll probably also want to check out the Python Cookbook for some good examples of idiomatic Python code. Check out Foundations of Python Networking to pick up where the SysAdmin book leaves off in terms of network protocols (fyi: all APress books are available as PDFs, which I love)

technomalogical
Note: It's http://diveintopython.org, not ".com".
jmdeldin
Thanks, the link is fixed.
technomalogical
+2  A: 

Beginning Python: From Novice to Professional is an excellent book. I can recommend it.

Paidhi
+2  A: 

First, you can start off the learn the basics of Python at Python documentation Index. Also of interest there would be the tutorial, library references. For sysadmin, some of the libraries you can use are , to name a few

  1. shutil (moving/copying files)
  2. os eg os.walk() -> recursive directories looking for files
    os.path.join() -> join file paths
    os.getmtime(), os.getatime() -> file timestamp
    os.remove(), os.removedirs() -> remove files
    os.rename() -> rename files .. and many more... please see help(os) for more operating system stuffs...
  3. sys
  4. ftplib, telnetlib --> for file transfer and telnetting...
  5. glob() -> file globbing, wildcards
  6. re -> regular expression, if you ever need to use it.(but its not necessary)
  7. paramiko -> SSH, if you want to use Secure shell
  8. socket -> socket library if you need to do networking....
  9. most often times as a sysadmin, you will need to read/write files so learn about doing that

  10. a) using for loop

      for line in open("file"):
         print line
    
  11. b) with a file handle

      f=open("file")
      for line in f:
         print line
      f.close()
    
  12. c) using while loop

      f=open("file")
      while 1:
          line=f.readline()
          if not line: break
          print line
      f.close()
    
  13. datetime, time -> handle date and time , such as calculating how many days old or differences between 2 dates etc

  14. fileinput -> for editing files in place.

  15. md5 or hashlib -> calculating hash digest/md5 eg to find duplicate files ...

Of course, there are many more but i leave it to you to explore.

ghostdog74