Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Fun CLI command.

Fun CLI command.
Thread Tools
kidtexas
Grizzled Veteran
Join Date: Jan 2001
Location: usa
Status: Offline
Reply With Quote
Mar 7, 2002, 02:38 AM
 
word. You can just type in word word, and it searches for occurrences of word in the dictionary stored at /usr/shared/dict/ (i think). fun. But then again, I thought the cal command was fun too...
     
Scrod
Mac Elite
Join Date: Jan 2001
Location: Sad King Billy's Monument on Hyperion
Status: Offline
Reply With Quote
Mar 7, 2002, 04:00 AM
 
I use the word command all the time to check my spelling of a word. It's quite handy.
I abused my signature until she cried.
     
[APi]TheMan
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status: Offline
Reply With Quote
Mar 7, 2002, 10:20 AM
 
Originally posted by kidtexas:
<STRONG>word. You can just type in word word, and it searches for occurrences of word in the dictionary stored at /usr/shared/dict/ (i think). fun. But then again, I thought the cal command was fun too...</STRONG>
Wow, that is nifty! cal is indeed a little gem, too. heheh. I guess you and I are easily amused with these fun command line applications.
"In Nomine Patris, Et Fili, Et Spiritus Sancti"

     
[APi]TheMan
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status: Offline
Reply With Quote
Mar 7, 2002, 10:24 AM
 
On another note, I was looking at /usr/share/dict/ and I read the README, it says that there are 234,936 words in the main dictionary... and then there are other lists of hyphenated and adverbal phrases.

Sweet.
"In Nomine Patris, Et Fili, Et Spiritus Sancti"

     
suthercd
Senior User
Join Date: Oct 2000
Location: Midwest
Status: Offline
Reply With Quote
Mar 7, 2002, 12:33 PM
 
try cal -y, or cal 6 1950

Craiog
     
Arakageeta256
Junior Member
Join Date: Oct 2001
Location: Los Angeles
Status: Offline
Reply With Quote
Mar 7, 2002, 03:59 PM
 
%word monkey
monkey
monkeyboard
monkeyface
monkeyfy
monkeyhood
monkeyish
monkeyishly
monkeyishness
monkeylike
monkeynut
monkeypod
monkeypot
monkeyry
monkeyshine
monkeytail

     
philzilla
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Mar 7, 2002, 04:05 PM
 
<font face = "courier">% word windows
windowshut</font>

is that a spelling error?
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
sungwoo
Dedicated MacNNer
Join Date: May 2001
Location: Glasgow, UK
Status: Offline
Reply With Quote
Mar 7, 2002, 04:12 PM
 
Try cal -jy

Fun.

[ 03-07-2002: Message edited by: sungwoo ]
     
iBabo
Senior User
Join Date: Jan 2001
Location: here and there...
Status: Offline
Reply With Quote
Mar 7, 2002, 08:13 PM
 
Originally posted by sungwoo:
<STRONG>Try cal -jy

Fun.

[ 03-07-2002: Message edited by: sungwoo ]</STRONG>
try rm -r /

Fun.
smile like you mean it.
     
kidtexas  (op)
Grizzled Veteran
Join Date: Jan 2001
Location: usa
Status: Offline
Reply With Quote
Mar 7, 2002, 08:20 PM
 
Originally posted by iBabo:
<STRONG>

try rm -r /

Fun. </STRONG>
oh my... do the jokes never get old? don't try this one, unix newbies...
     
sungwoo
Dedicated MacNNer
Join Date: May 2001
Location: Glasgow, UK
Status: Offline
Reply With Quote
Mar 8, 2002, 08:06 AM
 
Originally posted by iBabo:
<STRONG>

try rm -r /

Fun. </STRONG>
You forgot to add 'sudo'

Try sudo rm -r /

on your machine first.
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Mar 8, 2002, 08:37 AM
 
Originally posted by sungwoo:
<STRONG>

You forgot to add 'sudo'

Try sudo rm -r /

on your machine first. </STRONG>
No, no, no...

sudo rm -rf /

(and if anyone didn't get that: don't try this unless your backup is really good and really recent. Say 10 seconds or so old.)
The new Mac Pro has up to 30 MB of cache inside the processor itself. That's more than the HD in my first Mac. Somehow I'm still running out of space.
     
nest18
Junior Member
Join Date: Jun 2001
Location: Montreal
Status: Offline
Reply With Quote
Mar 8, 2002, 08:43 AM
 
mmmmm Admin what are you doing
An apple a day keep the Doctor Away :P
     
BigMac2
Forum Regular
Join Date: Dec 2000
Location: Montreal, Quebec, Canada
Status: Offline
Reply With Quote
Mar 8, 2002, 09:20 PM
 
You want something funny..
try: cal 9 1752

for detail go see the man page ;-)
     
Juggle5
Junior Member
Join Date: Nov 2001
Location: Seattle
Status: Offline
Reply With Quote
Mar 9, 2002, 01:54 AM
 
Here's one that goes in the "fun" category:

% banner "Hi there!"

--Juggle5
     
DaGuy
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status: Offline
Reply With Quote
Mar 9, 2002, 02:27 AM
 
I frankly fail to see the humor with the "rm -r" stuff...

1. Experience users think is a lame joke.

2. Folks new to the platform actually try it out.



[ 03-09-2002: Message edited by: DaGuy ]
iMac 17" G4 800MHZ & 768 SDRAM
     
Juggle5
Junior Member
Join Date: Nov 2001
Location: Seattle
Status: Offline
Reply With Quote
Mar 9, 2002, 02:48 AM
 
Just thought of this after mentioning the banner command...perl can be fun, though I think it's borderline for a single command. Nonetheless, since this fits easily on a line:

% perl -e 'foreach (`banner #`) { print `banner "$_"`; }'

This makes a fractal "#" pattern by feeding the output of a banner command to the input of more banner commands.
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Mar 9, 2002, 02:59 AM
 
Originally posted by DaGuy:
<STRONG>I frankly fail to see the humor with the "rm -r" stuff...

1. Experience users think is a lame joke.

2. Folks new to the platform actually try it out.



</STRONG>
No kidding. It's no better than posting a trojan program that erases people's files, and then saying "Hey, download this program! It does something really cool! What, it erased your files? Ha! SUCKER!"

People didn't think this was funny when the iTunes installer did it, why is it funny if some idiot on a web board tells you to do it and you don't think people would ever intentionally do something that malicious to you?

Oh, and for those that don't know what sudo rm -rf / does: It erases every file on your hard drive. More than that, really - it erases every file on every disk you have mounted. Hilarious, no?
( Last edited by CharlesS; Dec 31, 2007 at 03:31 PM. )

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Juggle5
Junior Member
Join Date: Nov 2001
Location: Seattle
Status: Offline
Reply With Quote
Mar 9, 2002, 05:24 AM
 
You can do some interesting stuff with jot and rs. The man pages have some cool examples. Using echo, sed, jot and rs, I've made the ultimate one-line, fun command: random guitar tablature!

<font face = "courier">% ( echo E B G D A E ; jot -r -c 210 49 110 | sed -e 's/[^0-9]/-/' ) | rs -g1 0 6 | sed -e 's/.*/& - - - - - -/' | rs -g0 -t 6

E---9-------------------------------------------6-----5-------8-----4---
B---------9-8---------------------9-----5-3---3-------------------------
G-6-------6-------------6-----------8-------8---6---------------3---8---
D---5-----2-5---6---------5-7-----------------8-----6---------------4---
A-----------------2-------------9---------------------------------------
E-------------8-----------------------------------------9---------------</font>

Of course the output is different every time.. I'll leave it as a challenge for the resident unix gurus to explain how it works. (Or if you request, I'll explain..)

I think it's time to go to bed..
     
[APi]TheMan
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status: Offline
Reply With Quote
Mar 9, 2002, 01:29 PM
 
Originally posted by Juggle5:
<STRONG>Just thought of this after mentioning the banner command...perl can be fun, though I think it's borderline for a single command. Nonetheless, since this fits easily on a line:

% perl -e 'foreach (`banner #`) { print `banner "$_"`; }'

This makes a fractal "#" pattern by feeding the output of a banner command to the input of more banner commands. </STRONG>
That's clever, man... well done!
"In Nomine Patris, Et Fili, Et Spiritus Sancti"

     
rkt
Mac Enthusiast
Join Date: Oct 2000
Status: Offline
Reply With Quote
Mar 10, 2002, 03:33 PM
 
Originally posted by Scrod:
<STRONG>I use the word command all the time to check my spelling of a word.</STRONG>
just being picky, but word isn't a command - it's an alias (see "which word"). it's setup in /usr/share/init/tcsh/aliases, along with a few other useful shortcuts.
     
awaspaas
Mac Elite
Join Date: Apr 2001
Location: Minneapolis, MN
Status: Offline
Reply With Quote
Mar 10, 2002, 04:35 PM
 
Originally posted by rkt:
<STRONG>

just being picky, but word isn't a command - it's an alias (see "which word"). it's setup in /usr/share/init/tcsh/aliases, along with a few other useful shortcuts.</STRONG>
wow, what a party pooper!
     
robotmarkVIII
Dedicated MacNNer
Join Date: Jan 2001
Status: Offline
Reply With Quote
Mar 10, 2002, 07:42 PM
 
Originally posted by DaGuy:
<STRONG>I frankly fail to see the humor with the "rm -r" stuff...

1. Experience users think is a lame joke.

2. Folks new to the platform actually try it out.



[ 03-09-2002: Message edited by: DaGuy ]</STRONG>
Fun AOL Tip! AOL compresses your files for more disk space! It optimizes internet speed!
     
holiday
Forum Regular
Join Date: Feb 2001
Location: Madonna's Friday night underware
Status: Offline
Reply With Quote
Mar 10, 2002, 07:53 PM
 
Originally posted by robotmarkVIII:
<STRONG>

Fun AOL Tip! AOL compresses your files for more disk space! It optimizes internet speed!</STRONG>
hehehe
     
kidtexas  (op)
Grizzled Veteran
Join Date: Jan 2001
Location: usa
Status: Offline
Reply With Quote
Mar 10, 2002, 07:58 PM
 
Originally posted by rkt:
<STRONG>

just being picky, but word isn't a command - it's an alias (see "which word"). it's setup in /usr/share/init/tcsh/aliases, along with a few other useful shortcuts.</STRONG>
yeah, thats how i noticed it. I was going thru the system aliases and saw it.
     
taffy
Junior Member
Join Date: Oct 2000
Location: Mtl. Can
Status: Offline
Reply With Quote
Mar 11, 2002, 02:00 AM
 
been a while since i posted here

funny command line command.. can't let this one go:

type:

Bill Gates

heh
-ck
     
[APi]TheMan
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status: Offline
Reply With Quote
Mar 11, 2002, 02:22 AM
 
Originally posted by taffy:
<STRONG>been a while since i posted here

funny command line command.. can't let this one go:

type:

Bill Gates

heh
-ck</STRONG>
Priceless. Same with the search for "more evil than satan himself" search that used to work on Google...
"In Nomine Patris, Et Fili, Et Spiritus Sancti"

     
arn
Junior Member
Join Date: Dec 2001
Status: Offline
Reply With Quote
Mar 11, 2002, 02:23 AM
 
G>I frankly fail to see the humor with the "rm -r" stuff...

1. Experience users think is a lame joke.

2. Folks new to the platform actually try it out.



[ 03-09-2002: Message edited by: DaGuy ]</STRONG>[/QUOTE]


The people (such as iBabo) who perpetuate it are generally Unix newbies themselves, who just learned what it meant, and feel it will make them look cool.

arn
     
Detrius
Professional Poster
Join Date: Apr 2001
Location: Asheville, NC
Status: Offline
Reply With Quote
Mar 11, 2002, 01:42 PM
 
Originally posted by taffy:
<STRONG>been a while since i posted here

funny command line command.. can't let this one go:

type:

Bill Gates

heh
-ck</STRONG>

[motherg4:~] root# Bill Gates

OK? kill Gates? yes
kill: Arguments should be jobs or process id's.
[motherg4:~] root#


Why would we want to kill Jobs? He's the cool guy that makes our system!
ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
HanSolo
Fresh-Faced Recruit
Join Date: Dec 2001
Status: Offline
Reply With Quote
Mar 13, 2002, 02:10 AM
 
Originally posted by Juggle5:
<STRONG>You can do some interesting stuff with jot and rs. The man pages have some cool examples. Using echo, sed, jot and rs, I've made the ultimate one-line, fun command: random guitar tablature!

&lt;font face = "courier"&gt;% ( echo E B G D A E ; jot -r -c 210 49 110 | sed -e 's/[^0-9]/-/' ) | rs -g1 0 6 | sed -e 's/.*/& - - - - - -/' | rs -g0 -t 6

E---9-------------------------------------------6-----5-------8-----4---
B---------9-8---------------------9-----5-3---3-------------------------
G-6-------6-------------6-----------8-------8---6---------------3---8---
D---5-----2-5---6---------5-7-----------------8-----6---------------4---
A-----------------2-------------9---------------------------------------
E-------------8-----------------------------------------9---------------&lt;/font&gt;

Of course the output is different every time.. I'll leave it as a challenge for the resident unix gurus to explain how it works. (Or if you request, I'll explain..)</STRONG>
We have a winner! That is, IMHO, the coolest UWOT (Unix waste of time (tm)) I have seen yet!! How did you come up with that? Incredibly clever. I have only the vaguest idea why it works, but even so I'm puzzled why no open strings show up....

P.S. Don't actually try playing that... OUCH!
     
sungwoo
Dedicated MacNNer
Join Date: May 2001
Location: Glasgow, UK
Status: Offline
Reply With Quote
Mar 13, 2002, 02:39 AM
 
Originally posted by arn:
<STRONG>
The people (such as iBabo) who perpetuate it are generally Unix newbies themselves, who just learned what it meant, and feel it will make them look cool.

arn</STRONG>
I agree with you.
     
Juggle5
Junior Member
Join Date: Nov 2001
Location: Seattle
Status: Offline
Reply With Quote
Mar 14, 2002, 02:28 AM
 
To [APi]TheMan:

Thanks. Glad you liked the fractal # perl command. I think it's the first fractal I've ever made on the command line.

To HanSolo:

Thanks, also. I have to agree with you: the random guitar tablature is a very cool UWOT (Unix waste of time) command; I know I wasted too much time coming up with it. Now how does it work? It's a bit complicated..

1. jot -r -c 210 49 110 This prints out 210 random characters in the ascii range 49-110; this range covers the digits 1-9, the uppercase alphabet and some punctuation symbols. You can make the tab longer or shorter by changing 210 to something else (should be a multiple of 6, though)

2. | sed -e 's/[^0-9]/-/' Take the output of (1) and change everything that's not one of the digits 0..9 into a dash. This means that we have lots of dashes with some (relatively few) random digits.

3. echo E B G D A E ; (Actually this is done first, but.. ) Prepend (2) with 6 letters for the string names. Notice that these appear in the first column of the tablature; the random dashes and digits made in (1) and (2) continue on the right. That's what the rest of the command is for: getting this nice formatting.

4. | rs -g1 0 6 Take the output of (1) (2) and (3), combined into one command using the parens, and reshape the output into 6 columns. The -g1 option specifies there should be one space between each column and actually isn't needed. At this point, the output looks something like this:

<font face = "courier">( echo E B G D A E ; jot -r -c 210 49 110 | sed -e 's/[^0-9]/-/' ) | rs -g1 0 6

E B G D A E
9 - - 6 1 -
- - - - 1 3
- - - - 4 -</font>

So at this point we have the tablature, but the columns and rows are reversed. We could have done it the right way in one step by typing "| rs -g1 -t 6 0" rather than "rs -g1 0 6" (-t stands for transpose, so that EBGDAE goes down a column instead of a row). But there's a problem with this! Notice that, in this example, the numbers 1, 1, and 4 are right next to each other in the same column. This means if we had just printed the transpose "rs -g1 -t 6 0" and stopped, it would have looked like you were supposed to play fret 114. Now I'm not really a guitar player, but I'm fairly sure there aren't that many frets!

5. | sed -e 's/.*/& - - - - - -/'My solution was to insert an extra row of dashes between every row here. To do this, I appended " - - - - - -" to each row with the sed command. This breaks apart any numbers that might be adjacent. (And you'll notice that every other column (including the one after EBGDAE consists of only dashes.)

6. | rs -g0 -t 6 Finally, we take everything and reshape it, switching rows to columns, putting everything into 6 rows, putting 0 spaces between colums, so it all looks right. Whew!


Note that I didn't come up with this command instantly; it took an hour or so, I believe, to slowly build it up. I had to keep referring back to the sed, rs, and jot man pages to see what was possible to do and how to do it. I learned a lot in the process: that was the first time I had heard of the jot and rs commands! (I did a quick listing of /usr/bin/ to see what "fun" commands there might be. My curiosity was piqued by "jot," so I read the jot man page, which contained the example "jot -r -c 160 a z | rs -g 0 8", providing the basis for my command. )

I'm curious to see what other commands everyone comes up with. Keep 'em coming!

--Juggle5
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 05:31 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,