Pump up the chatter, run this script on a regular basis to listen to your twitter timeline. This is a rough first cut using several cli clips I have spotted around. There is no facility to not read those things already read to you. This could also easily be put in a loop for timed onslaught from the chatterverse, though I think it might violate several pointsof the Geneva Convention UPDATE - added a loop, only reads the first 6 twits, and does this every 5 mins. Show Sample Output
Very entertaining when run on someone elses machine remotely ;)
On other systems, replace 'say' with the name of another text-to-speech engine, e.g. espeak ( http://espeak.sourceforge.net ) or festival ( http://www.cstr.ed.ac.uk/projects/festival )
-P displays a progress meter -z tells rsync to use compression Show Sample Output
or replace "espeak" with "festival --tts" if you like festival better
when your buddy leaves his computer unlocked use "crontab" or "at" to play at some time that would be most embarassing (during his next sales presentation)
echo "fortune -o | espeak" | at now + 30 minutes
of course you can exclude the "-o" for non offensive fortunes, or if you don't have offensive fortunes installed
Want to know why your load average is so high? Run this command to see what processes are on the run queue. Runnable processes have a status of "R", and commands waiting on I/O have a status of "D". On some older versions of Linux may require -emo instead of -eo. On Solaris: ps -aefL -o s -o user -o comm | egrep "^O|^R|COMMAND" Show Sample Output
Only a few characters of the previous command are necessary.
This gives you lots of nifty Cisco network information like VLAN tag, port and switch information. Show Sample Output
If you typed 'sl', put the cursor on the 'l' and hit ctrl-t to get 'ls'.
This command uses the debugger to attach to a running process, and reassign a filehandle to a file. The two commands executed in gdb are p close(1) which closes STDOUT and p creat("/tmp/filename",0600) which creates a file and opens it for output. Since file handles are assigned sequentially, this command opens the file in place of STDOUT and once the process continues, new output to STDOUT will instead be written to our capture file. Show Sample Output
In my work environment, we log onto the servers as our user ('user', in the sample ouput), and 'sudo su - root' to other accounts. This trick allows us to return the account name we logged in as -- and not the account name we currently are ('root', in this example).
Using this trick, you can build other commands:
Set your CVSROOT env variable to your account name:
CVSROOT=$(who am i | awk '{print $1}')@cvs.server.example.com:/cvsroot
SCP a file to another server:
scp file.txt $(who am i | awk '{print $1}')@some.other.server.com:.
This works out great in my environment, as we can include this in our documentation and make the comands more easy to copy/paste for different users, and not have to set all sorts of variables, or modify the docs for each user.
whoami gives you the name of the user you currently are, not the user you logged on originally as.
who gives you a listing of every single person logged onto the server.
who am i gives you the name of the user you logged on as, and not who you changed to with su.
Look at the following scenario:
whoami
user
su -
# whoami
root
# who am i
user pts/51 2009-02-13 10:24 (:0.0)
whoami != who am i
Show Sample Output
replace username, password, and nameofnewfriend with proper values. Remember to escape things like ! or & in your password
The Festival Speech Synthesis System converts text into sound. Or: links -dump http://youfavoritewebsite.com | festival --tts Show Sample Output
This is not actually a command, it's just a keyboard shortchut. But a very useful one. Show Sample Output
Remove all text backup files. Show Sample Output
'pushd +1' is equivalent to 'pushd'. Can be 'pushd +3' or more generaly 'pushd +N'. Can also be 'pushd -N'. More description in 'man bash'. Show Sample Output
This one-liner outputs a random number between the values given for FLOOR and RANGE. Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: