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:
Show you the list of files of current directory sorted by date youngest to oldest, remove the 'r' if you want it in the otherway.
You'll want to use this for passwordless logins. Same as ssh-copy-id, if you don't have it on your system.
Finds all files in /home owned by UID 1056 and changes to 2056.
This command specifies the size in Kilobytes using 'k' in the -size +(N)k option. The plus sign says greater than. -exec [cmd] {} \; invokes ls -l command on each file and awk strips off the values of the 5th (size) and the 9th (filename) column from the ls -l output to display. Sort is done in reversed order (descending) numerically using sort -rn options.
A cron job could be run to execute a script like this and alert the users if a dir has files exceeding certain size, and provide file details as well.
Use ^D instead of exit.
Also ^D ends input stream when you use terminal for typing into standard input.
Dumps a MySQL database over a compressed SSH tunnel and uses it as input to mysql - i think that is the fastest and best way to migrate a DB to a new server!
-nohttpd don't run mini-httpd if VNC java applet is found
-name change the name of the desktop, it's passed to xstartup script via $VNCDESKTOP, run different set of apps acording the name.
-depth pixel depth in bits of the desktop, default is 16
-geometry size of the desktop, default is 1024x768
If you use symlinks a lot, especially nested symlinks, this puts you back on the absolute path to command-line-fu-nirvana. (Note the backticks around pwd).
cat file1 file2 file3|sort|uniq -d
finds the same lines in several files, especially in files with lists of files.
Simply change your web browser's proxy settings to point to a SOCKS proxy at port 8888 and you're good to go.
Kill -9 immediately kills the given process number. $$ is the process ID of the process you are in.
finds all forms instanciated into a symfony project, pruning svn files.
Get simple description on each file from /bin dir, in list form, usefull for newbies.
# Small for loop, that can list files in dir, and after that executes
# [COMMAND] of your choice, usefull for example rename, move, tar etc..
# change cmd's for different results :)
From the other machine open a web navigator and go to ip from the machine who launch netcat, http://ip-address/
If you have some web server listening at 80 port then you would need stop them or select another port before launch net cat ;-)
* You need netcat tool installed