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:
uses the -u switch for UTC
Another way could be
echo $(($(date -ud "00:29:36" +%s)%86400))
This produces a parseable output of the last day of the month in future or past. Change the '-v-0m' to be a month plus or minus from the current system time.
manda la salida de un comando hacia un servicio de paste y coloca la url de ese paste en el portapapeles
It clears caches from memory. It works fine on CentOS and Fedora. It will show you how much memory you need, for real.
apt-get must be run as root, and it is useless to run it as your own user. So just run it as root. Saves you the "sudo !!" every time you're adding a package.
"unzip *.zip" doesn't work as expected, because unzip handle wildcards in a different way.
You just need to escape the wildcard or do in another way:
for f in *.zip; do unzip "$f"; done
Create an alias to list all contents of the current directory in "reverse" time order. Thus the last modified file will appear just above your next prompt. Useful for remembering where you left off modifying files in a folder or just noting recent changes.
csh format but bash syntax similar
if you had a symbolic link called "oldLink" in the current folder then you would want to do
unlink oldLink
You can try it . Nice shell interface to search google from the command line.Visit http://goosh.org in your browser.
I hate -exec with find, and this pattern quickly expands to other tasks.
sudo apt-get install moon-buggy
An ascii 2D game where you control a mooncar and try to avoid moonhole by jumping (press space )
Allows you to change the value of an environment variable only for the execution of the command in the line. (corrected)
Seems obvious, but other seemingly simple ways to use it don't work:
echo !whammy
and
echo "!whammy"
both output:
-bash: !whammy: event not found
and this:
echo "\!whammy"
outputs:
\!whammy
with the slash :(
you can also do any combinations of quotes for a complex string:
echo "It's great to be able to use a bang ("'!'") in a command"'!'
outputs:
It's great to be able to use a bang (!) in a command!