Severity: Notice
Message: Memcache::connect(): Server localhost (tcp 11211, udp 0) failed with: Connection refused (111)
Filename: libraries/Cache.php
Line Number: 83
Severity: Warning
Message: Memcache::connect(): Can't connect to localhost:11211, Connection refused (111)
Filename: libraries/Cache.php
Line Number: 83
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.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
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:
If you update youtube-dl from the repos, it becomes out-of-date quickly. Luckily, it can auto-update.
I'm not sure why you would want to do this, but this seems a lot simpler (easier to understand) than the version someone submitted using awk.
If X is 5, it will about a number between 1 and 5 inclusive.
This works in bash and zsh.
If you want between 0 and 4, remove the +1.
List all files from the current directory and subdirectories, sorted by modification time, oldest first.
I'm pretty sure everyone has curl and sed, but not everyone has lynx.
This is better than doing a "for `find ...`; do ...; done", if any of the returned filenames have a space in them, it gets mangled. This should be able to handle any files.
Of course, this only works if you have rename installed on your system, so it's not a very portable command.
If you don't want to delete them, but just want to list them, do
find -L /path -type l
If you want to delete them with confirmation first, do
find -L /path -type l -exec rm -i {} +
Using the -L flag follows symlinks, so the -type l test only returns true if the link can't be followed, or is a symlink to another broken symlink.
This will update the tarball, adding files that have changed since the last update.
This assumes that the tarball is in the same directory as the files being archived.
N.B. This command can't be used on compressed tarballs.
N.B. This will add the updated files to the tarball, so that the tarball will have two versions of each file. This will make the tarball larger, but doesn't have any other significant effect.
pi 66
This prints out the first 66 digits of pi.
number
This takes any number (no more than 66 digits long) from stdin (or on the command line), and tells you how to say it. E.g
number 365
outputs "three hundred sixty-five"
If you're like me and want to keep all your music rated, and you use xmms2, you might like this command.
I takes 10 random songs from your xmms2 library that don't have any rating, and adds them to your current playlist. You can then rate them in another xmms2 client that supports rating (I like kuechenstation).
I'm pretty sure there's a better way to do the grep ... | sed ... part, probably with awk, but I don't know awk, so I'd welcome any suggestions.