Tomcat webapps are often remote links
seq 20 | awk '{line=line sep $0; sep=" "} !(NR%5){print line; line=sep=""}' Show Sample Output
Why use grep and awk?
to be executed from root. this works well on most commercial unix systems, have not tried on linux systems.
Sometimes, it is annoying to find your files or directories missing. If you want to log all the rm commands you can put this in /etc/profile.
count connections, group by IP and port
This version builds on my command 8776 (Find the package a command belongs to on debian-based distros). So if you use that command to find package name then you could alternatively use following for
package summary:
function summpkg { dpkg -s $(whichpkg $1 | awk -F: '{print $1}'); }
Show Sample Output
Multi-word parameters in my.cnf can be written with either hyphens or underscores. innodb_file_per_table is the same as innodb-file-per-table, as well as innodb_file-per_table. The script normalizes the parameter names to using underscores only, keeping from changing values (e.g. ?mysql-bin? parameter value should not change).
Replace .py with .rb or .java to get the LOC of that particular filetype. An alternative is http://www.commandlinefu.com/commands/view/2812/make-a-statistic-about-the-lines-of-code Show Sample Output
If your version of curl does not support the --compressed option, use
curl -s http://funnyjunk.com | gunzip
instead of
curl -s --compressed http://funnyjunk.com
If you used to do `vlc /tmp/Flash*`, but no longer can't, this is for you.
It can work for message queue, semaphore set or shared memory just changing the parameter.
- all zips are in current folder - FILENAME is file name that should be subsitute in all zips (new version of this file is in current folder)
Count and Find all IP connected to my host through TCP connection. Show Sample Output
Show only specific process id's using Top Show Sample Output
Removes all kernels and corresponding packages except of the one you're currently using.
attempts to delete all local branches. git will fail on any branches not fully merged into local master, so don't worry about losing work. git will return the names of any successfully deleted branches. Find those in the output with grep, then push null repositories to the corresponding names to your target remote. assumes: - your local and remote branches are identically named, and there's nothing extra in the remote branch that you still want - EDIT: you want to keep your local master branch
commandlinefu.com is the place to record those command-line gems that you return to again and again. 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.
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: