Sponsored by Realtor.com
Top 5 most ridiculous properties sold for a single dollar view!
realtor.com - Looking for a deal on your next home? What if you could pay a dollar? What if it was a MLB stadium or a university?!?!?
57 Comments
- schestowitz, on 10/11/2007, -10/+79look; gawk; talk; date; wine; unzip; strip; touch; finger; head; mount; fsck; more; yes; spray; umount; sleep; leave
- geminitojanus, on 10/11/2007, -5/+65`push .me`,
and then just `touch .me`
till I can `wget .my`
satisfaction - rudy23, on 10/11/2007, -5/+46am sure the only place you guys have done it is at the command line.
- nailer, on 10/11/2007, -3/+28No offense to the the people writing guides to pstree & bc, but I thought I'd add something a little more useful. All of the tips above have served me well in about 10 years of professional Linux administration, training, and design.
I think at least the majority of these should be both new and quite useful for you. - trogdor282, on 10/11/2007, -1/+17Ah yes, that's the most common method, but I would like to point out there's also 'man mount'
- DrColossus, on 10/11/2007, -6/+15Any one else notice that it goes from bonus trick 3 to bonus trick 5
- dirtman777, on 10/11/2007, -1/+9dugg up for giving me a good laugh.
- nailer, on 10/11/2007, -1/+9Hagnar: cron emails you the output of programs. That's how cron works.
I could have included extra commands to pop into a charting program, but I want to keep the examples as simple as possible. - nailer, on 10/11/2007, -1/+9sholdowa: The commands aren't distro specific, but you did find a bug which I've fixed (crontab only needs - for stdin). Fixed, thanks for letting us know.
EarlOfLade: Tee would still require you redirect stderr to stdout. - XgwcE1Q, on 10/11/2007, -2/+8It is documented in the bash(1) man page. The section for the syntax supported is called "ARITHMETIC EVALUATION". Also $[...] is the old (deprecated) style, where $((...)) is the new style.
Bash also supports for loops using arithmetic evaluation:
for ((i = 0; i /dev/null | while read -r size filename; do
echo "${filename} is ${size} bytes in length."
done
(not so much the use of find(1), but the use of a subshell feeder coroutine)
Another example:
(
IFS=':'
getent passwd | while read user pass uid gid comment home shell; do
if [ "${uid}" -gt "1000" ]; then
echo $(id -G "${user}") "x" | while read -d ' ' secgid; do
echo "${user} ${secgid}"
done
fi
done
) | while read user gid; do
echo "${user} has gid ${gid}"
done - diffuze, on 10/11/2007, -3/+9Nothing new here.. but a useful read for newbies. :)
- timdorr, on 10/11/2007, -1/+7I like that NFS trick at the end and the parallelizing of SSH commands. I've been using mussh, but its serialized and, as a result, slow.
- JonLatane, on 10/11/2007, -3/+8Seeing parallelizing "for" loops was a "duh" moment for me. I can't believe I never thought of something so simple!
- nailer, on 10/11/2007, -1/+6jonlatane: Dude it was a duh for me too - once I figured it out.
I'd been wanting to do this for ages but couldn't figure out how to get the '&' needed to background each job not to break the 'for' loop. For my job I regularly need to create masses of simultaneous SSH tunnels - having parallel loops was the reason I learnt 'eval' - cantormath, on 10/11/2007, -2/+7Even if you have seen these commands before, its better then a MS tutorial.
- jenel, on 10/11/2007, -2/+7The list was new to me. And for some other guys who are also not virgins anymore.
- spiffytech, on 10/11/2007, -1/+5Dugg just for showing me how to extract RPMs without extra software (rpm2cpio isn't in the Ubuntu repos)
- IamF, on 10/11/2007, -1/+5Yes a neat list, catching memory leaks with cron was nice.
- nailer, on 10/11/2007, -2/+5> he promised I hadn't seem them before, but I've seen at least a couple of those before.
Since I don't know you personally, it's hard to say exactly what you know and don't know - I'd say at least a couple out of ten's a pretty good rate of new stuff.
> 9 is..wtf? How is it a trick to restore an old config? The fact that you've scheduled it?
> What purpose does that do? you make a change, it fails..okay..lets hang out for 5 minutes while we wait for it to fix?
The fact that you've done it after you've lost access, and would normally be unable to log in and fix it. If you hadn't scheduled it, you'd be screwed.
> bonus trick 1? leave off a letter..wow....someone should tell him 'read' still needs all its letters ''Despite everything you rad on the internet''
Thanks very much for commenting on my spelling. Clearly I don't know that read has four letters, rather than having made a small typo.
> Bonus trick 5? not a trick.. go take any class and they'll harp on that non-stop..
I hope so - at mine I certainly did. But unfortunately half of them start all their for loops with 'for i in'. - xspinkickx, on 10/11/2007, -3/+6/bookmarked
- alanic, on 10/11/2007, -1/+3dpkg is not in every distro, so tip 8 needs editing. Other than that yes, there were some really useful stuff I didn't know.
- jellygraph, on 10/11/2007, -3/+5finally, someone posting useful shell tricks for those who actually use Linux servers and know the basics already
much appreciated, nice! - nailer, on 10/11/2007, -1/+3Cheers syberdave, I've amended the article.
- nailer, on 10/11/2007, -2/+4eridius: Thanks, have updated to show $(( )) as the more modern style.
- syberdave, on 10/11/2007, -1/+3Why is eval required?
It works fine if you use a & instead of a ; after the command.
for I in *; do echo $I & done - eridius, on 10/11/2007, -1/+3Huh, never saw the math shell trick before ($[3 * 2]). Wonder why that isn't documented in the bash manpage?
- ratsg, on 10/11/2007, -1/+2@Nailer
Why is this titled linux. I didn't see anything that was proprietary to linux. This type of stuff would work just fine in BSD or real Unix. Sure, strace would need to be substituted with dtrace/truss or what ever. Same with the package manager.
Don't corner yourself in. There is a lot of neat stuff out there to work with and learn. - DarkJesus, on 10/11/2007, -3/+4Yeah, it is good to see a more advanced look at shell commands.
- nailer, on 10/11/2007, -1/+2speedyrev: er, there's no page dedicated to selling HP laptops. The article you're mentioning is about laptops you don't have to configure to have every component working out of the box with Linux, and mentions Macbooks as another example.
Perhaps you should read it before you comment? - nailer, on 10/11/2007, -2/+3EarlOfLade:
> Whatever 2>&1 | tee filename
Please read the article. - AeroGuy, on 10/11/2007, -2/+3I like the one about using three angle brackets for std in from the command line. Is there a way to strip the EOL(?) from the end so that the program stays open? Like for bc, I get sick of typing scale=6 each time. But if I make an alias for bc (3 angle brackets) 'scale=6', then bc sets scale=6 and exits without my being able to use it.
Thanks in advance if anyone has a suggestion. - yeffetn, on 10/11/2007, -1/+2Very nice and advanced tricks. No need for the eval "" in the parallel loop (#2) just end with &; done.
- Spr0k3t, on 10/11/2007, -1/+2This guide was quite good. Couple of them I already knew... Keep them coming though.
- geminitojanus, on 10/11/2007, -2/+2command > file 2>&1
works for bash, dunno about the rest of the shells. - EarlOfLade, on 10/11/2007, -2/+2@nailer :
Whatever 2>&1 | tee filename - nailer, on 10/11/2007, -2/+2Thanks!
The ampersand with the eval breaks the loop. Eval and quotes is needed. - Error601, on 10/11/2007, -2/+2You mean "how to use bash". Linux has nothing to do with it as bash came first.
- GaryS278, on 10/11/2007, -1/+1I don't know why this was dugg down at all, do any of you linux weenies have an explanation for that. just because someone uses windows doesn't mean you have to autodigg down.
- nailer, on 10/11/2007, -2/+2You're right, various items could be work on other Unixes, with a little tweaking.
But I'd spend half the article on that tweaking. Proprietary Unix doesn't typically have Bash or a modern grep (apart from the new versions, which aren't in widespread use), and still doesn't package most of its apps (one of the things that frustrates me about using it). iptables is specific to Linux too. - speedyrev, on 10/11/2007, -2/+1Yes, I read it. It is 99% text and 100% pics of HP. The Mac mention was in a footnote. Looks like an Ad to me.
- flarn2006, on 10/11/2007, -3/+2I'm using Windows, but I can still have fun with this 'cause I've got Cygwin!
- ps3udov3ctor, on 10/11/2007, -3/+2some of those are pretty good, but how to redirect both stdout and stderr? anyone that doesn't know already that will surely be lost on every other tip they give there.
- davidb, on 10/11/2007, -1/+0Not only that, but the syntax in the article (command &> file) is wrong. "command >& file" would work with CSH or TCSH. "command > file 2>&1" is the correct syntax for Bash or Bourne shell, which is what most Linux users use.
- speedyrev, on 10/11/2007, -3/+1What's with the page dedicated to selling HP laptops(100) ? Is he getting paid for that?
- mike23w, on 10/11/2007, -4/+2nice page. all this information is in the "man" pages for those new to linux.
"man bash", in particular, has a wealth of information or google "bash tutorial" to become a power user. - crossmr, on 10/11/2007, -6/+2You swore that I haven't seen them before. That is a bold statement to make. Maybe you shouldn't resort to hyperbole to push your blogspam.
- WarcraftJunkie, on 10/11/2007, -5/+1Heres a fun one: cat /proc/kcore
or another one sudo rm -rf /
Lol, the first one is fine, but dont try the second.. unless you like deleting all your data :P - IamF, on 10/11/2007, -9/+4% %blow
%blow: No such job. - inactive, on 10/11/2007, -8/+3NERDS
- EarlOfLade, on 10/11/2007, -7/+1New? LOL. Nothing of interest there.
Rather than use the > and >>., use tee, i.e strace program | tee file.
Using ">" esp in programs that may need input is worthless. "tee" is a much better way. -
Show 51 - 57 of 57 discussions



What is Digg?
Browsing Digg on your phone just got easier with our enhancements to the