All commands (13,025)

  • I have a custmer's Geovision DVR installed on a closed proxi (only logme-in reaches it). I have to check for reliability but logmein hangs and is too slow a process I made the Geovision software send e-mail every minute to the site. All this script does is to retrieve the e-mail header from ( no login!), filtering sender, stopping at the first occurrence of the word "secs" ( the age of the last e-mail ). The result is the age of the sender's last e-mail, tiny published on top of my screen once a minute. I can refresh via web browser, but have other things to do. I use it inside Kalarm ( kde task schedule ) set to 1 minute repeat. It can be done without kalarm, using Watch outside the script. Try it out now using my account = geo1 ( change sender by geo1 in this script) Needs curl , osd-bin

    curl | grep secs| awk '{print; exit}' | osd_cat -i 40 -d 30 -l 2
    m33600 · 2009-11-12 21:33:06 0
  • This will start the x11vnc server, scale it at 6/7, will use the vncpass file to authenticate and wont shut down as soon as a client disconnects

    x11vnc -display :0 -scale 6/7 -rfbauth vncpass -forever
    JulijanAndjelic · 2009-11-12 21:32:45 0
  • This will generate a password file to use with x11vnc server, obviously you should replace "your_new_password" with the password you want to use and the path where you want to store it.

    x11vnc -storepasswd your_new_apssword ~/my_vnc_pass
    JulijanAndjelic · 2009-11-12 21:28:32 0

  • 0
    in bash hit "tab" twice and answer y
    sdadh01 · 2009-11-12 17:55:37 1
  • A function that takes a domain name as an argument Show Sample Output

    geo(){ curl -s "$(dig +short $1)"| sed '/^IP:/!d;s/<[^>][^>]*>//g'; }
    dennisw · 2009-11-12 17:14:09 0
  • 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

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

    aptitude moo
    eastwind · 2009-11-12 12:24:01 2
  • Watch a TiVo file on your computer.

    curl -s -c /tmp/cookie -k -u tivo:$MAK --digest http://$tivo/download/$filename | tivodecode -m $MAK -- - | mplayer - -cache-min 50 -cache 65536
    matthewbauer · 2009-11-11 23:32:23 0

  • 9
    setterm -powersave off -blank 0
    unixmonkey6999 · 2009-11-11 22:39:50 0
  • trying to copy all your dotfiles from one location to another, this may help Show Sample Output

    ls -a | egrep "^\.\w"
    kulor · 2009-11-11 18:19:56 9
  • cd to the folder containing the wav files and convert them all to ogg format. in my sample output i use the -a and -l flags to set the author and album title. to get the oggenc program in ubuntu linux run: sudo apt-get install oggenc Show Sample Output

    oggenc *.wav
    nickleus · 2009-11-11 14:26:01 1
  • cd to the folder containing the wav files, then convert them all to flac. yeah baby! in ubuntu, to get the flac program just: sudo apt-get install flac flac file input formats are wav, aiff, raw, flac, oga and ogg Show Sample Output

    flac --best *.wav
    nickleus · 2009-11-11 14:17:24 1

  • -1
    for i in `cat /etc/passwd | awk -F : '{ print $1 }';`; do passwd -e $i; done
    irraz · 2009-11-11 13:01:22 0
  • Create a tar file in multiple parts if it's to large for a single disk, your filesystem, etc. Rejoin later with `cat .tar.*|tar xf -` Show Sample Output

    tar cf - <dir>|split -b<max_size>M - <name>.tar.
    dinomite · 2009-11-11 01:53:33 0
  • The magic is performed by the parameter -t Show Sample Output

    for F in $(find ./ -name "*.tgz") ; do tar -tvzf $F ; done
    alchandia · 2009-11-11 00:50:52 0
  • 355 # from zsh-users 356 edit_command_line () { 357 # edit current line in $EDITOR 358 local tmpfile=${TMPPREFIX:-/tmp/zsh}ecl$$ 359 360 print -R - "$PREBUFFER$BUFFER" >$tmpfile 361 exec 362 ${VISUAL:-${EDITOR:-vi}} $tmpfile 363 zle kill-buffer 364 BUFFER=${"$( 365 CURSOR=$#BUFFER 366 367 command rm -f $tmpfile 368 zle redisplay 369 } 370 zle -N edit_command_line

    zsh$ M-v
    bucciarati · 2009-11-10 23:02:56 0

  • -3
    dd if=/dev/<device location> | gzip -c /<path to backup location>/<disk image name>.img.gz
    awjrichards · 2009-11-10 22:57:51 1
  • The pstack command prints a stack trace of running processes without needing to attach a debugger, but what about core files? The answer, of course, is to use this command. Usage: gdbbt program corefile

    alias gdbbt="gdb -q -n -ex bt -batch"
    TeacherTiger · 2009-11-10 22:56:59 0
  • I don't know if you've used sqsh before. But it has a handy feature that allows you to switch into vim to complete editing of whatever complicated SQL statement you are trying to run. But I got to thinking -- why doesn't bash have that? Well, it does. It's called '|'! Jk. Seriously, I'm pretty sure this flow of commands will revolutionize how I administer files. And b/c everything is a file on *nx based distros, well, it's handy. First, if your ls is aliased to ls --color=auto, then create another alias in your .bashrc: alias lsp='ls --color=none' Now, let's say you want to rename all files that begin with the prefix 'ras' to files that begin with a 'raster' prefix. You could do it with some bash substitution. But who remembers that? I remember vim macros because I can remember to press 'qa' and how to move around in vim. Plus, it's more incremental. You can check things along the way. That is the secret to development and probably the universe. So type something like: lsp | grep ras Are those all the files you need to move? If not, modify and re-grep. If so, pipe it to vim. lsp | grep ras | vim - Now run your vim macros to modify the first line. Assuming you use 'w' and 'b' to move around, etc., it should work for all lines. Hold down '@@', etc., until your list of files has been modified from ras_a.h ras_a.cpp ras_b.h ras_b.cpp to: mv ras_a.h raster_a.h mv ras_a.cpp raster_a.cpp mv ras_b.h raster_b.h mv ras_b.h raster_b.cpp then run :%!bash then run :q! then be like, whaaaaa? as you realize your workflow got a little more continuous. maybe. YMMV.

    vim -
    tmsh · 2009-11-10 22:25:36 9
  • This script creates date based backups of the files. It copies the files to the same place the original ones are but with an additional extension that is the timestamp of the copy on the following format: YearMonthDay-HourMinuteSecond Show Sample Output

    backup() { for i in "$@"; do cp -va $i $i.$(date +%Y%m%d-%H%M%S); done }
    polaco · 2009-11-10 20:59:45 2
  • This script will list all the files in the tarballs present on any folder or subfolder of the provided path. The while loop is for echoing the file name of the tarball before listing the files, so the tarball can be identified

    find <path> -name "*.tgz" -or -name "*.tar.gz" | while read file; do echo "$file: "; tar -tzf $file; done
    polaco · 2009-11-10 20:39:04 3
  • This command will copy a folder tree (keeping the parent folders) through ssh. It will: - compress the data - stream the compressed data through ssh - decompress the data on the local folder This command will take no additional space on the host machine (no need to create compressed tar files, transfer it and then delete it on the host). There is some situations (like mirroring a remote machine) where you simply cant wait for a huge time taking scp command or cant compress the data to a tarball on the host because of file system space limitation, so this command can do the job quite well. This command performs very well mainly when a lot of data is involved in the process. If you copying a low amount of data, use scp instead (easier to type) Show Sample Output

    ssh <host> 'tar -cz /<folder>/<subfolder>' | tar -xvz
    polaco · 2009-11-10 20:06:47 4

  • 0
    egrep -v "^[[:blank:]]*($|#|//|/\*| \*|\*/)" somefile
    sdadh01 · 2009-11-10 18:49:19 0
  • Find files recursively that were updated in the last hour ignoring SVN files and folders. Incase you do a full svn up on accident.

    find . -mmin -60 -not -path "*svn*" -print|more
    bloodykis · 2009-11-10 18:34:53 4
  • Strips comments from at least bash and php scripts. Normal # and // as well as php block comments removes all of the: empty/blank lines lines beginning with # lines beginning with // lines beginning with /* lines beginning with a space and then * lines beginning with */ It also deletes the lines if there's whitespace before any of the above. Add an alias to use in .bashrc like this: alias stripcomments="sed -e '/^[[:blank:]]*#/d; s/[[:blank:]][[:blank:]]*#.*//' -e '/^$/d' -e '/^\/\/.*/d' -e '/^\/\*/d;/^ \* /d;/^ \*\//d'"

    sed -e '/^[[:blank:]]*#/d; s/[[:blank:]][[:blank:]]*#.*//' -e '/^$/d' -e '/^\/\/.*/d' -e '/^\/\*/d;/^ \* /d;/^ \*\//d' /a/file/with/comments
    unixmonkey6951 · 2009-11-10 17:47:22 2
  • ‹ First  < 381 382 383 384 385 >  Last ›

What's this? 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.


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: