All commands (14,187)

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

SHA256 signature sum check of file
get the SHA256 sum signatur for a file

Shortcut to find files with ease.
It looks for files that contains the given word as parameter. * case insensitive * matches files containing the given word.

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

Password generator
https://xkcd.com/936/ introduced us to what actually is a good password. Here's such an implementation. Credit: quinq on #suckless

print line and execute it in BASH
If script.sh contains only these two lines: $ uname -a $ whoami

Search files with js declarations inside
Useful to crawl where the javascript is declared, and extract it a common file. You can redirect it to a file to review item by item.

find process associated with a port
e.g. fuser 25/tcp (see which pid is listening on smtp)

Equivalent to ifconfig -a in HPUX

Check if your desired password is already available in haveibeenpwnd database. This command uses the API provided by HIBP

Create arbitrary big file full of zeroes but done in a second
If you want to create fast a very big file for testing purposes and you do not care about its content, then you can use this command to create a file of arbitrary size within less than a second. Content of file will be all zero bytes. The trick is that the content is just not written to the disk, instead the space for it is somehow reserved on operating system level and file system level. It would be filled when first accessed/written (not sure about the mechanism that lies below, but it makes the file creation super fast). Instead of '1G' as in the example, you could use other modifiers like 200K for kilobytes (1024 bytes), 500M for megabytes (1024 * 1024 bytes), 20G for Gigabytes (1024*1024*1024 bytes), 30T for Terabytes (1024^4 bytes). Also P for Penta, etc... Command tested under Linux.


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: