Saturday, March 5, 2011

My Favorite SSH Command

One of the greater things about shadowing new hires at my last job, Verio was to have them type in the "yes" command. (I should mention that Verio is a web hosting company and deals a lot with shell commands). Anyway -- Like I was saying . . . the "yes" command. There is nothing greater, or more funny than this. Especially when done right.

I would have them do something only slightly complicated such as running a mysqlcheck. The lengthened command to run this check is: mysqlcheck -r --all-databases -p. That is exactly what you would type in. However, I would tell them to type in the following:

yes mysqlcheck -r '--all-databases' -p

The ''s around --all-databases indicates what they yes command will read. (Also I tell them some random stuff about how yes helps a process run smoother). They type it in and hit enter and their page begins to scroll:

--all-databases
--all-databases
--all-databases
--all-databases
--all-databases
--all-databases
--all-databases
--all-databases
--all-databases
--all-databases
--all-databases
--all-databases
--all-databases
--all-databases
--all-databases
--all-databases
--all-databases

This will continue until you hit Ctrl+V.

Boy, is their face priceless. Anyway, it runs the selected script/words at a rate that will fill a directory  up to 1G in about 3 seconds. That is a ton!!

I'm pretty sure Strudinox taught me this.

Tell your friends and confuse your coworkers.

1 comment: