Commands by unixmonkey7740 (1)

What's this?

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.

Share Your Commands


Check These Out

Get Dell Service Tag Number from a Dell Machine
This will give you the Dell Service tag number associated with your machine. Incredibly useful when you need that number for tech support or downloads.

Wait the end of prog1 and launch prog2

Advanced python tracing
Trace python statement execution and syscalls invoked during that simultaneously

Disable sleep mode via cli and systemd (Centos, Debian Ubuntu?)
This causes computer to never power off or go into sleep mode. Disables sleep mode linux.

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

merge vob files to mpg

Fetch every font from dafont.com to current folder
Requires aria2c but could just as easily wget or anything else. A great way to build up a nice font collection for Gimp without having to waste a lot of time. :-)

Advanced LS Output using Find for Formatted/Sortable File Stat info
I love this function because it tells me everything I want to know about files, more than stat, more than ls. It's very useful and infinitely expandable. $ find $PWD -maxdepth 1 -printf '%.5m %10M %#9u:%-9g %#5U:%-5G [%AD | %TD | %CD] [%Y] %p\n' | sort -rgbS 50% 00761 drwxrw---x askapache:askapache 777:666 [06/10/10 | 06/10/10 | 06/10/10] [d] /web/cg/tmp The key is: # -printf '%.5m %10M %#9u:%-9g %#5U:%-5G [%AD | %TD | %CD] [%Y] %p\n' which believe it or not took me hundreds of tweaking before I was happy with the output. You can easily use this within a function to do whatever you want.. This simple function works recursively if you call it with -r as an argument, and sorts by file permissions. $ lsl(){ O="-maxdepth 1";sed -n '/-r/!Q1'

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

get rid of lines with non ascii characters
found here: https://stackoverflow.com/a/9035939


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: