Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Linux Software IT

Top 10 Items in the Linux Admin Toolkit 357

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."
This discussion has been archived. No new comments can be posted.

Top 10 Items in the Linux Admin Toolkit

Comments Filter:
  • by Anonymous Coward on Tuesday November 01, 2005 @05:18PM (#13927309)
    Condoms! With all the groupies chasing Linux system admins, you can never have too many condoms!
  • strace (Score:3, Informative)

    by epiphani ( 254981 ) <epiphani@dal . n et> on Tuesday November 01, 2005 @05:19PM (#13927314)
    by far the most useful tool in troubleshooting.
  • by Bonker ( 243350 ) on Tuesday November 01, 2005 @05:21PM (#13927340)
    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?
  • Clasis usability (Score:2, Insightful)

    adjusting to anything else would seriously hinder my productivity, for a couple of weeks after which it may improve significantly.

    I like vim for command line and something like textpad [textpad.com] for GUI text editing. I've never tried Emacs, but then again I don't do a huge amount of text editing.
    • Re:Clasis usability (Score:4, Informative)

      by Macka ( 9388 ) on Tuesday November 01, 2005 @06:33PM (#13927973)

      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.

  • Mine (Score:5, Interesting)

    by hackstraw ( 262471 ) * on Tuesday November 01, 2005 @05:24PM (#13927365)
    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.
    • Comment removed (Score:4, Informative)

      by account_deleted ( 4530225 ) on Tuesday November 01, 2005 @05:35PM (#13927480)
      Comment removed based on user account deletion
      • Re:Mine (Score:4, Informative)

        by i.r.id10t ( 595143 ) on Tuesday November 01, 2005 @06:31PM (#13927958)
        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.
    • Re:Mine (Score:2, Informative)

      by illustir ( 92508 )
      I agree with most of your stuff and you're probably better at *NIX than I am but I might suggest replacing telnet with nc which does both connecting and listening.
    • Re:Mine (Score:3, Interesting)

      use netcat instead of telnet to test port connectivity. you can even use it in a shell script.

      My additions

      • find and xargs
      • dmesg
      • uname -a
      • ps --forest
      • awk :- for when perl is not available
      • ssh/scp
      • netcat
      • mc
      • elinks :- better alternative to lynx
    • Re:Mine (Score:4, Interesting)

      by BrookHarty ( 9119 ) on Tuesday November 01, 2005 @05:50PM (#13927625) Journal
      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.

      • Re:Mine (Score:3, Interesting)

        by hackstraw ( 262471 ) *
        Everyone I know switched to SSH and dumped RSH. Keyfiles are your friend.

        I use rsh/rcp on private networks. Less overhead, no need for keys, and it reminds me of the good old days when the internet was a friendly place :)

        I require ssh to access a machine from the outside world, but once your in, we are all friends again.

        Yeah, du is arguably top 10 or 20. gzip/bzip/tar definitely top 20, but boring.

        I cannot believe that I forgot truss/strace/ktrace.

        That family of commands are top 10 to knock somebody off.
    • by temojen ( 678985 )
      Everything here, except replacing vim with $EDITOR. Because everyone has their own favourite, but should learn one console capable editor.
    • Re:Mine (Score:5, Informative)

      by mindriot ( 96208 ) on Tuesday November 01, 2005 @05:55PM (#13927669)

      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 [upenn.edu] 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.

      • Tsync (Score:4, Interesting)

        by Earlybird ( 56426 ) <{slashdot} {at} {purefiction.net}> on Tuesday November 01, 2005 @10:53PM (#13929601) Homepage
        You may want to check out Tsync [sourceforge.net], 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.
    • 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.

      A bit OT, but I have to say that I do use telnet, but only on my home network where I have 100% control. Some of my machines are simply very resource-constrained so telnet still makes sense here.

      For cross-internet or other insecure connections, I always use ssh though.
    • Re:Mine (Score:3, Informative)

      by Nailer ( 69468 )
      Nice post, but...

      > * [rs]sh - enables me to go places w/o passwords, copy files, and remotely execute commands. I can't live without it

      rsh has lots of known security vulernabilities and shouldd not be used at all.

      > * 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.

      You should use nc for this. Telnet will fail with lots of data, only does TCP, and can't listen on ports. nc handles lots of data, can do TCP or UDP, and can l
  • help please. (Score:2, Interesting)

    by Anonymous Coward
    The autor makes a quick mention of vim, but what I'd really like to see is a full-blown developer session with vim, covering everything--common activities dealing with source, navigation, most used keystrokes, popular .vimrc mods, everything a "dyed-in-the-wool" GNU/Linux developer does when they are coding.

    To take it another step further, a peer review and commentary about the session from other hardcore GNU/Linux developers at the end, so I can see the critiques, favorites, etc.

    If anyone knows of such a a
    • Cream for Vim (Score:5, Interesting)

      by digitect ( 217483 ) <digitect@Nospam.dancingpaper.com> on Tuesday November 01, 2005 @05:37PM (#13927513)

      I'll plug my own project here: Cream [sourceforge.net] 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.


    • Here you go:

      http://vimdoc.sourceforge.net/ [sourceforge.net]

      most used keystrokes

      Wow, this AC must have never used vi or vim :) I guess j,k, and / are the most commonly used in command mode, even though / kinda puts you in ex mode because its at the bottom, but I believe all ex commands begin with a :

      In a nutshell, most every letter and number on the keyboard has a use, and they are case sensitive.

      vim has "IDE" like qualities. You can do :make and it will execute make and open up the warnings and/or errors that you want, bu
  • Telnet ...? (Score:5, Interesting)

    by stevey ( 64018 ) on Tuesday November 01, 2005 @05:25PM (#13927379) Homepage

    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 [debian-adm...ration.org].

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

    • Re:Telnet ...? (Score:3, Insightful)

      by drinkypoo ( 153816 )
      curl isn't missing - wget is right there :D

      rsync isn't missing - it's in the list.

      sudo, nmap, and lsof are all quite valid points, but many people don't bother with sudo. 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.

      less? I'd rather use vim as a pager :)

      • Re:Telnet ...? (Score:4, Interesting)

        by JanneM ( 7445 ) on Tuesday November 01, 2005 @06:11PM (#13927811) Homepage
        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)...
    • Re:Telnet ...? (Score:2, Insightful)

      by kahanamoku ( 470295 )
      Missing tools?

      what about the ability to login? I'd say the most important tool is the login prompt! cant do much without that one!

      Also, I think this article is really trying to teach us all how to suck eggs... this IS slashdot after all! ;-)
  • rm (Score:5, Funny)

    by Skadet ( 528657 ) on Tuesday November 01, 2005 @05:26PM (#13927393) Homepage
    rm

    preferably with the -Rf options.
  • Not a bad article (Score:3, Insightful)

    by ansible ( 9585 ) on Tuesday November 01, 2005 @05:28PM (#13927411) Journal

    But then, I've been using most of those tools for quite some time.

    The one that interested me is cdb, which I hadn't heard of before. I'll have to try that out.

  • We use it to manage the RubyForge mirror system [blogs.com] and it's a lifesaver. Check out the traffic dropoff chart [rubyforge.org] that the mirrors provide (not the number of hits, the number of KB served); rsync really helps make RubyForge tick.
    • I always add a BackupPC machine in the mix - This is a great way to maintain an archive of your files. Although mostly used for Win boxes, I also use it for archives of every server I install. You would be surprised at how often it comes in handy on larger networks, I guess people really like that delete button.

      It is also the ultimate off-site backup (using rsync w/ssh over the internet).
  • Almost every machine has a telnet client installed, so it's nice to log in to my box and watch my bandwidth get plotted down on a graph in real time without having to VNC and use X for this. Try it. [sourceforge.net]... Try nload, that is, do not try logging into my box please and thank you!
  • Webmin (Score:3, Informative)

    by lthown ( 737539 ) on Tuesday November 01, 2005 @05:33PM (#13927464)
    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/ [webmin.com]
  • by sootman ( 158191 ) on Tuesday November 01, 2005 @05:35PM (#13927493) Homepage Journal
    cat .bash_history | awk '{print $1}' | sort

    Mine: (flawed commands removed)
    cal
    cat
    cd
    cdd
    random text to get past lameness filter - isn't this why we have mods? size does matter!
    chmod
    clear
    cp
    crontab
    curl
    du
    echo
    grep
    random text to get past lameness filter - isn't this why we have mods? size does matter!
    gunzip
    head
    kill
    killall
    links
    locate
    ls
    lynx
    mkdir
    mv
    random text to get past lameness filter - isn't this why we have mods? size does matter!
    open
    pbpaste
    pico
    pine
    ps
    rm
    rmdir
    scp
    screencapture
    random text to get past lameness filter - isn't this why we have mods? size does matter!
    ssh
    su
    sudo
    tail
    tar
    telnet
    top
    touch
    unzip
    uptime
    which
  • 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.

    Each time I login into a Linux box and have to edit a file, I end up with a multi colour screen in which it's hard to find anything and when I have to change a word ([^ ]+) up to the next space, my screen ends up full of yellow blocks.

    Worst vi enhancement ever!

    (yes I know about :syn off)
  • 1) perl 2) expect 3) wget 4) lsof 5) grep 6) lynx 7) ssh 8) emacs (I just know it better than VI) 9) bash 10) screen With those things running, I can pretty much do what I need. I have even installed them on slowlaris machines to make them more linux like.
    • I have even installed them on slowlaris machines to make them more linux like.

      It's amusing to see it characterized as being more Linux like.

      Back in the days of SunOS (pre Solaris), and before Linux, everyone had already installed many of the GNU tools because they were more powerful than the system ones. Expect, emacs, bash, GNU grep, GNU make and a bunch of things were around and quite robust before they got included in Linux.

      I certainly remember having HP-UX, SunOS, and DEC Alpha machines having these t

    1. bash: perfect for building little scripts to perform redundant tasks and is fairly ubiquitous.
    2. vi: gotta use something to write the bash script.
    3. sed: Tweak this and that.
    4. ssh: access, file transfer and port encryption.
    5. wget: gotta agree that it is very nice.
    6. telnet: beats out netcat because not every box has netcat, but very few are missing telnet.
    7. knoppix: yeah, I will call it a tool because I pull it from my toolbox and use over the usually-running OS.
    8. dig: find those mail exchangers and trace re
  • abcde? (Score:4, Insightful)

    by ameoba ( 173803 ) on Tuesday November 01, 2005 @05:43PM (#13927564)
    When did a CD audio ripper become an essential part of an admin's toolkit?
    • Plain and simple, zonk points out that you can not work all the time. Having that available allows you to rip to your local machine and then listen to them as you work. Made total sense to me.
  • But some seamingly important pieces seem to be missing from most major commercial distros.

    lsscsi (list SCSI device info including nodes and ID's) scsiadd (is there a new/better way to do this? Scsiadd is fine, but it wasn't part of the Centos toolkit and required some research and a compile. I'm not complaining, but adding and removing drives from arrarys seems like a pretty important function.) after that I supose I'm just going to be repeating variations of what everyone else says: sh/bash/ksh/etc vi
  • apt-get update ; apt-get dist-upgrade

    Oh. Not everyone uses Debian, right, sorry. They should, though. *mumbles*
  • From what Zonker writes, it seems that Screen is a good thing. I had a look at its info page and it looks like the sort of thing that will require some study before use. Scanning this /. page, I saw nothing discussing Screen.

    Hence, I pose a direct question to /.ers. Is Screen a "good thing" (TM)? If so, would you be so kind as to provide an example to supplement the one Zonker noted? On this list we have lots of clear examples of the usefulness of other tools. If Zonker is right, then it would be gr

    • by Wizarth ( 785742 ) on Tuesday November 01, 2005 @06:32PM (#13927970) Homepage
      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).
    • by jptxs ( 95600 ) on Tuesday November 01, 2005 @06:34PM (#13927981) Journal
      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.
  • by mybecq ( 131456 ) on Tuesday November 01, 2005 @06:07PM (#13927775)
    When you absolutely, positively have to know why your system isn't interoperating with the rest of the network, tcpdump will provide the answer. That is, assuming you know what it all means.

    There's no easier way to lay the blame squarely in the Windows camp (or to eat your hat)...

    A few diagnoses I've performed:
    • Providing the exact query in a web-developers app that was causing major problems
    • IE doesn't work with proxy because it sends invalid HTTP/1.0-formatted requests.
    • Connection to AD only works intermittently because your LDAP bind limit of 5 seconds is not long enough
    • Latency through the roof due to email/web/etc
    • Service unavailable because remote port is not listening
    • etc...

    I would say tcpdump is the #1 program for serious problem-solving -- at least with the work I did...
  • by jd ( 1658 ) <imipakNO@SPAMyahoo.com> on Tuesday November 01, 2005 @06:10PM (#13927797) Homepage Journal
    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.

  • great tools (Score:4, Informative)

    by codepunk ( 167897 ) on Tuesday November 01, 2005 @06:15PM (#13927840)
    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.
  • by toofast ( 20646 ) on Tuesday November 01, 2005 @06:32PM (#13927967)
    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...

    • > 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...

      Sure, but ldding the binary is a better way to discover is the app supports TCP wrappers.
      ldd /usr/sbin/sshd, for example, mentions libwrap.so

      But really, whether an app uses TCP Wrappers or where it looks for SSL certificates should be documented plainly. I think /etc/pki may also be an upcoming FHS standard for certificates too.

      strings
    • dmidecode! (Score:3, Informative)

      by Nailer ( 69468 )
      Your /proc stuff if great, here's a handy accompaniment: ever logged onto a system and had no idea what it is? Maybe a crappy Dell Poweredge or whiteboxx kit, maybe a nice solid IBM/HP box? Wanted to get the system's asset tag for support reasons?

      dmidecode. Part of the kernel-utilss package on most Linux distros.

  • GNU Screen. (Score:3, Interesting)

    by SlapAyoda ( 6041 ) on Tuesday November 01, 2005 @06:32PM (#13927968) Homepage
    I'm surprised at how few serious *NIX Administrators I know are using GNU Screen [gnu.org]. 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.
    • Re:GNU Screen. (Score:3, Informative)

      by darkwhite ( 139802 )
      Concur. But even more importantly, screen by default doesn't come with any sort of on-screen window list. This .screenrc line makes a screen session tremendously more comprehensible to me:

      backtick 1 0 0 whoami
      caption always "%>%{kw}%1`@%H %{bw}%?%-Lw%?%{bW}%n*%f %t%?(%u)%?%{bw}%?%+Lw%?%"

      This will put a caption at the bottom of the screen listing your open shells and highlighting the current one.
    • Re:GNU Screen. (Score:3, Informative)

      by darkwhite ( 139802 )
      Also, put this in your ~/.bash_profile:

      if [[ `who -m` ]] ; then
                      [ -z "$WINDOW" ] && screen -xdR
      fi

      to start screen automatically on terminal logins and grab the previous screen session.
  • Fuel for the fire (Score:3, Interesting)

    by ctr2sprt ( 574731 ) on Tuesday November 01, 2005 @07:02PM (#13928207)
    I'll go ahead and add my list of tools I find myself using all the time. Note that because I admin more than just Linux boxes, I only use tools which are likely to be present on every Unix variant.

    • find. It can be a handy ps replacement for boxes you think might be rooted (find /proc -name exe) in addition to all its other uses.
    • xargs. Everyone uses it with find, but it's also good with...
    • awk and/or cut. Need to reset quotas for 900 users? awk -F: '{if($3 >= 1000) print $1)} | xargs edquota -p protouser.
    • sh. If you need to run more than one command via xargs, you can use a while loop in sh. I actually prefer tcsh as my interactive shell because of its nifty history-completion feature, but it's weaker at scripting.
    • sort and uniq. They get one item because I almost never use them individually. Your webserver's getting DoSed and you want to know what IPs to firewall? netstat -an | awk '$4 ~ /:80$/ {print $5}' | cut -d: -f1 | sort | uniq -c | sort -n.
    • grep -v. Yes, the -v is part of it: I almost never use regular grep for some reason. -v does the opposite of usual grep and excludes matching lines, which for me turns out to be much more useful.
    • telnet. Same reason as in TFA. I mainly use it as a quick way to see if relaying is actually disabled or not, or if a service is hung. (Running according to ps, listening according to netstat, accepting connections, but not doing anything.)
    • less. Mainly because some versions of more are worthless and won't allow you to scroll up, for example.
    • vi. You need an editor, and once you climb the sheer face of vi's learning cliff, this is good at it. I still can't stand to use vi for coding, but for writing and adjusting config files it's great. Also it's pretty much the only editor guaranteed to be in all of Solaris, HP-UX, IRIX, FreeBSD, and RedHat Linux, so it's not like I have much of a choice.
    • ssh. The all-purpose Swiss Army Chainsaw of networking. If you need to move data across a network, ssh can do it. It may be complicated, painful, and slow, but by God it can be done. ssh outer ssh border ssh inner tar czf - / | ssh storage 'cat >inner.tar.gz'.

    There are other useful tools, but I pretty much use those on every single box I touch for any reason.

  • My Ten Would Be... (Score:3, Interesting)

    by Shads ( 4567 ) <shadusNO@SPAMshadus.org> on Tuesday November 01, 2005 @07:16PM (#13928319) Homepage Journal
    ... (as a sysadmin)

    grep - Simple, Powerful, Elegant
    sed - Powerful and versitile
    awk - For what sed doesn't do easily
    perl - For what awk doesn't do easily
    vim - In the end there can be only one... it's vim.
    cut - is your friend
    make - automation is good and make makes it easy
    lynx - great for testing web stuff
    slrn - news, it keeps you sane after being locked in the closet for a month
    mtr - just flatout helpful
  • by Flunitrazepam ( 664690 ) on Tuesday November 01, 2005 @07:18PM (#13928339) Journal
    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?

  • Instead of cdargs... (Score:4, Informative)

    by Clueless Moron ( 548336 ) on Tuesday November 01, 2005 @08:22PM (#13928834)
    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.

  • Comment removed (Score:3, Informative)

    by account_deleted ( 4530225 ) on Wednesday November 02, 2005 @02:13AM (#13930345)
    Comment removed based on user account deletion
  • Here's my list (Score:3, Interesting)

    by insomaniac ( 469016 ) on Wednesday November 02, 2005 @06:01AM (#13930870)
    Here is my list of tools I can't live with in my admin life:

    #1: vim (My editor of choice for anything)
    #2: netcat (beats telnet for the network testing forte)
    #3: ssh-agent/ssh (for secure remote logins and other nice tricks (like tarring over ssh)
    #4: nmap (for a quick network scan to see what hosts are up in an unknown network or an in depth portscan of a particular machine)
    #5: perl (who needs shell script when you have perl ;))
    #6: mtr (cause traceroute is sooooo 1980's)
    #7: screen (for those long taking operations on a bad network connection)
    #8: grep (the all purpose filter/text finder with -r)
    #9: find (flexible find/recursive operations tool)
    #10: host (quicker and easier name resolves than dig)
  • My list... (Score:4, Interesting)

    by ledow ( 319597 ) on Wednesday November 02, 2005 @07:56AM (#13931182) Homepage
    - 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?)

"Hello again, Peabody here..." -- Mister Peabody

Working...