Commands by eastwind (71)

  • if you lost your moduli file in openssh server side you need generate new one with this command then test if the number generated can be used with ssh-keygen -T moduli-2048 -f /tmp/moduli-2048.candidates


    0
    ssh-keygen -G /tmp/moduli-2048.candidates -b 2048
    eastwind · 2010-01-29 19:33:23 3
  • If you set noclobber to on, bash won't allow redirection to overwrite existing files . set -o noclobber command turn the option on (default it s off ) . You can still append information but not overwrite the file .to turn it back off use : $ set +o noclobber . I use it because i overwrite a file by accident , after thought , content of the file was very important , creating a one more file mean nothing for my hard disk (we are not anymore on the 64 k memory time) , but content of file is far much important . What we call exeprience :( Show Sample Output


    2
    set -o noclobber
    eastwind · 2010-01-08 21:06:44 7

  • 1
    lame -V2 rec01.wav rec01.mp3
    eastwind · 2010-01-01 06:09:46 4
  • just replace the number 5 with the variable you want , and the xpenguins software with the one you want Show Sample Output


    -2
    i="0"; while [ $i -lt 5 ] ; do xpenguins & i=$[$i+1] ; done
    eastwind · 2009-12-27 21:05:33 3
  • Knowing when a filesystem is created , you can deduce when an operating system was installed . find filesystem device (/dev/) informations by using the cat /etc/fstab command. Show Sample Output


    7
    dumpe2fs -h /dev/DEVICE | grep 'created'
    eastwind · 2009-12-12 14:47:33 14

  • 1
    ffmpeg -i Your_video_file -s 320x240 FILE.flv
    eastwind · 2009-12-12 00:28:10 4

  • 1
    mencoder -idx Your_Input_Video_File -ovc lavc -oac mp3lame -audiofile Your_Audio_track.mp3 -o Output_File.avi
    eastwind · 2009-12-11 23:50:37 3

  • -1
    locale | grep LANG=
    eastwind · 2009-12-10 07:24:01 5
  • The 1440 is the number of bytes, and the A: specifies the floppy drive.


    -1
    mformat -f 1440 A:
    eastwind · 2009-12-10 06:51:20 3
  • -t option tells the system to look for a msdos filesystem The /dev/fd0 is your floppy drive ( This may be different for you check /dev folder to confirm) /mnt/floppy is the point where you want to mount the device to


    -2
    mount -t msdos /dev/fd0 /mnt/floppy
    eastwind · 2009-12-10 06:46:53 7

  • 1
    mencoder -ovc xvid -oac mp3lame -srate 44100 -af lavcresample=44100 -xvidencopts fixed_quant=4 Foo.wmv -o Bar.avi
    eastwind · 2009-12-10 06:46:11 3

  • 4
    mencoder infile.wmv -ofps 23.976 -ovc lavc -oac copy -o outfile.avi
    eastwind · 2009-12-08 19:50:50 3
  • require mimms package


    1
    mimms mms://Your_url.wmv
    eastwind · 2009-12-08 14:45:12 4

  • -2
    apt-cache show Your_package
    eastwind · 2009-12-06 14:50:34 3

  • -2
    dpkg -L Your_Package
    eastwind · 2009-12-06 14:49:04 3
  • need imagemagick package Show Sample Output


    5
    convert sample.pdf sample.jpg
    eastwind · 2009-12-05 19:27:37 8

  • 2
    mount -t iso9660 /dev/cdrom /media/cdrom
    eastwind · 2009-12-05 18:56:33 3
  • Detect video size automatically , usually the flv video from youtube , dailymotion are in the /tmp directory . Just launch a video player or an ls -lh on it to find the one you want to convert. Show Sample Output


    0
    mencoder input.flv -ovc lavc -oac mp3lame -o output.avi
    eastwind · 2009-12-01 10:42:11 6
  • it does provide much more information , the owner , group , the size in byte , and the last modified time a file or directory was ls -al : list all in long format Show Sample Output


    -11
    ls -al
    eastwind · 2009-11-12 12:27:32 6
  • this is a reference to Antoine de St. Exupery's "The Little Prince" Show Sample Output


    6
    aptitude moo
    eastwind · 2009-11-12 12:24:01 7
  • require the pdftk package


    8
    pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf
    eastwind · 2009-11-10 10:07:37 4
  • Require the pdftk package It ll split each page in your pdf file , into a new pdf file and report info on doc_data.txt Show Sample Output


    3
    pdftk mydoc.pdf burst
    eastwind · 2009-11-10 09:00:50 3
  • require the tex4ht package . You can open the file with openoffice , I use it much for correct my spelling and grammar . Show Sample Output


    2
    htlatex MyFile.tex "xhtml,ooffice" "ooffice/! -cmozhtf" "-coo -cvalidate"
    eastwind · 2009-11-05 10:12:28 5
  • set directly the wallpaper on windowmaker , use this command with display of imagemagick :) Show Sample Output


    1
    wmsetbg -s -u path_to_wallpaper
    eastwind · 2009-10-21 11:23:54 4
  • 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


    -1
    mencoder mf://image1.jpg,image2.jpg,image3.jpg -mf w=800:h=600:fps=25:type=jpeg -ovc copy -oac copy -o output.avi
    eastwind · 2009-10-21 09:17:22 3
  •  < 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

Copy a file using pv and watch its progress
pv allows a user to see the progress of data through a pipeline, by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA. (man pv)

pretend to be busy in office to enjoy a cup of coffee
Create a progress dialog with custom title and text using zenity.

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"

convert strings toupper/tolower with tr

Color man pages
Add the followin to ~/.bashrc #colour export LESS_TERMCAP_mb=$'\E[01;31m' export LESS_TERMCAP_md=$'\E[01;37m' export LESS_TERMCAP_me=$'\E[0m' export LESS_TERMCAP_se=$'\E[0m' export LESS_TERMCAP_so=$'\E[01;44;33m' export LESS_TERMCAP_ue=$'\E[0m' export LESS_TERMCAP_us=$'\E[01;32m'

Create incremental backups of individual folders using find and tar-gzip
Problem: I wanted to backup user data individually, using and incremental method. In this example, all user data is located in "/mnt/storage/profiles", and about 25 folders inside, each with a username ( /mnt/storage/profiles/mike; /mnt/storage/profiles/lucy ...) I need each individual folder backed up, not the whole "/mnt/storage/profiles". So, using find while excluding directories depth and creating two variables (tarfile=username & desdir=destination), tar will create a .tgz file for each folder, resulting in a "mike_2013-12-05.tgz" and "lucy_2013-12-05.tgz".

Record microphone input and output to date stamped mp3 file
record audio notes or meetings requires arecord and lame run mp3gain on the resulting file to increase the volume / quality ctrl-c to stop recording

download all the presentations from UTOSC2010
miss a class at UTOSC2010? need a refresher? use this to curl down all the presentations from the UTOSC website. (http://2010.utosc.com) NOTE/WARNING this will dump them in the current directory and there are around 37 and some are big - tested on OSX10.6.1

list file descriptors opened by a process
Useful for examining hostile processes (backdoors,proxies)

Detect illegal access to kernel space, potentially useful for Meltdown detection
Based on capsule8 agent examples, not rigorously tested


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: