commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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.
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:
List all dependencies manifests so you can install them.
In a scenario where you want to deploy a number of web applications and run their dependency managers, how could you run all of them in a systematic order.
One of the complexity is to ensure you get only your own top level dependencies. That way, you don recursively call development dependencies of your own dependencies.
Otherwise you might end up discovering dependency management manifests that are already been pulled by your own projects.
# Using this command
This command helps me find them and I can then run what?s required to pull them from their respective sources.
This command assumes the following:
1. Your code checkouts are in a flat repository layout (i.e. not nested).
2. Finds manifests for:
- NPM (nodejs),
- Composer (php),
- requirements.txt (Python), and
- git submodules
replace all "?" characters in filename to underscore
rename all dirs with "?" char in name, leave spaces and () in place
This prints out a list of all zombie processes PIDs so you can do things like kill the zombies
This allows for sleeping in between pings. Also, espeak needs to be installed.
Enable root user to run VLC
Dave Korn gave me this one. It works because ksh allows variable names ( w/o the $name syntax ) used by sh and bash.
I wrote it to permit "single source" shell libraries; the current objective: every shell library may be sourced by either shell. see http://github.com/applemcg/backash
Sometimes you just want to operate on files that were created after specific date. This command consists of 3 commands:
- Create a dummy file with the custom date
- Find all files with "creation time" further than our custom date by using `-newer` find option. Add your crazy stuff here, like moving, deleting, printing, etc.
- Remove the dummy file
Find all books on my systems and move them into folder. The -0 switches are to handle spaces etc. in the filenames.
Why would you need this? Locate uses an index, so it's super quick, and xargs is more elegant than a for loop.
You probably want to run `brew update` before you run this command
This command takes all `.po` files inside `i18n` directory and compiles them to `.mo` files with same basename
I'm the author of PM2 and wrote this tool, and I'm please to share it here.
Github project link: https://github.com/Unitech/pm2
In case you need to test some CGI scripts this does the job. It also has the functionality of a http server.
Show the maximum amount of memory that was needed by a process at any time. My use case: Having a long-running computation job on $BIG_COMPUTER and judging whether it will also run on $SMALL_COMPUTER.
VmHWM: Peak resident set size ("high water mark")
only during session
List all fonts used by an SVG file. Useful to find out which fonts you need to have installed in order to open/edit an SVG file appropriately.