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:
grabbed from Andrew Aylett post:
in Cygwin, start X server fullscreen ...
For openGL, check here:
XDMCP ust be enabled (gdm,lightdm,xdm etc )
xinit $(which gnome-awesome-session)
with cat /usr/local/bin/gnome-awesome-session:
exec gnome-session --session awesome "$@"
note: in ubuntu 12.10 a probable Xephyr recent bug rejects keybd option ...
ssh compresion -C option ...
on slow connection VNC performs better but in local LAN native secure X protocol is an option
What does it mean?
The redirection operator n>&m makes file descriptor n to be a copy of file descriptor m. So, whe are:
- Opening a new file descriptor, 3, that is a copy of file descriptor 1, the standard output;
- Making file descriptor 1 a copy of file descriptor 2, the standard error output;
- Making file descriptor 2 to be a copy of file descriptor 3 (the "backup" of the standard output)
in a short: we swapped the standard output and the standard error output.
extract data in multiline blocks of data with perl pattern matching loop
depends on date format locale ...
useful to count events in logs
- excel date compatible with a separate hour field
- added a fixed 1 for easier request counter aggregation
- split URL in directory, filename, fileext, query
- used with tomcat valve with response bytes replaced by elapsed time
with a semicolon text file map, apply multiple replace to a single file
added greedy trick in wildcard match (.*?) from
shell loop to scan netstat output avoiding loolback aliases (local/remote swap for local connections)
use imagemagik convert
rename file name with fixed length nomeric format pattern
change keyboard layout in X
range context (-A -B) search, with exclusion of vcs directories
grep multiline in Perl regexp syntax with pcregrep
look at /boot/grub/menu.lst for somethig like:
## additional options to use with the default boot option, but not with the
## e.g. defoptions=vga=791 resume=/dev/hda5
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(verbose mode) vga=775 debug
# altoptions=(console mode) vga=ask
# altoptions=(graphic mode) quiet splash
# altoptions=(recovery mode) single
vga=(decimal value) is framebuffer mode