Bash fun
Linux is awesome. I knew that! When you are completely bored and you have access to a terminal (and you are in the sudo-ers group) you can do this:
radu@enterprise:~$ sudo apt-get install cowsay Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: filters The following NEW packages will be installed: cowsay 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 0B/19.8kB of archives. After this operation, 295kB of additional disk space will be used. Selecting previously deselected package cowsay. (Reading database ... 173410 files and directories currently installed.) Unpacking cowsay (from .../cowsay_3.03-9.2_all.deb) ... Processing triggers for man-db ... Setting up cowsay (3.03-9.2) ...
Afterwards you could issue a command like this:
radu@enterprise:~$ fortune | cowsay -n -f tux.cow
__________________________________________________________________________
/ In the first place, God made idiots; this was for practice; then he made \
| school boards. |
\ -- Mark Twain /
--------------------------------------------------------------------------
\
\
.--.
|o_o |
|:_/ |
// \ \
(| | )
/'\_ _/`\
\___)=(___/
Or, if you have a sick humor:
radu@enterprise:~$ fortune | cowsay -n -f sodomized.cow
________________________________________________________
< You will have domestic happiness and faithful friends. >
--------------------------------------------------------
\ _
\ (_)
\ ^__^ / \
\ (oo)\_____/_\ \
(__)\ ) /
||----w ((
|| ||>>
Let me see how do you have that fun in Windows, suckers!
Similar Posts:
- Fortune and Pidgin’s status on Ubuntu (Linux)
- Python and Pidgin’s status on Ubuntu (Linux)
- Adobe Reader in Ubuntu
- How to install Oracle Database 10g XE and OC4J on Ubuntu
- Booting Ubuntu from an USB stick
17 Comments
1 2 » 1 2 »Leave a comment
Secure your files
Recent Posts
Recent Comments
Radu said:
After you install VMware Server there is no menu entry for it. To access its interface you should open a browser tab and go to... more»
Radu said:
I bought mine just a month before they launched the 3rd generation. But it’s really okay for my needs. more»
Radu said:
Something must have gone wrong during the install process. Try to reinstall the drivers (after you have uninstalled them previously)... more»
Radu said:
I think you should start Firefox (due to the fact that the plugin runs under it) with that custom wrapper script. more»
RGG said:
As with Mai I removed vmnet, vmci and vmmon. Ran sudo vmware-config.pl and it reran the last part of the install but did not add any... more»
Recent Tweets
- jQuery .click() and the double submit of a form - http://bit.ly/dcCGqR [#]







Cool stuff
But not as cool as
sudo su
cowsay -f tux “I see you” > /dev/pts/0
where /dev/pts/0 is another dude’s console
Actually, I think it would be more fun to do something like:
with the amendment that you should use another user’s console.
[...] Later edit: the fun continues here! [...]
I have can do both cowsay and fortune as a user but not as root. Both were installed via root apt-get install cowsay fortune
But when trying either cmd as root I get:
-bash: cowsay: command not found
-bash: fortune: command not found
any ideas?
Thank you!
Why would you like to run it as root? The answer to this is that
cowsayandfortuneare not in the $PATH variable for root.So the answer is either you do not use root for cowsay (I really do not see the point of doing this), either you add in the $PATH variable for root the folder
/usr/gamesor you just use Tudor’s way of doing this described in his first comment.Have fun!
Forgot to say I use Linux Debian 5.0.1 Lenny.
Newbie
Actually I don’t want to use it as root, (been told should never use root except when needed) but I read that I need to, to do as root to message another user logged in like this:
cowsay -f moose I see you > /dev/pts/0
This cmd gets “denied” as a user
cowsay -f sodomized “I see you” > /dev/pts/1
cowsay -f sodomized “I see you” > /dev/pts/0
These cmds gets “event not found” as a user
(though I am logged in as two different users)
Ok I retried the cmds, just an update.. if I remove the “!” in :
cowsay -f sodomized “I see you behind this cow!” > /dev/pts/1
Then I get the same error, with or without the quotes: ” ”
which is: -bash: /dev/pts/1: Permission denied
(as a user)
as su: bash: cowsay: command not found
I read Tudor had said on another post:
“PS: this requires root level access”
Thank you again
Tudor said
sudo su. If you usesudo -i, as I used, it won’t work. For you to send that message with the exclamation mark, you just need to remove the quotes:The first output of the sodomized cow was from BusyBox, on my router, which does not interpret the quotes like Ubuntu does.
P.S. Why are you afraid to use your email? If you use it, I wouldn’t have to approve every comment you make, only the first one registered with it. I’m not gonna sell it for spam…
Radu thank you again.
Yes re sudo su:
sudo su
-bash: sudo: command not found
For my Debian its su which I believe is the same thing, yes?
So for su can’t cowsay
and for user can’t /dev/pts/1
Maybe I am misunderstanding the ‘sudo su’ thing?
Re the e-mail, to be honest, just a habit when registering isn’t required. Sorry I didn’t realize you had to approve each time so I have put my email this time
Try
man sudoand see the difference between those options. If you try to usesudoas root, well that’s not possible.sudois meant only for users other than root, but they must be in the sudoers list. If you have triedsudoas a regular user and found that “error”, you either are in the case mentioned in the previous phrase, either you have broken your hostname by not keeping consistency between/etc/hostnameand/etc/hosts.Thank you Radu. I didn’t know that. All along I thought su & sudo were thee same thing just different cmd’s for different OS’s. Wow ok from cowsay to fixing this lol…
After some digging I found that I didn’t have ‘sudo’ (http://www.binbash.eu/linux/58-debian-etch-notes) so I did:
Ok so now I try (as a user and as root) sudo
reply same for both:
sudo: unable to resolve host PTy990499a.servername.com(*PTy990499a.servername.com I have changed, it’s not the real server name, just similar)
simply has PTy990499a.servername.com and this hostname can not be resolved (Dns unable to resolve..). Where as the servername.com part can be resolved, correctly. And the PTy990499a part is what I see on the console on each line, for example:
(*200/66.123.66 also not the real IP)
So I’m going to try to fix this myself, please don’t give away any clues
and see if I can do this myself. Just a crazy busy day here. Will post when done or stuck 
Thank you again Radu!
Sorry Radu; stuck
and very frustrated.
This is what I have done and the edited replies. I posted here: http://pastebin.com/m45312224
as worried too long for here and felt like it was ruining your nice cosway post
I’m also very nervous that I’m messing with the host files. Since I only have remote access to this box it would be impossible to fix it if it went off line because I mess something up real good.
Thank you very much!
PS. I didn’t mean to come here to have you fix all of this for me, sorry…if you want me to take it to a forum to fix, I understand
Thank you again Radu!
I’m back with a working sudo
sudo /etc/init.d/apache2 reload
[sudo] password for myname:
Reloading web server config: apache2.
But cowsay still can’t speak to another user. I’ve tried a variety of cmds:
sudo su cowsay -f moose I see you > /dev/pts/2
-bash: /dev/pts/2: Permission denied
sudo su cowsay -f moose I see you > sudo /dev/pts/2
su: invalid option — f
Usage: su [options] [LOGIN]
sudo su cowsay -f moose I see you > sudo su /dev/pts/2
su: invalid option — f
Usage: su [options] [LOGIN]
sudo cowsay -f moose I see you > /dev/pts/2
-bash: /dev/pts/2: Permission denied
sudo cowsay -f moose I see you > sudo /dev/pts/2
sudo: cowsay: command not found
cowsay -f moose I see you > sudo su /dev/pts/2
(no reply, and it didn’t say to user 2)
Any ideas? Thank you
Yeah… I’ve got two ideas. First issue
whoin a terminal to see who is logged in and where. Then do what Tudor has shown you. Afterwards maybe you can send me some money for support.