Commands by skytux (1)

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 an existing Git repo to a bare repo
If you want to turn a Git repo into the origin that folks can push to, you should make it a bare repository. See: http://stackoverflow.com/questions/2199897/git-convert-normal-to-bare-repository

Convert JSON to YAML
This is based on __unixmonkey73469__ answer. You will need to supply `--multiline 1` option to JSON importer if your .json is multiline (i.e. it was prettyfied) And you still need catmandu installed via `cpanm Catmandu`

Salvage a borked terminal
Also works in places where reset does not.

Remove all HTML tags from a file
A shorter version of command #3014, using awk instead of sed. Useful when scraping websites with a script.

a find and replace within text-based files
using find's exec option instead of a for loop and using sed's -i option for inplace replacement. no need to do the file swap.

add all files not under version control to repository
This should handle whitespaces well and will not get confused if your filenames have "?" in them

run command on a group of nodes in parallel
The pee command is in the moreutils package.

Recursively remove all files in a CVS directory
This will search all directories and ignore the CVS ones. Then it will search all files in the resulting directories and act on them.

calulate established tcp connection of local machine

List Listen Port by numbers
Show TCP Listen ports sorted by number (bugs: IPV6 addresses not supported)


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: