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:
Watches for file modifications in the current directory and tails the file.
Shows which applications are making connections, and the addresses they're connecting to. Refreshes every 2 seconds (watch's default). Test on OSX, should work anywhere watch and lsof work.
Monitoring TCP connections number showing each state. It uses ss instead of netstat because it's much faster with high trafic.
You can fgrep specific ports by piping right before awk:
watch "ss -nat | fgrep :80 | awk '"'{print $1}'"' | sort | uniq -c"
Sends the "USR1" signal every 1 second (-n 1) to a process called exactly "dd".
The signal in some systems can be INFO or SIGINFO ...
look at the signals list in: man kill
This handles when you have a single call or channel. Other commands will strip out the result if there is a single channel or call active because the output changes the noun to be singular instead of plural.
You can upload via ftp the script.sh in unix text format, and then upload a file called run.txt to execute once the script. Such script can be multiline. If the script fails a failed.txt will be generated that you can see via ftp.
Values will depend on the driver and the hardware specifics, so you need to refer to your driver documentation for proper interpretation of those values.
In certain cases you mighy need to monitor the server load caused by certain process. For example HTTP, while stress testing apache using ab (apache benchmark) you may want to monitor the server status,load, # of spawned HTTP processes, # of established connections, # of connections in close wait state, apache memory footprint etc.
Watches the headers of a curl, following any redirects and printing only the HTTP status and the location of the possible redirects.
Convenient to leave running in a yakuake or plasmacon terminal.
For older kernels
watch -n 5 cat /proc/acpi/battery/BAT0/state
Usage:
watch ls -l
Basic but usable replacement for the "watch" command for those systems which don't have it (e.g. the Solaris I'm trapped on).
Type Ctrl+V to escape the following Ctrl+L which clears the screen. It will be displayed as "^L".
You need to have figlet(for font) and cowsay installed.
Just copy n paste this command and you can see.....
# ### ### # # ### ### # # #
## # # ### # # # # ### ## # #
# # # # ### # # # # ### # # # #
# ### ##### # # #####
# # # ### # # ### # #
# # # ### # # ### # #
##### ### ### # ##### ### ##### #