Commands by eastwind (71)

  • syntax : mencoder mf://filemask -mf option availble for mf : * w=value : the width of the output, by d?fault : autodetected * h=value : height of the output, by default : autodetected * fps=value : framerate of the output, by default : 25 * type=value : file format type input , avaible: jpeg, png, tga, sgi Show Sample Output


    0
    mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpeg -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o output.avi
    eastwind · 2009-10-21 09:14:04 3
  • create iso image from directory . Usefull for virtualised machine To create CD ISO image of directories that contain long file name or non-8.3 format (particularly if you want to burn the CD image for use in Windows system), use the -J option switch that generates Joliet directory records in addition to regular iso9660 file names. For example, to create CD image of Vista SP1 directory: mkisofs -o VitaSP1.iso -J VistaSP1 Show Sample Output


    8
    mkisofs -o XYZ.iso XYZ/
    eastwind · 2009-10-17 16:28:47 53
  • Refresh the cache of font directory , usefull after you download font (.ttf or other) from various website and you don't want to reboot or relogin . Close your word processor before using the command , after the refresh reopen your word processor , new fonts is avaible ! Show Sample Output


    6
    sudo fc-cache -f -v
    eastwind · 2009-10-07 11:01:29 8
  • convert to debian package file (deb) a redhat package file (rpm) , then you can install it by using dpkg , require alien package ( sudo apt-get install alien first ) Show Sample Output


    -5
    sudo alien --to-deb Your_PackAge.rpm
    eastwind · 2009-09-27 13:49:07 5
  • for the change stay in your history file , export command by writing it into your .bashrc Show Sample Output


    7
    export HISTTIMEFORMAT="%h/%d-%H:%M:%S "
    eastwind · 2009-09-25 22:42:28 7
  • this command limit the speed to 8 until next eject of your cdrom disc , can be usefulll when you don't want to listen the sound of your cdrom driver .


    3
    eject -x 8 /dev/cdrom
    eastwind · 2009-09-25 08:02:30 3
  • bchunk [-v] [-p] [-r] [-w] [-s] Show Sample Output


    6
    bchunk IMAGE.bin IMAGE.cue IMAGE.iso
    eastwind · 2009-09-25 07:42:05 4
  • save the input into a ogg file Show Sample Output


    2
    rec -c 2 -r 44100 -s -t wav - | oggenc -q 5 --raw --raw-chan=2 --raw-rate=44100 --raw-bits=16 - > MyLiveRecording.ogg
    eastwind · 2009-09-24 14:46:12 3

  • 2
    $ cdrdao read-cd --read-raw --datafile FILE_NAME.bin --device /dev/cdrom --driver generic-mmc-raw FILE_NAME.toc
    eastwind · 2009-09-24 14:19:22 63
  • The ^$ within the quotes is a regular expression: ^=beginning of line, $=end of line, with no characters between.


    1
    grep -v "^$" filename > newfilename
    eastwind · 2009-09-24 12:21:43 4
  • cat -n file : number all line cat -b file : number only non empty line see man cat


    0
    cat -n file or cat -b file
    eastwind · 2009-09-24 12:18:40 4

  • 2
    lsb_release -a
    eastwind · 2009-09-16 10:50:33 3

  • 1
    cdrecord -v -blank=all -force
    eastwind · 2009-09-14 19:21:15 7

  • -1
    cdrecord -v path_to_iso_image.iso
    eastwind · 2009-09-14 19:20:12 4
  • 1. find file greater than 10 MB 2. direct it to xargs 3. xargs pass them as argument to ls Show Sample Output


    9
    find ./ -size +10M -type f -print0 | xargs -0 ls -Ssh1 --color
    eastwind · 2009-08-25 18:40:47 8

  • -11
    sudo cat /dev/mem > /dev/dsp
    eastwind · 2009-04-22 07:26:10 4
  • tell you how many Non free software is on your machine, which package it is and which restriction on freedom it has . require vrms package , vrms mean virtual Richard M. Stallman :) Show Sample Output


    -3
    vrms
    eastwind · 2009-04-22 06:54:20 4
  • Require boxes and / or cowsay packages. After input boxes -d dog , type your text and then press ctrl + d . Same goes for cowsay . Show Sample Output


    6
    boxes -d dog or cowsay -f tux $M
    eastwind · 2009-04-22 06:01:20 5
  • need toilet package , same goes for figlet showfigfonts | less : give the list of font available for options Show Sample Output


    0
    toilet -f big ReadMe
    eastwind · 2009-04-22 05:48:13 4
  • sudo apt-get install moon-buggy An ascii 2D game where you control a mooncar and try to avoid moonhole by jumping (press space ) Show Sample Output


    -4
    moon-buggy
    eastwind · 2009-04-22 05:41:40 6
  • sudo apt-get install bb A demoscene intro in ascii art with tracker song


    0
    bb
    eastwind · 2009-04-22 05:33:25 7
  •  < 1 2 3

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

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }

Visit wikileaks.com
Who needs a DNS server

resume other user's screen session via su, without pty error
Normally, if you su to another user from root and try to resume that other user's screen session, you will get an error like "Cannot open your terminal '/dev/pts/0' - please check." This is because the other user doesn't have permission for root's pty. You can get around this by running a "script" session as the new user, before trying to resume the screen session. Note you will have to execute each of the three commands separately, not all on the same line as shown here. Credit: I found this at http://www.hjackson.org/blog/archives/2008/11/29/cannot-open-your-terminal-dev-pts-please-check.

Place the NUM-th argument of the most recent command on the shell
After executing a command with multiple arguments like cp ./temp/test.sh ~/prog/ifdown.sh you can paste any argument of the previous command to the console, like ls -l ALT+1+. is equivalent to ls -l ./temp/test.sh ALT+0+. stands for command itself ('ls' in this case) Simple ALT+. cycles through last arguments of previous commands.

Get your external IP address without curl
Curl is not installed by default on many common distros anymore. wget always is :) $ wget -qO- ifconfig.me/ip

power off system in X hours form the current time, here X=2

awk date convert
Convert readable date/time with `date` command

Alias TAIL for automatic smart output
Run the alias command, then issue $ps aux | tail and resize your terminal window (putty/console/hyperterm/xterm/etc) then issue the same command and you'll understand. $ ${LINES:-`tput lines 2>/dev/null||echo -n 12`} Insructs the shell that if LINES is not set or null to use the output from `tput lines` ( ncurses based terminal access ) to get the number of lines in your terminal. But furthermore, in case that doesn't work either, it will default to using the default of 80. The default for TAIL is to output the last 10 lines, this alias changes the default to output the last x lines instead, where x is the number of lines currently displayed on your terminal - 7. The -7 is there so that the top line displayed is the command you ran that used TAIL, ie the prompt. Depending on whether your PS1 and/or PROMPT_COMMAND output more than 1 line (mine is 3) you will want to increase from -2. So with my prompt being the following, I need -7, or - 5 if I only want to display the commandline at the top. ( http://www.askapache.com/linux/bash-power-prompt.html ) 275MB/748MB [7995:7993 - 0:186] 06:26:49 Thu Apr 08 [askapache@n1-backbone5:/dev/pts/0 +1] ~ $ In most shells the LINES variable is created automatically at login and updated when the terminal is resized (28 linux, 23/20 others for SIGWINCH) to contain the number of vertical lines that can fit in your terminal window. Because the alias doesn't hard-code the current LINES but relys on the $LINES variable, this is a dynamic alias that will always work on a tty device.

generate a unique and secure password for every website that you login to
usage: sitepass MaStErPaSsWoRd example.com description: An admittedly excessive amount of hashing, but this will give you a pretty secure password, It also eliminates repeated characters and deletes itself from your command history. tr '!-~' 'P-~!-O' # this bit is rot47, kinda like rot13 but more nerdy rev # this avoids the first few bytes of gzip payload, and the magic bytes.

Route outbound SMTP connections through a addtional IP address rather than your primary


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: