All commands (13,003)

  • First, we convert the VMware avi (VMnc format) to the Microsoft avi format. Next, we convert the Microsoft avi format to FLV format. You can play around with the -r switch (rate per second) and the -b switch (bitrate). But, if those get larger, so does your FLV file.


    0
    mencoder -of avi -ovc lavc movie.avi -o movie2.avi; ffmpeg -i movie2.avi -r 12 -b 100 movie.flv
    dcabanis · 2009-08-28 11:05:21 0

  • 0
    find . -type f -exec dos2unix {} +
    pavanlimo · 2009-08-28 08:44:11 3
  • It is a much better tool then nslookup for getting information about the any site.It has got better capability too.For reverse information please use the switch "-x" and the ip address. Show Sample Output


    -1
    dig google.com
    unixbhaskar · 2009-08-28 04:32:52 0
  • This is an commandline utility to get fair piece of information about the attached network card. Show Sample Output


    0
    ethtool eth0
    unixbhaskar · 2009-08-28 04:22:03 0
  • A wonderful command line utility to check the internet usage. It has got so many useful switch to display the data you want.Please visit the man page to get all the information.Get it from this website http://humdi.net/vnstat Show Sample Output


    0
    vnstat
    unixbhaskar · 2009-08-28 04:14:42 0
  • To get the connection information of protocol tcp and extended infortmation. Show Sample Output


    3
    sudo /bin/netstat -tpee
    unixbhaskar · 2009-08-28 04:02:10 1
  • As mentioned in the summery that it is a powerful command to monitor system activity in great way. It has got the power of vmstat,iostat,mpstat,df,free and sar.Instead of firing each single command separately ,one can fire one single command to get all the info at once.But there is a way to get the individual information too. Please see the man page . You can get it from here : http://dag.wieers.com/home-made/dstat/ Show Sample Output


    3
    dstat -afv
    unixbhaskar · 2009-08-28 03:53:24 0

  • -2
    du -s `find . -maxdepth 1 \! -name '.'` | sort -n | tail
    hydhaval · 2009-08-28 00:24:11 3
  • Of course you need to be able to access host A for this ;-)


    39
    ssh -t hostA ssh hostB
    0x89 · 2009-08-27 21:35:19 4

  • 10
    ls | while read f; do mv "$f" "${f// /_}";done
    liam · 2009-08-27 16:43:56 3
  • This doesn't work in bash, but in zsh you can typeset -T to bind a scalar variable to an array. $PATH and $path behave this way by default.


    -5
    print -l $path
    Mikachu · 2009-08-27 16:33:04 0
  • You can get others rates changing the "EUR/US" part. look at the url: wap.kitco.com/exrate.wml to get more options. Show Sample Output


    4
    curl -s wap.kitco.com/exrate.wml | awk ' BEGIN { x=0; FS = "<" } { if ($0~"^<br/>") {x=0} if (x==1) {print $1} if ($0~"EUR/US") {x=1} }'
    jamaese · 2009-08-27 16:30:19 1
  • I like the order of the arguments better this way.


    4
    at 6:00 <<< "xmms2 play"
    Mikachu · 2009-08-27 16:30:07 0
  • get diskusage of files (in this case logfiles in /var/log) modified during the last n days: sudo find /var/log/ -mtime -n -type f | xargs du -ch n -> last modified n*24 hours ago Numeric arguments can be specified as +n for greater than n, -n for less than n, n for exactly n. => so 7*24 hours (about 7 days) is -7 sudo find /var/log/ -mtime -7 -type f | xargs du -ch | tail -n1 Show Sample Output


    2
    sudo find /var/log/ -mtime -7 -type f | xargs du -ch | tail -n1
    alvinx · 2009-08-27 14:18:47 2
  • The unlock command for KDE 4.3 has changed from krunner_lock, this process doesn't exist anymore. So here's the update :-) If qdbus complains about not being able to find X, put a "DISPLAY=:0 " (:0 being your X server display) in front of the command.


    6
    qdbus org.kde.screenlocker /MainApplication quit
    Alanceil · 2009-08-27 13:57:00 0
  • 'jot' does not come with most *nix distros, so we need to use seq to make it work. This version tested good on Fedora 11.


    5
    for x in `seq 0 25 $(curl "http://www.commandlinefu.com/commands/browse"|grep "Terminal - All commands" |perl -pe 's/.+(\d+),(\d+).+/$1$2/'|head -n1)`; do curl "http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/$x" ; done > a.txt
    SuperFly · 2009-08-27 11:02:53 3
  • Shorter version. Show Sample Output


    14
    echo "${PATH//:/$'\n'}"
    camspiers · 2009-08-26 23:12:05 4
  • Stop tormenting the poor animal cat! Also you should not that you need a private key not protected by a passphrase on middlehost that grants you access to securehost..


    0
    ssh middlehost "ssh -a root@securehost '> nicescript'" < nicescript
    0x89 · 2009-08-26 20:25:12 2

  • -2
    cat /service/solr/log/main/current | tai64nlocal | grep "\(`date '+%F %H'`\|`date '+%F %H %M' | awk '{print $1" 0"$2-1":"$3}'`\)" | grep QTime | awk '{print $NF}' | awk -F\= '{ s += $2} END {print s/NR}'
    allrightname · 2009-08-26 14:02:02 0
  • Debian: Mark all dependent packages as manually installed. So they are not automatically removed if you remove some meta package - like gnome-desktop-environment for example.


    2
    sudo aptitude unmarkauto $(apt-cache depends some-deb-meta-package-name | grep Depends | cut -d: -f2)
    yra · 2009-08-26 12:56:33 2
  • By using vim, you can also filter content on stdout, using vim's extra power, like search pattern offset! No more awk of course, sorry. details : -e ex mode -s silent -c 'ex command' : global + start and end pattern + offset print (p) -cq : quit Show Sample Output


    0
    vim -e -s -c 'g/start_pattern/+1,/stop_pattern/-1 p' -cq file.txt
    syladmin · 2009-08-26 10:22:27 0
  • If you need to ssh into a computer on the local network but you're unsure of the ip to use, then ping them and see if you get a response. If you do, print out the address you got it from. Adjust the range to suit your network.


    -2
    for i in 192.168.1.{61..71};do ping -c 1 $i &> /dev/null && echo $i;fi;done
    AlecSchueler · 2009-08-26 06:04:24 8
  • Nice little alarm clock to wake you up on time (hopefully). You can also do 'echo "vlc path/to/song" | at 6:00


    1
    echo "xmms2 play" | at 6:00
    Vrekk · 2009-08-26 04:20:24 1
  • In the vein of "can you do it better", here is my take on using "ping" to emulate sleep in a DOS/BAT script. If one can use ping at all then the multicast address will be valid but will not respond. By doing only one ping (-n 1) and setting a timeout in milliseconds (-w 10000) you have a fairly accurate timer. This example gives about a 10 second sleep.


    -1
    ping -n 1 -w 10000 224.0.0.0
    DocGyver · 2009-08-26 02:25:07 0
  • This is an extension of a previous command by satyavvd on 2009-07-23 12:04:02, but this one grabs the whole archive. Hard coded numbers in previous script capped number of commands that could be fetched. This one grabs them all regardless of how big the archive gets. Show Sample Output


    0
    for x in `jot - 0 \`curl "http://www.commandlinefu.com/commands/browse"|grep "Terminal - All commands" |perl -pe 's/.+(\d+),(\d+).+/$1$2/'|head -n1\` 25`; do curl "http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/$x" ; done >a.txt
    stinkerweed999 · 2009-08-25 21:57:15 2
  • ‹ First  < 409 410 411 412 413 >  Last ›

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



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: