Slashdot Mirror


Top 10 Items in the Linux Admin Toolkit

Joe Barr writes "Joe 'Zonker' Brockmeier has listed his favorite top ten tools for Linux system administration in a story on Linux.com, one of Slashdot's sister sites." From the site: " Since I spend a lot of my time working with text files, either when I'm writing and editing or when I'm mucking with configuration files and shell scripts, I've become very attached to my editor of choice -- Vim. Over the years, I've tried a lot of other editors, but none of them has been sufficient to coax me away from Vim. Part of the reason for that is the fact that I no longer have to think about using Vi-style keybindings, and adjusting to anything else would seriously hinder my productivity."

37 of 357 comments (clear)

  1. Most important item by Anonymous Coward · · Score: 5, Funny

    Condoms! With all the groupies chasing Linux system admins, you can never have too many condoms!

  2. Re:Vim? Emacs foreva! by MORTAR_COMBAT! · · Score: 5, Funny

    the article said "toolkit" not "tool shed, tool warehouse, and tool factory on wheels".

    --
    MORTAR COMBAT!
  3. FLAME ON! Or not.... by Bonker · · Score: 5, Insightful

    Yes, let's dig one of the oldest flamewars back up in the summary rather than discuss some of the article's other excellent information.

    TFA mentions WGet, one of the most wonderful, most needed applications that most users and admins ON EVERY PLATFORM don't know they need. Why not focus on this rather than ressurect the text editor wars?

    --
    The next Slashdot story will be ready soon, but subscribers can beat the rush and slashdot the links early!
    1. Re:FLAME ON! Or not.... by Bogtha · · Score: 4, Insightful

      Why not focus on this rather than ressurect the text editor wars?

      Big flamewar == more pageviews. More pageviews = more ad impressions. More ad impressions == higher profits.

      Slashdot editors post "provoking" (i.e. flamebait/troll) summaries/articles so frequently that you can essentially rule out stupidity and go straight to malice.

      --
      Bogtha Bogtha Bogtha
  4. Re:Vim? Emacs foreva! by Anonymous Coward · · Score: 5, Funny

    The only 3 commands any Emacs user needs to know:

    Ctrl-x
    Ctrl-c
    vi

  5. Re:My List by Rosco+P.+Coltrane · · Score: 3, Funny

    Don't forget:

    - 1 bag of Cheerios
    - 3 lettuces
    - 1 lbs of carrots
    - Detergent
    - 6 Dr. Pepper bottles
    - 1 box of tampons

    otherwise don't bother to come home.

    -- Your wife Linda

    --
    "A door is what a dog is perpetually on the wrong side of" - Ogden Nash
  6. Mine by hackstraw · · Score: 5, Interesting
    In alphabetical order:
    • [rs]sh - enables me to go places w/o passwords, copy files, and remotely execute commands. I can't live without it
    • cron - does my work for me while I sleep, and mails me the results in the morning
    • grep - the filter of filters. Keeps down the signal to noise ratio
    • less - the pager of pagers. With a proper lessopen/pipe, you can do what no man has done before. You can go backwards in files, although I guess some 'more's can do this now. Less always can. It also highlights text searches so I don't have to search for what I just searched for.
    • man - that's where they hide the documentation. Shame on those that only provide info, text, or worst, html documentation (or none)
    • perl - anything that any other command cannot do, or cannot do well enough, perl can with some coaching.
    • rsync - although its binary diff algorithm is not very good, rsync is close to heavenly, especially
    • when teamed with [rs]sh and cron
    • telnet - no, I never telnet to login to a machine, but I do it to test if a port is open, what's listening there, etc. very handy.
    • vim - good editor, I can live with vi, but that makes me a little grumpy. I simply do not know or care to learn emacs. Its just a text editor.
    • zsh - excellent shell. Very user friendly, consistent error messages, powerful. It can do anything any other shell can do and more. I understan
      d that bash has made some progress over the years, but zsh is my friend.
    • /dev/null - where I put all of my important stuff. So should you!

    • Honorable mention - /bin/sh Only because it is always there by definition on UNIX systems, and a good shell programming language. tcsh, csh, and zsh are not as good as /bin/sh, and its always available, but a little boring to write about.
    1. Re:Mine by Stephen+Williams · · Score: 4, Informative

      Shame on those that only provide info, text, or worst, html documentation (or none)

      For reading HTML docs over ssh or on an X11-less machine, might I recommend w3m? It's a very comfortable text-mode web browser. Unlike Lynx, it renders tables nicely, and even makes a brave attempt at frames.

      -Stephen

    2. Re:Mine by BrookHarty · · Score: 3, Interesting

      Everyone I know switched to SSH and dumped RSH. Keyfiles are your friend.

      ssh/scp
      snoop
      cat (Sometimes easier to paste a file than scp one)
      tail (-100f, I dont care if you are changing the command!)
      ksh (solaris standard)
      du (I always catalog an entire system, quicker than find, and im impatient)
      But grep, perl and less, vi are always on the list.
      and bzip/gzip for log files.
      telnet for testing ports.
      Cron is more server process, I wouldnt coun't it as a command.

      But for home use, wget, screen, links, du. Wget under screen for files.

    3. Re:Mine by mindriot · · Score: 5, Informative

      While rsync is very nice for syncing files, I've found another, somewhat related tool much nicer for my purposes. I have a desktop and a laptop computer, and to a great extent I work on the same files on both. Syncing my home directories could be done using rsync to some degree, but it's rather painful if you have modified files on both sides.

      This is where unison comes in handy. It keeps two directories synchronized nicely, adjusting changes in both directions automatically and querying the user in case of collisions. One of my favorite tools, and I'm sure I'm far from being the only one with a need for something like it.

    4. Re:Mine by FyRE666 · · Score: 4, Funny

      egrep is more useful than grep
      netcat (nc) is more better than telnet

      I don't wish to be picky, but it's
      "netcat (nc) is more betterer than telnet"

      Please prof reed yor articals!

    5. Re:Mine by i.r.id10t · · Score: 3, Informative

      Better thank lynx is links. Handles tables, frames, etc. no problem. Also, it can be compiled with various options to make it a graphical browser too, which is handy for X exported over SSH type things.

      --
      Don't blame me, I voted for Kodos
  7. I got yer flamewar right here! by adavies42 · · Score: 5, Funny

    Wget sucks, curl rules!

    --
    Media that can be recorded and distributed can be recorded and distributed.
    -kfg
  8. Telnet ...? by stevey · · Score: 5, Interesting

    It is suprising the author chose "telnet" as one of the programs in his list.

    Sure it is useful for diagnosing random problems, and troubleshooting things - for example connecting straight to a webserver, or simulating a POP3 login request, but I've always preferred netcat.

    netcat is much more useful, it allows you to bind to sockets and handling incoming requests as well as make outgoing ones this introduction is a good read.

    Missing tools from the list? curl, links/lynx, rsync, sudo, nmap, lsof, and less.

    1. Re:Telnet ...? by JanneM · · Score: 3, Interesting

      The main benefit of sudo is when you have many admins working on a machine. If you're not in such an environment, you really don't need sudo.

      In Ubuntu the root account is not active by default, meaning you _always_ use sudo to do administrative tasks. And after geting used to that I feel distinctly uncomfortable with actually having a root shell open and unprotected on the Redhat box. If nothing else I know myself and know it's only a matter of time until I type something into the wrong terminal (and I know that from previous experience)...

      --
      Trust the Computer. The Computer is your friend.
  9. Re:Vim? Emacs foreva! by cayenne8 · · Score: 3, Insightful
    I find that sed and awk are two tools I use the most. Not so much for sys admin stuff...but, I get all kinds of fscked up files that need to be cleaned up for insertion into an Oracle database instance.

    They usually give me stuff in Excel format...gotta export it to csv file...then, clean out imbedded CRLF's, headings and such...especially with free form txt fields. Anyway, a little scripting and scrubbing with awk and sed...and I can generate some good insert scripts for the databases.

    --
    Light travels faster than sound. This is why some people appear bright until you hear them speak.........
  10. rm by Skadet · · Score: 5, Funny

    rm

    preferably with the -Rf options.

  11. Webmin by lthown · · Score: 3, Informative

    One of the most useful remote admin packages out there. Especially useful for those just getting into Linux/Unix. Want to install a Perl module? just select or enter the name. Wanna change a cron job for a user, it's in the Cron screen.

    http://www.webmin.com/

  12. Cream for Vim by digitect · · Score: 4, Interesting

    I'll plug my own project here: Cream is Vim tricked out in single mode with all the development tools pre-configured with all useful shortcut keys self-documented in the pull-down menus. You won't need to go searching through the help ever again.

    --
    There is no need to use a SlashDot sig for SEO...
  13. abcde? by ameoba · · Score: 3, Insightful

    When did a CD audio ripper become an essential part of an admin's toolkit?

    --
    my sig's at the bottom of the page.
  14. Re:Vim? Emacs foreva! by Anonymous Coward · · Score: 3, Funny

    Sorry, I was going to have an example of a for loop with sed, but I got busted by the lame filter. Seems like it gets harder to get past the stupid lameness filter all the time, yet I *STILL* constantly see goatse ascii. Why even fucking bother with the stupid thing if it doesn't work? You assholes.

    Obviously and sadly, the gay niggers are intellectually superior to you.

  15. Re:SSH by fimbulvetr · · Score: 4, Informative

    I'm actually suprised this guy used telnet. I find netcat (man nc) as a much better alternative. I can script it, I can do udp, and I can do port "testing".

  16. Depends on the admin role I'm in by jd · · Score: 4, Informative
    For network administration, I'd probably have a top 10 of:


    • hping3
    • bing
    • pchar
    • ping
    • traceroute
    • ncat
    • tcp dump
    • webmin
    • wget
    • ngrep


    Now, some of those are "well-known", but there are plenty there that few people (even on Slashdot) are likely to be overly familiar with.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  17. great tools by codepunk · · Score: 3, Informative

    All the best tools are the great networking tools which allow me to track down and eradicate owned windows machines on the network.

    nmap - hmmm what trojan do we have on the network today
    tcpdump - great at finding worms scanners
    iptraf - for finding weird clients p2p movie downloaders etc.
    ethereal - great for grabbing pop and telnet passwords
    aimsniff - just for amusement

    With just those couple of tools I can keep the helpdesk busy for weeks by finding owned machines that need cleaning.

    --


    Got Code?
  18. Maybe a few lesser-known by toofast · · Score: 4, Informative

    ethtool and mii-tool. The Cisco 2970 switch we use has the knack of initializing the interface in half-duplex mode if the port is set to "Auto". Easily fixed by setting the port to Full, but useful nonetheless.

    strings. Good to check if executables are using /etc/hosts.allow and /etc/hosts.deny, or where pop3/imap are looking for PEM certificates to configure pop3s/imaps, etc...

    vmstat. Think your system is paging, or a card is generating too many interrupts? /proc filesystem. Favorites include /proc/net/dev, and /proc/uptime, /proc/cpuinfo, /proc/loadavg. Good for aggregating individual server load data in a cluster.

    awk and sed. Mentioned elsewhere, but priceless.

    chmod. I think the Linux filesystem permissions are too ... permissive. Cut down on access to your logfiles and to config files in /etc.

    *quota*. A must for restricting disk space use.

    umask. When you need root, set your default umask fairly tight. I use 0077, but when you need to cpan some common perl modules, switch to the more common 0022.

    jobs, fg and bg. Old-school unix commands to play with jobs that .. might take a while. When you forgot to & your command, use CTRL+Z then bg your job.

    There may be more, but I can't think of any others right now...

  19. GNU Screen. by SlapAyoda · · Score: 3, Interesting

    I'm surprised at how few serious *NIX Administrators I know are using GNU Screen. For some reason, it seems that the majority of them have not yet discovered the sheer power of the console window manager. It allows me to manage dozens of virtual windows all within the same terminal. In addition to eliminating the need to window-switching on my local machine, it also allows me to perform complex select, copy, and paste operations using only my keyboard. WIthout using a mouse, I can select and copy text in one window, advance into another window, and paste the text. The best part is that if my DSL drops or I decide to reboot my computer, all of my screened sessions stay on the server, leaving my work in exactly the same place as it always was, and with a nice scrollback history. I couldn't work without it.

    --
    # wrote sig.txt, 23 lines, 31337 chars
  20. Re:Other comments on GNU Screen? by Wizarth · · Score: 5, Informative

    Screen is very useful. I think of it as providing virtual terminals (you know, Ctrl-F1 to Ctrl-F6) but over remote login (usually ssh in my case)

    My normal usage is like so:
    ssh into the box
    screen -r (resume session, that was created first time I went in after bootup, with screen -S)
    Ctrl-A Ctrl-N (next virtual terminal) to flick through things i have running, usually centericq (text multi protocol chat client) and btdownloadcurses, or the results of a compile I left going.
    Ctrl-A Ctrl-C (open new virtual terminal) which gives you another command prompt. Here I'll wget a tarball, extract it, start the compile, then Ctrl-A Ctrl-N back to centericq

    I'll disconnect from the box (Ctrl-A Ctrl-D to disconnect from screen, then Ctrl-D to close the login shell), go home, reconnect from one of my other machines, go through the same process.

    Also, I can stay connected, go to another machine, and use screen -x to have multiple connections to the same screen. In the case of a dropped connection, and screen thinks my old login is still valid, screen -rD will disconnect the old login.

    Oh, and Ctrl-A ? will show all the in-screen escape sequences. Some of them I haven't used (there is one to do horiz split display, but it crashes btdownloadcurses), but look like they could be even more useful!

    But really, the best part is not having programs killed on me because the internet connection dropped (as happens all too often around these parts).

  21. Re:Clasis usability by Macka · · Score: 3, Informative


    I like vim for command line.....

    You can't do a whole lot of typing on the command line then either. I've never bothered to learn to use the Emacs editor (tried about 15 years ago and hated it) so I always use the vi editor ... but when it comes to command line editing, "emacs mode" whoops "vi mode" totally. Being able to use the arrow keys to scroll back commands or navigate the command line, along with ^a (beginning of line) ^e (end of line) ^r (to search for strings in your command history) ... "esc." (that's "dot" not a full stop, to recall the last field in the previous command string, etc, etc, etc....

    The only time I've had to use vi mode for command line editing is on HP-UX, where the lack of a modern shell by default and crap emacs mode support have forced me into it. The usability difference is horribly noticeable.

  22. Re:Other comments on GNU Screen? by jptxs · · Score: 3, Informative

    Step 1. Begin compiling some huge thing (tm) during your screen session.
    Step 2. Spend all day doing other things as compilation is off in some hidden window in screen.
    Step 3. Check on compiling every now and then, you will be able to scroll back and forth as needed as if you'd been sitting with an xterm open the whole time.
    Step 4. Leave work for home.
    Step 5. Reattach to you screen session and check on your compiling some more.
    Step 6. Realize inner peace knowing you need not worry about where you started some long process ever again by using screen.

    --
    we speak the way we breathe --Fugazi
  23. 'kill -9 1' will get you laid by Flunitrazepam · · Score: 3, Funny

    How about that? Run it and your social life will immediately improve. It is the first step toward a better life. Won't you take it today?

    --
    1) Your analysis is based on bad assumptions so your result is way off. 2) You're a sick bastard for fucking a horse.
  24. Re:strace by lky · · Score: 3, Informative

    Dont forget these, any one will provide the needed/wanted tools for recovery.

    Forensic and Incident Response Environment: http://fire.dmzs.com/
    Linux Bootable Business Card: http://www.lnx-bbc.org/
    Ultimate Boot CD: http://ubcd.sourceforge.net/
    Knoppix Security Tools Distribution: http://www.knoppix-std.org/
    SystemRescueCd: ahref=http://www.sysresccd.org/rel=url2html-26348h ttp://www.sysresccd.org/>

  25. Instead of cdargs... by Clueless+Moron · · Score: 3, Informative
    I define these functions in my shell .rc:
    mk() { eval ${1:-MKPWD}=\"`pwd`\"; }
    rt() { eval cd \"\$${1:-MKPWD}\";pwd; }

    You type "mk" (as in "mark") and "rt" (as in "return") to mark a directory and later go back to it.

    Or you can give it a name: do "mk foo", and later on "rt foo" will move you back there.

    But the Big Win? With the above, it gets set as a shell var: $foo is also set to the directory, so you can do things like "cp $foo/*.baz ." to good benefit. In addition, setting up this system is just a trivial matter of setting environment variables in your .profile.

    PS: Trivia: the "mk" and "rt" names were inspired by troff, where those commands were used to keep mark and go back to vertical positions on a page... yeah I'm an oldie.

  26. Re:SSH by Pheersome · · Score: 4, Informative

    I was actually going to say something very similar, and then I realized that I use telnet over netcat for certain purposes, because telnet notifies me when it actually connects. However, a couple minutes ago I realized I was being an idiot, because 'nc -v' does the same thing.

    Also, if you haven't already, check out nmap-ncat.

    --
    Better to light a candle than to curse the darkness.
  27. Elinks rocks... by arcadum · · Score: 3, Informative

    Elinks has javascript support. I've deployed elinks to many systems as a last resort for the tech support crew when the ppp connect is hosed.

  28. Tsync by Earlybird · · Score: 3, Interesting

    You may want to check out Tsync, one of the recent Google "Summer of Code" winners: "Tsync is a user-level daemon that provides transparent synchronization amongst a set of computers. Tsync uses a peer-to-peer architecture for scalability, efficiency, and robustness." Unlike rsync, Unison, etc., Tsync is a locally installed daemon which automatically and transparently syncs two or more hosts.

  29. Oh yeah? (pr0n howto) by identity0 · · Score: 3, Informative

    As this table shows, curl does not have "Recursive Downloads", which wget does. Which is the most useful feature of wget - you can point it at a pr0n link or gallery site like so:

    wget -r -k -H --level=3

    and it will follow all the pr0n links to three levels down, and retrieve all the pix/movies it links to. Saves you tens of hours of frustrated clicking and saving manually. Not that I personally use it for such vile things, of course :)

  30. My list... by ledow · · Score: 3, Interesting

    - ssh (file transfers, port forwarding, encryption and remote login in one tiny tool. I even use it in place of WEP or WPA)
    - pico (can't stand vi but pico is small and has enough of a help that I don't have to memorise keystrokes)
    - grep, sed (with grep and sed, you can pretty much manipulate any file/program output into whatever you want, strip IP's out of errors/logs, etc.)
    - x11vnc (like any other VNC program but supports Tight encoding and also lets me see what an EXISTING X session is doing. Combined with a script that seds/greps the auth code from the process list and you have automated remote desktop)
    - screen (if for no other reason than it lets you start a job at work (like a kernel compile) and watch it's progress throughout the day even if you have to log off in between. And when you get home, you can still check on it)
    - tinyproxy (wonderful small, easy to use web-proxy that I tunnel into from work to bypass the far-too-restrictive filters in the schools that I work in)
    - slocate (worth it's weight in gold when you have it auto-indexing overnight across all filesystems. Where's that file I used ten years ago that had Xen in the name? a simple command, 2 seconds wait and you get the full path).
    - dnsmasq (tiny util, bung it a massive list of public DNS servers and point your DNS requests to 127.0.0.1 and it will loop through them all until it gets a response. Failover to other servers, built-in full DHCP server, invaluable behind a NAT, simple config. Saved my life I-don't-know-how-many-times when my ISP DNS servers were feeling flaky. No one even noticed that half the time our ISP's weren't responding to DNS at all.)
    - lsusb, lspci, /proc/cpuinfo, free etc. (Invaluable for hardware discovery. Boot a knoppix CD, run those commands and instantly you know everything about the hardware that you need to know.)
    - dd, cat, more, sh, etc.(where would we be without them?)