Commands by arsenerichard (1)

  • Bash snippet to force GNU/Linux keyboard settings, layout and configuration. Usefull when some GNU/Linux distributions such as *Ubuntu's store only limited configation options due to demonstration purposes on LiveUSB or Live persistent devices. Overcomes the English QWERTY to French AZERTY settings failure. Code bash en ligne de commande pour forcer l'adoption du clavier AZERTY sur les cl? USB bootable en Ubuntu.


    1
    sudo dpkg-reconfigure keyboard-configuration
    arsenerichard · 2012-03-27 21:07:45 47

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 ascii string to hex
Even adds a newline.

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Create a directory and go inside it
$_ expands to the last argument of the last command that was executed

Find out which process uses an old lib and needs a restart after a system update
Shows the full output of lsof.

Search some text from all files inside a directory

Load all files (including in subdirs), whose name matches a substring, into Vim
This command searches the current directory, and all of its subdirs, for files that have the string "foo" in their filename (foo.c, two-foo.txt, index-FOO-bar.php, etc), and opens them in Vim. It ignores any hidden .svn directories. Change -iname to -name if you want to do case-sensitive matches. Files open in buffers by default, so to verify that the correct files were opened, type ":list". You can load all the files in tabs by doing ":tab ball" or use 'vim -p' on the command-line to load files straight to tabs. If you get permission denied errors, do: vim $(find . ! -path \*.svn\* -type -f iname \*foo\* 2>/dev/null) To narrow it down to a single file extension, such as .php files, use \*foo\*.php (or '*foo*.php'. Which ever you prefer)

Find the 10 users that take up the most disk space

Selecting a random file/folder of a folder
Also looks in subfolders

Cleanup firefox's database.
For Mac OS X users only

Securely destroy data (including whole hard disks)
GNU shred is provided by the coreutils package on most Linux distribution (meaning, you probably have it installed already), and is capable of wiping a device to DoD standards. You can give shred any file to destroy, be it your shell history or a block device file (/dev/hdX, for IDE hard drive X, for example). Shred will overwrite the target 25 times by default, but 3 is enough to prevent most recovery, and 7 passes is enough for the US Department of Defense. Use the -n flag to specify the number of passes, and man shred for even more secure erasing fun. Note that shredding your shell history may not be terribly effective on devices with journaling filesystems, RAID copies or snapshot copies, but if you're wiping a single disk, none of that is a concern. Also, it takes quite a while :)


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: