Commands by chrisedion (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

find with high precission (nanoseconds 1/1,000,000,000s) the last changed file.
this is good for variables if you have many script created files and if you want to know which one is the last created/changed one..

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

Use a var with more text only if it exists
See "Parameter Expansion" in the bash manpage. They refer to this as "Use Alternate Value", but we're including the var in the at alternative.

Find the package that installed a command

save your current environment as a bunch of defaults

check open ports without netstat or lsof

easily strace all your apache processes
This version also attaches to new processes forked by the parent apache process. That way you can trace all current and *future* apache processes.

Binary digits Matrix effect
Prints 0's and 1's in The Matrix style. You can easily modify to print 0-9 digits using $RANDOM %10 insted of %2.

List all NPM global packages installed

ignore .DS_Store forever in GIT
With a couple of little commands, you?ll be able to ignore the .DS_Store files forever from your git repositories on mac! The following command will add the .gitignore file to the git configuration git config --global core.excludesfile ~/.gitignore then, the following, will add the .DS_Store to the list echo .DS_Store >> ~/.gitignore


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: