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."
Most important item (Score:5, Funny)
strace (Score:3, Informative)
Re:strace (Score:3, Informative)
Forensic and Incident Response Environment: http://fire.dmzs.com/ [dmzs.com]
Linux Bootable Business Card: http://www.lnx-bbc.org/ [lnx-bbc.org]
Ultimate Boot CD: http://ubcd.sourceforge.net/ [sourceforge.net]
Knoppix Security Tools Distribution: http://www.knoppix-std.org/ [knoppix-std.org]
SystemRescueCd: ahref=http://www.sysresccd.org/rel=url2html-26348 [slashdot.org]h ttp://www.sysresccd.org/>
FLAME ON! Or not.... (Score:5, Insightful)
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?
I got yer flamewar right here! (Score:5, Funny)
Re:I got yer flamewar right here! (Score:2)
Re:I got yer flamewar right here! (Score:3, Funny)
PS (Score:3, Funny)
http://curl.haxx.se/docs/faq.html [curl.haxx.se]
1.3 What is curl not?
Curl is *not* a wget clone. That is a common misconception. Never, during
curl's development, have we intended curl to replace wget or compete on its
market. Curl is targeted at single-shot file transfers.
Re:I got yer flamewar right here! (Score:3, Interesting)
Oh yeah? (pr0n howto) (Score:4, Informative)
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
Re:FLAME ON! Or not.... (Score:5, Insightful)
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.
Re:FLAME ON! Or not.... (Score:3, Interesting)
Clasis usability (Score:2, Insightful)
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)
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
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)
d that bash has made some progress over the years, but zsh is my friend.
Comment removed (Score:4, Informative)
Re:Mine (Score:4, Informative)
Elinks rocks... (Score:3, Informative)
Re:Mine (Score:2, Informative)
Re:Mine (Score:3, Interesting)
My additions
Re:Mine (Score:4, Interesting)
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)
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.
Yes (Score:2)
Re:Mine (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 [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)
Re:Mine (Score:2)
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)
> * [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
Re:Mine (Score:2)
grep: aliased to egrep
I've used netcat a long time ago, I'll look back into it. I forgot about it.
Oh, and another command:
netstat
Re:Mine (Score:5, Funny)
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!
help please. (Score:2, Interesting)
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)
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.
Re:help please. (Score:2)
Here you go:
http://vimdoc.sourceforge.net/ [sourceforge.net]
most used keystrokes
Wow, this AC must have never used vi or vim
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
Telnet ...? (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 [debian-adm...ration.org].
Missing tools from the list? curl, links/lynx, rsync, sudo, nmap, lsof, and less.
Re:Telnet ...? (Score:3, Insightful)
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)
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)
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)
preferably with the -Rf options.
Not a bad article (Score:3, Insightful)
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.
Right on with rsync (Score:2)
Re:Right on with rsync (Score:2)
It is also the ultimate off-site backup (using rsync w/ssh over the internet).
nload (Score:2)
Webmin (Score:3, Informative)
http://www.webmin.com/ [webmin.com]
Make your own list! (Score:3, Insightful)
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
Re:Make your own list! (Score:2)
You should've added 'uniq -c' and sorted that
Re:Make your own list! (Score:2)
Re:Make your own list! (Score:2)
Trying this: cat
I get output like this:
3 telnet
3 telnet
3 uuidgen
4 cd
4 ps
4 ssh
4 tar
7 cat
Something's not right... it seems like it's performing 'uniq' on the whole command, not just the single word that pops out of 'awk.'
Re:Make your own list! (Score:2)
a longer list would have shown more repeats, like so:
cat
2 sudo
2 sudo
2 tail
2 tail
2 top
2 uuidgen
2 which
3 curl
3 curl
3 echo
3 grep
3 grep
3 grep
3 grep
3 ls
3 ls
3 ls
Re:Make your own list! (Score:2)
Re:Make your own list! (Score:3, Insightful)
2378 ssh
1856 ls
1246 cd
496 mysql
448 find
431 wget
428 man
419 less
407 su
393 grep
Re:Make your own list! (Score:3, Funny)
$ awk '{print $1}'
1 bash
I prefer this one (Score:3, Interesting)
Vim? Colour hell! (Score:2)
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
My top 10 (Score:2)
Re:My top 10 (Score:2)
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
Top ten (Score:2)
abcde? (Score:4, Insightful)
You may wish to read first (Score:3, Funny)
Correct me if I'm wrong... (Score:2)
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
Re:Correct me if I'm wrong... (Score:2)
My favorite (Score:2, Funny)
Oh. Not everyone uses Debian, right, sorry. They should, though. *mumbles*
Other comments on GNU Screen? (Score:2)
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
Re:Other comments on GNU Screen? (Score:5, Informative)
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).
Re:Other comments on GNU Screen? (Score:4, Informative)
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.
Without a doubt: tcpdump (Score:3, Informative)
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:
I would say tcpdump is the #1 program for serious problem-solving -- at least with the work I did...
Depends on the admin role I'm in (Score:5, Informative)
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)
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.
Maybe a few lesser-known (Score:5, Informative)
strings. Good to check if executables are using
vmstat. Think your system is paging, or a card is generating too many interrupts?
awk and sed. Mentioned elsewhere, but priceless.
chmod. I think the Linux filesystem permissions are too
*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
There may be more, but I can't think of any others right now...
Re:Maybe a few lesser-known (Score:3, Informative)
Sure, but ldding the binary is a better way to discover is the app supports TCP wrappers.
ldd
But really, whether an app uses TCP Wrappers or where it looks for SSL certificates should be documented plainly. I think
strings
dmidecode! (Score:3, Informative)
dmidecode. Part of the kernel-utilss package on most Linux distros.
GNU Screen. (Score:3, Interesting)
Re:GNU Screen. (Score:3, Informative)
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)
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)
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)
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
'kill -9 1' will get you laid (Score:3, Funny)
Instead of cdargs... (Score:4, Informative)
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)
Here's my list (Score:3, Interesting)
#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)
- 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,
- dd, cat, more, sh, etc.(where would we be without them?)
Re:Vim? Emacs foreva! (Score:3, Informative)
Re:Vim? Emacs foreva! (Score:5, Funny)
Re:Vim? Emacs foreva! (Score:4, Insightful)
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.
Re:Vim? Emacs foreva! (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.
Re:Vim? Emacs foreva! (Score:3, Funny)
Obviously and sadly, the gay niggers are intellectually superior to you.
Re:Vim? Emacs foreva! (Score:3, Funny)
I don't have any problem with that, I'm secure in my race and my sexuality. What I find amusing is that the gay niggers are intellectually superior to the people writing the lameness filter.
Re:Vim? Emacs foreva! (Score:2)
They both have their uses, really. If we're talking programming or editing XML, it's emacs all the way. nxml-mode really beats the shorts off of everything on the market, free or not. But administration, especially if you're going to be doing it through an xterm to a remote machine, is strictly a vim thing.
I'd really like to learn how to use vim better, but since I spend most of my time writing XML and not editing plaintext, I don't have much opportunity.
Re:Vim? Emacs foreva! (Score:2)
Go flameware! Go Zonk! Go /. (Score:3, Funny)
Re:Vim? Emacs foreva! (Score:5, Funny)
Ctrl-x
Ctrl-c
vi
Re:Vim? Emacs foreva! (Score:3, Informative)
As for vi, I know how to do basic stuff in it, but it basically upsets me. I have a wrt54g that doesn't have emacs on it and editing config files is a PITA. Why doesn't vi let me go to the end of the line b
Re:My List (Score:4, Funny)
- 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
Re:A windows XP CD (Score:2)
I use Gentoo, and it handles just about everything for me, holds my hand through everything....And most other distros are even more friendly. The last time I had to set LD_* was with a strange and rare piece of software meant for Windows but designed with interoperability in mind.
You don't even need to compile a kernel these days, even with a radical change of hardware. Coldplug and hotplug manage it all for you.
Really, you should just try Linux for one day. You'll
Re:SSH (Score:2, Informative)
Re:SSH (Score:5, Informative)
Re:SSH (Score:3, Informative)
It "expects" certain things and provides an appropriate output.
Re:SSH (Score:4, Informative)
Also, if you haven't already, check out nmap-ncat [sourceforge.net].
Re:SSH (Score:3, Informative)
Re:Zonker... (Score:2)
Re:Nice.. though.. (Score:2)
Re:indispensable: zsh & mmv (Score:3, Informative)