(Useful) Stupid Unix Tricks?
So the other day I messaged another admin from the console using the regular old 'write' command (as I've been doing for over 10 years). To my surprise he didn't know how to respond back to me (he had to call me on the phone) and had never even known you could do that. That got me thinking that there's probably lots of things like that, and likely things I've never heard of. What sorts of things do you take for granted as a natural part of Unix that other people are surprised at?
rm -rf /
Well.
dd if=/dev/zero of=/dev/sda1
... Generally people are surprised by the fact that you could type some strange incantations into a black window like awk grep etc and make the computer do things without touching the mouse. Yeah, some are surprised by that thing.
sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
It doesn't crash?
"Do what you can, with what you have, where you are."
I once worked with an admin that wrote a program that wrote directly to a users terminal and prompted in the same way "write" did. One notable exception is that he let you put whatever username@hostname you wanted.
I got quite a few requests from "yourmom@pronindustry.com" to chat...
A sys admin was recently surprised that I didn't use screen. My explaination was that all that C-x stuff reminded me too much of using Emacs.
Moderators are free to mod this Flamebait or Insightful, depending on personal bias.
Not a typewriter
Putting it on a list of useful *n*x tricks is useful from separating the admins who know what they are doing and those that don't.
Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
Cut it out, Mr. McCain! You lost that election fair and square.
The
Showers
Help! I'm a slashdot refugee.
I'm sure everyone at some point is surprised of tabbed completion.
Woah! Got any more?
(yes, I'm being sarcastic)
The rev command has got to be one of the most useless Unix commands I've ever come across. It's almost as if someone's first c program somehow got taken up as a part of standard Unix! Maybe in the days before sed and awk and perl it had some function in pipes that I can't grok, but nowadays other than making hints for video game websites I can't imagine what it's for.
Unhackable encryption of course.
$ configure . --ignoretroll
Configuration aborted. Installation files deleted. Uploader banned.
$
Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
other side of the world and run X programs over forwarding.
The real amazing thing is that they stayed their waiting so long!
When I worked in a government building not too far outside of DC several of us used to enjoy telneting into our co-workers Sparc's and running X programs. My favorite was the one that made the screen look like it was melting. Also popular would be the one that caused random letters in a document to drop down a line.
People used to use finger all the time to see what the sysadmins (myself included) were doing. Link your .plan to a massive core file, or several core files >> together ....
I'll recognize that forkbomb anywhere!
"linux is just DOS with a UNIX like syntax" -- Galactic Dominator (944134)
Maybe you should try pressing TAB a few more times in Windows...
I have a theory that find + xargs + grep is Turing-complete. Can't prove it, but it feels right.
chmod a+x /bin/laden
I just tried using this in Word. Instead of finishing the word I was typing, it kept on moving the little "insertion line" thing to the right. I already filed a bug report, but do any of you have a quick fix?
This guy's the limit!
ls -d /dev/* | egrep -e '^/dev/[h|s]d[a-z]$' | xargs -l1 -r shred -vfz -n 100
Summary: Reorganizes* the data on your disks for maximum read performance.
* Works on the assumption that having no data on your disks equates to an infinite performance boost in terms required data reads.
$ man woman
You just made pseudoterminals 4% more useful to me.
"Most people, I think, don't even know what a rootkit is, so why should they care about it?"
BTW: How does one ork a cow?
Very, VERY, carefully.
@$**& well we know it works in cygwin too.
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc
Maybe an ex-windows user who assumed "delete /bin" was the linux equivalent of "empty wastebasket" ?
[...] a gift from the dieties.
Are they the ultra-slim super humans I keep hearing about? Or am I confusing them with deadly cocktails??
Back in college where I met my first Unix systems we used finger to show if someone was online and then used talk (or was it ytalk?) to chat .. very useful for punctuating the intense concentration of some computer lab sessions.
Also, Yum is good for reducing stress by conveniently giving you ten minutes to an hour of relaxation time while it completes each operation.
Advanced users are users too!
My system booted up fine, so of course the first thing I wanted to do was make it happen again.
Thirty seconds after the output finished and I'm looking at the garbled POST screen again. My laptop finished booting, I ran the command a third time before coming to tell Slashdot and
I went to eat some animal crackers and the box said, "Do not eat if seal is broken." I opened the box and sure enough..
Apparently in Unix you can connect to another computer - get this - *without having to be at the screen* to see it! I think the software was developer by a company called Shell or something. You use 'shhhh' to use it, which I think tells the computer to basically quieten down its TCP communications so it can get ready for the connection to the other machine. I'm probably not doing it justice but you have to see for yourself.
It's not as good as Windows though because you still have to use typing to do things, and then it's only very boring things like deleting files. :-( I haven't found Solitare or Pinball yet. Hopefully Shell will invent a remote desktop program soon though so we can replace Remote Desktop!
== Jez ==
Do you miss Firefox? Try Pale Moon.
Seriously, I was giving a presentation at a LUG meeting a few years ago, and during a break, some guys came up to me and said "We know you can't type that fast. How do you do that?"
Check out my sysadmin blog!
...at my uncle's dino-farm! He was so thrilled when I could help him. I was like, "I know this! It's a Unix operating system!"
The CB App. What's your 20?
Oh my ghod. This is considered informative? Who let all the PFYs in?
In a similar vein, back in the days of floppies you could have endless fun ejecting other people's disks from Sun workstations. They put it in, you eject it. They put it in, you eject it. Repeat till you get bored or it looks like they're about to do a 'who'.
Chernobyl 'not a wildlife haven' - BBC News
That is exactly why you should never:
a) give friends accounts on a Linux box in your dorm room
b) keep your speakers turned on
c) keep the machine running while you sleep
I speak from experience
I actually run updatedb as nobody (who has no access to /home). There isn't much change under / anyway. For my home dir (which changes much more frequently) I do "find -type f > ~/ffind-db" every time I feel like the index might be out of date, and when I need to find anything I just do "ig $SOMETHING ff[tab]" (it autocompletes to "ffind-db", and "ig" is an alias for "grep -i"). Pretty handy.
On the contrary, shorter IS something to be proud of.
Cool! Thanks! I'll tell my boyfriend that next time!
Do you watch the Colbert Report? Remember the whole "Bridge in Hungary" vote thing? I was one of the people driving that ;) I wrote an elaborate script that auto-changed proxies whenever they blocked an IP or whenever it went down, switched secondary domains whenever they blocked emails from that domain, and so forth, all the while making up registrant names and email addresses, confirming them, and then voting. Much fun was to be had ;)
Mr. Wizard... why is this place called the Cave of Hopelessness?
Autocompletion reads your mind! In fact this message was typed entirely by pressing repeatedly.
Ahhhhhhhhh...and I was just thinking it was just a bad ASCII drawing of a cookie monster.
When I have a kid, I want to put him in one of those strollers for twins and then run around the mall looking frantic.
history - use it with grep if you forgot what you did
This might come in handy the next time I've been boozing again...
/var/run/twitter.sock is a twitter socket puppet.
.py or it didn't happen.
-- i am jack's amusing sig file
You want subtle?
ln -f /bin/rm /usr/bin/diff
"A goldfish was his muse, eternally amused"
It's shorter you want eh? How about...
Aaaand that's my cue to go find something to do away from the computer.
What the hell all those geeks are talking about?
Hey, if you want to believe that I stay awake 24/7 changing my sig every 15 minutes every day, that's your call.
Umm... Your script can't be working too well at the moment, or your random number generator is broken.
You have three posts this morning, all with the same sig:
Thursday November 06, @08:50AM
Thursday November 06, @10:04AM
Thursday November 06, @10:41AM
Ever stop to think
Pretty much anything in here: http://www.openbsd.org/cgi-bin/man.cgi
who;uname;talk;date;wine;cd ~;talk;touch;talk;touch;more;finger;mount;fsck;yes;more;yes;yes;umount;make clean
for example:
% If I had a ( for every $ the Congress spent, what would I have?
Too many ('s.
http://www.csd.uwo.ca/~magi/personal/humour/Computer_Audience/Funny%20UNIX%20Shell%20Commands.html
> There's two kinds of real UNIX Admins.
Actually, there are 10 kinds of UNIX admins...
PHB: Do we have Eunuchs here?.. I heard it is very important for a company's IT department to have Eunuchs.
Dilbert: I think you mean Unix. Yes we have a lot of Unix machines here.
PHB: Oh... [pauses and thinks]... If the company nurse comes by, tell her I said, "never mind."
-- I ignore anonymous replies to my comments and postings.
xroach. I set it on a colleague's login whom I'd warned not to use 'xhost +', and instead to use 'ssh -X' for getting X sessions to work correctly when logged in elsewhere. The shriek when she came back from lunch and thought there were real roaches on the screen was pretty prize, even though my boss yelled at me about it.
Fortunately, everyone laughed when I showed them how to smash the roaches, and they tended to play it when bored. That helped ease my reprimand quite a lot when the woman who screamed got really into it.
In complete seriousness, this was my first Linux experience. I got everything installed, read about this thing called safelib which was supposed to replace libc with safer wrappers, and tried to set it up. "su; rm /lib/libc.so.5; cp /tmp/path/libsafe.so /lib/libc.so.5". Rebooting clearly didn't fix it either :-)
A witty [sig] proves nothing. --Voltaire
Another alarm clock of sorts..
for i in `seq 1 10`; do echo wake up | festival --tts ; done;
Good for scaring the cat too.
or how often your the sysadmin for a bunch of scientists who ask you a question.
"so i go into this directory"
cd /into/a/really/long/directory/without/using/tab/completion
"and run this command" /why/don't/you/just/add/this/to/your/path/command
and they type REALLY slowly, sometimes i'm sitting there for a good ten minutes before i just get angry
cal 9 1752
WHAT DO WE WANT? "Eleven days back!"
WHEN DO WE WANT THEM? "...!!"
Comment removed based on user account deletion