« Firefox 3.1 beta on Ubuntu Jaunty Jackalope | Main | New Linux Logo »
Tuesday
14Apr2009

Handy command line utilities and other stuff

 

Every once in a while I find a command that I could have used a couple of days ago. You know the one. Remember that time when you were trying to do something like killing a process or unmounting a stubborn usb drive? That is what I'm talking about. Whenever I find myself needing these commands I can never find where I have written them down or what file I saved them to. So I though I would create a page where I can store them. I know other sites have more of the same thing but I think this page may end up being more of a notepad for me than a place to share. Anyway, I hope you find some of them as usefull as I have.

Eject a sutbborn usb drive or mounted folder.

fuser -k /media/Path-to-mounted-directory/

Enable Ctrl+Alt+Backspace in Jaunty Jackalope (disabled in the alpha)

dontzap --disable

Create a session that will output all of your commands to a text file. This will save the session to a file called "typescript" in your home directory

script <enter> Type "exit" to end session

To find a running process type

jobs

To kill the process type

kill %1 or kill %<job-number>

Want to see who you are connected to? (you may have to install iproute)

ss -r

Record a screencast and save it as an mpeg


ffmpeg -f x11grab -s 800x600 -i :0.0 /tmp/screencast.mpg

Shutdown a windows pc from a linux pc

(courtesy of shell-fu.org)

http://www.shell-fu.org/lister.php?id=839

Start a webserver serving the directory you are currently in.

python -m SimpleHTTPServer

 

 

How to stream mp3 files to a remote machine.

  (The command on the client must be run first. If not it will just give an error.)

On the client/listening side do

nc -lp 1234 | mplayer -

And on the server/sender side do

cat <name of mp3 file.mp3> | nc <ipaddress of remote pc> 1234

 

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.