Sponsored by Sony Pictures
Watch a scene from 2012, in theaters November 13 view!
whowillsurvive2012.com - Get ready for the biggest event in history – the end of time. How will you survive? 2012- opening 11/13
124 Comments
- goatrandy, on 10/12/2007, -2/+54Well, if this article is talking about my coworkers than number 1 would have to be 'man'. :)
- sanguinemoon, on 10/12/2007, -2/+44pstree only is worth a digg :)
- minivanmegafun, on 10/12/2007, -2/+26They're forgetting tac.
tac (1) - concatenate and print files in reverse
I still have yet to find a use for it. - legalcondom, on 10/12/2007, -2/+26@JoshuaH
Many of us make a living using linux, most of these should be staple commands of any sysadmin. - pinetree, on 10/12/2007, -4/+27Yeah, I've used at least half of the commands on the list, but pstree is new to me and very handy.
- xutopia, on 10/12/2007, -3/+26When using pipes it is usually smarter to use the reducing command first before passing it on to another program.
So instead of writing:
$ nl wireless.h | head
You should write:
$ head wireless.h | nl - JoshuaH, on 10/12/2007, -5/+27I wonder how many people are gonna say they know all/most of these commands already...when they didn't.
- JoshuaH, on 10/12/2007, -3/+15@legalcondom
Oh, I meant no disrespect to people who actually know them and use them, I just mean every time there is an article like this, a bunch of people always go:
"omfg, I know all these, and use them all the time." - daborg, on 10/12/2007, -1/+12Nice although bc and ldd are staple commands. But the rest are very useful.
Maybe it should have been titled "10 Linux commands you may not have used". :-P
Oh wait, I forgot, sensationalism sells. - Fordi, on 10/12/2007, -1/+11You'd like 'killall' as well, then.
- bradchoate, on 04/11/2008, -8/+18For what it's worth, 7 of the 10 also work on Mac OS X. As for the others...
pstree doesn't come with OS X, but MacPorts is your friend (a link to the latest binary .dmg release I could find):
http://svn.macports.org/repository/macports/downloads/DarwinPorts-1.3.1/
Once ports is installed, you can install pstree using:
sudo port install pstree
For pgrep and pkill, use proctools:
http://sourceforge.net/projects/proctools/
And while ldd is for ELF binaries, 'otool' works on Mach-O binaries, and comes with OS X. For example...
otool -L /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder
otool -L /usr/bin/nslookup - jcims, on 10/12/2007, -1/+10@Fordi
Bash has arithmetic functions, e.g.
[me@my ~]$ a=$(( 2 * 2 ))
[me@my ~]$ b=$(( $a / 2 ))
[me@my ~]$ echo $a$b
42
man bash
/Arithmetic Expansion - snorcup, on 10/12/2007, -2/+10You could also ad cd, ls, cdmod, rm, and grep to that list if you are talking about the average digg user
- xutopia, on 10/12/2007, -1/+9you can actually type in the stuff without the tics and it'll output "rm rf /"
For those newly on a unix/linux machine that will delete everything your user has rights to delete. - kuribo, on 10/12/2007, -3/+10Does anyone even have "decades" of experience with Linux? Unix maybe, but wasn't Linux started in the 1990's? Isn't this like requiring ten years experience with Windows XP?
- pauldonnelly, on 10/12/2007, -4/+11I'll take ps -eH over pstree, since pstree doesn't show PIDs.
- sanguinemoon, on 10/12/2007, -1/+8"Does anyone even have "decades" of experience with Linux? " Yes and no. It's true Linus started Linux in 1991, but these, technically, are BASH commands and not specific Linux commands. BASH was started ~1978. So it is possible to have decades of BASH experience.
- mercurysquad, on 10/12/2007, -1/+7"Does anyone even have "decades" of experience with Linux? Unix maybe, but wasn't Linux started in the 1990's? Isn't this like requiring ten years experience with Windows XP?"
A few years ago, I saw a job advert in a local newspaper for the position of Senior Designer or something, asking for 20 years experience in 'multimedia development', among other things. I kid not. - legalcondom, on 10/12/2007, -1/+7Most of these are your average sysadmin should know... come on ldd? lsof?
mkfifo on the other hand, that's pretty useful and I'll probably be using that soon enough. Much better than that command list a few days ago though. - btmiller, on 10/12/2007, -1/+7Nice list, but anyone who's been administering Unix systems for any length of time will probably have used at least half of these (I've used 7).
- VinylDood, on 10/12/2007, -2/+7mkfifo, pstree, split and pgrep are some of the most useful on this list. However, what kind of sysadmin doesn't know ldd or lsof?
- norris, on 10/12/2007, -4/+9Three Linux Commands I've Never Used:
1) rm -r /*
2) cat /dev/random > /etc/passwd
3) chmod -R 777 /* - fuzzyping, on 10/12/2007, -0/+5Nobody mentioned screen? Need to start a kernel compile, background it, and reconnect when you get home? Screen to the rescue!
- Urusai, on 10/12/2007, -0/+5Real men toggle switches and get blinkenlight output.
- ilikejam, on 10/12/2007, -1/+5'ps afux' instead of ptree.
- Conway, on 10/12/2007, -3/+7Good point. Not sure many people remember to do that until they are doing operations on a large scale. This is a great tip to improve performance of repetitive scripts.
- inactive, on 10/12/2007, -5/+9@JoshuaH
Psh, I use all of these every day. Old news. - sanguinemoon, on 10/12/2007, -1/+5"I'll take ps -eH over pstree, since pstree doesn't show PIDs."
Good point as well. pstree -p will also show the PIDs, but in parenthesis. So it seems to just be a matter of preference :) - lolhax, on 10/12/2007, -0/+4Another command which won't cause as much damage. Just a restart will bring you back to normalcy :)
$ :(){ :|:& };:
It's called a fork bomb, and more info here -> http://www.euglug.org/pipermail/euglug/2005-August/004338.html
Just go on IRC and get some random linux user to type it ;) - noamsml, on 10/12/2007, -0/+4Screen is also awesome for starting GUI apps and then closing the terminal window.
- sneugol, on 10/12/2007, -0/+3This is a very good advice in general, but I think the author of this list wanted to show us the 10 first lines of output of nl file, not to "nl" 10 first lines of this file. He wanted us to see how nl works on a file. Of course the effect is the same, but the idea is different.
- whovian, on 10/12/2007, -0/+3bash blows for floating point operations; assignments are better done using the output from bc. You can get around this somewhat using zsh for your shell.
- AngryBoy, on 10/12/2007, -0/+3Try this one sometime:
cat /dev/hda > /dev/audio - Rocketmac, on 10/12/2007, -0/+3 What if you use, say, 7-8/10 of these on average per day? Oh yeah, I guess that would make you a Linux Administrator.
Good post for those newer to Linux. - fairwinds, on 10/12/2007, -0/+3@cjoey19
Ever heard of putty? Guess not.
Yeah. - ilikejam, on 10/12/2007, -1/+4@Fordi
How about:
((COUNTER++)) - linuxpenguin, on 10/12/2007, -0/+3I hate titles like that. I've never heard of or used pstree, lsof, or split? Really? I wasn't aware of that.
- jownz, on 10/12/2007, -0/+3No need to add the * at the end of 1 and 3.
1 should be rm -rf / -- the f is for force. - jfinke, on 10/12/2007, -0/+2That was my reaction as well. Any sysadmin worth anything has come across those commands. It would have been nice if he had not written the sensationalism headline. But, I guess that is what sells around here.
"10 Obscure Commands That May Help" isn't quite as good as the title. - noamsml, on 10/12/2007, -1/+3Dugg because I've never used any of those commands, and because they're pretty damn useful.
- phill, on 10/12/2007, -0/+2I've used Linux from 1994 til 2000, then switched to FreeBSD and Mac OS X. I still use Linux from time to time when I have to. Yes, I have used most of the commands listed. Some more than others.
- tehmoth, on 10/12/2007, -3/+5pauldonnelly: guess you should use a different pstree. pstree from http://fresh.t-systems-sfr.com/unix/src/misc/ shows process IDs
- smcd, on 10/12/2007, -0/+2This won't work for many reductions. Think about the difference between this statement which is quite useful line locator:
$ nl wireless.h | grep foo
versus this one which is not as useful - just counts the output lines:
$ grep foo wireless.h | nl
or maybe this which gives the best of both - a count and then the original line number:
$ nl wireless.h | grep foo | nl
However, my guess is that you already know this. :) - mohaine, on 10/12/2007, -0/+2Just don't run killall as root on Solaris. It does what it says while ignoring all command line args. Very bad. Think shutting down without a restart.
- otomo, on 10/12/2007, -0/+2Yeah for linux commands these aren't so esoteric. The xml one is the only one I haven't used. Mainly because I hate xml as a config file format. The nl command is about as useless as hitting your head against a wall if you ask me. Maybe if we used basic still it might have a point.
You want esoteric you need to ask your local Solaris admin what ff does. If he doesn't know he isn't a good Solaris admin.
And be careful with mkfifo please, yes you can do awesome things with it, but it is of limited use most of the time. Pipes are there for a reason.
My addition (besides ff) is grep -A2 -B2 "^ssh" /etc/services, helps with getting context on matches. - TheNakedChef, on 10/12/2007, -0/+2I've used all of the commands except this one and it seems like a fast way to sort/reverse file. I wish I knew about it before.
- takeda, on 10/12/2007, -0/+2lol, here it goes again =)
- Fordi, on 10/12/2007, -1/+3Heh, you have no idea.
One of my favoritest bash scripts is a DVD transcoder I wrote utilizing MPlayer. It would shift the transcoding process to the background, feeding its output to a temp file, then tail $XCTEMP to get the last line of progress to calculate the progress meter. That's about when I *learned* about tail, and was, originally, trying to do use grep to get the last line that matched the status text.
Stupid. Slowed everything down (even just running once a second interspersed with sleeps). Tail brought everything up to speed nicely. - aposter, on 10/12/2007, -0/+2@mercurysquad
Not decades, but I started with Yggdrasil plug and play Linuxin May or June of 1994. The oldest working distro CDs I have are Walnut Creek "Toolkit For Linux" August 1994 editon, so some people have more than a decade of experience. - DrDabbles, on 10/12/2007, -0/+2I've used all of them but xmlwf. And for the life of me, I can't figure out why you'd want to calculate SQRT at the command line. But, to each their own I guess.
-
Show 51 - 100 of 124 discussions



What is Digg?
The Digg Toolbar for Firefox lets you Digg, submit content, and keep track of Digg even when you're not on the Digg site. Download the official