commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
"-D -R Attach here and now. In detail this means: If a session is running, then reattach. If necessary detach and logout remotely first. If it was not running create it and notify the user. This is the author?s favorite."
Also lists hidden files, current dir and topdir.
Shell function; returns 0 if the port is up, 1 otherwise (check $? after executing).
First parameter: IP address/hostname
Second parameter: port number
There is no error checking for the input parameters.
Prints exactly 15th line of $file. You can also specify a range:
sed -n '2,18p' $file - this will print lines 2 to 18, inclusive.