Commands by Velenux (4)

  • smbfs or cifs, depends on which you are using


    -2
    umount -t smbfs
    Velenux · 2012-02-23 10:46:44 0

  • -6
    for file in *; do echo $PWD/$file; done
    Velenux · 2011-12-16 13:12:00 1
  • Best way I know to get rid of .bash_history and don't allow bash to save the current one on exit Edit: added ~/ before .bash_history, just in case... ;)


    -5
    rm ~/.bash_history && kill -9 $$
    Velenux · 2009-10-08 12:25:47 2
  • Output is from Debian Lenny Show Sample Output


    1
    grep CONFIG $(which mysqlbug)
    Velenux · 2009-09-23 17:12:37 0

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 the oldest file in a directory
reverse the sorting of ls to get the newest file: $ls -1tr --group-directories-first /path/to/dir/ | tail -n 1 Problems: If there are no files in the directory you will get a directory or nothing.

Batch rename extension of all files in a folder, in the example from .txt to .md
Same thing using bash built-in features instead of a sub-shell.

full path listing in /directory/path/* of javascript files.
file listing in /directory/path/* of specific files such as javascript(js) .

Convert PDF to JPG
(relies on 'imagemagick') This command will convert all .pdf files in a directory into a 800px (wide or height, whichever is smaller) image (with the aspect ratio kept) .jpg. If the file is named 'example1.pdf' it will be named 'example1.jpg' when it is complete. This is a VERY worthwhile command! People pay hundreds of dollars for this in the Windows world. My .jpg files average between 150kB to 300kB, but your's may differ.

Rename files in batch

Using Git, stage all manually deleted files.

Download all default installed apk files from your android.

Show device drivers and their properties (Windows XP)
Show device drivers and their properties, including digital signatures /si and in table format /fo.

Install pip with Proxy
Installs pip packages defining a proxy

Backup all MySQL Databases to individual files
Backs up all databases, excluding test, mysql, performance_schema, information_schema. Requires parallel to work, install parallel on Ubuntu by running: sudo aptitude install parallel


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: