Check These Out
Same as http://www.commandlinefu.com/commands/view/5876, but for bash.
This will show a numerical value for each of the 256 colors in bash. Everything in the command is a bash builtin, so it should run on any platform where bash is installed. Prints one color per line. If someone is interested in formatting the output, paste the alternative.
Copies file.org to file.copy1 ... file.copyn
This command seems to achieve the similar/same goal.
While I love gpg and truecrypt there's some times when you just want to edit a file and not worry about keys or having to deal needing extra software on hand. Thus, you can use vim's encrypted file format.
For more info on vim's encrypted files visit: http://www.vim.org/htmldoc/editing.html#encryption
Works in Ubuntu, I hope it will work on all Linux machines. For Unixes, tail should be capable of handling more than one file with '-f' option.
This command line simply take log files which are text files, and not ending with a number, and it will continuously monitor those files.
Putting one alias in .profile will be more useful.
Bash only, no sed, no awk. Multiple spaces/tabs if exists INSIDE the line will be preserved. Empty lines stay intact, except they will be cleaned from spaces and tabs if any available.
This will search all directories and ignore the CVS ones. Then it will search all files in the resulting directories and act on them.
Ever needed to test firewalls but didn't have netcat, telnet or even FTP?
Enter /dev/tcp, your new best friend. /dev/tcp/(hostname)/(port) is a bash builtin that bash can use to open connections to TCP and UDP ports.
This one-liner opens a connection on a port to a server and lets you read and write to it from the terminal.
How it works:
First, exec sets up a redirect for /dev/tcp/$server/$port to file descriptor 5.
Then, as per some excellent feedback from @flatcap, we launch a redirect from file descriptor 5 to STDOUT and send that to the background (which is what causes the PID to be printed when the commands are run), and then redirect STDIN to file descriptor 5 with the second cat.
Finally, when the second cat dies (the connection is closed), we clean up the file descriptor with 'exec 5>&-'.
It can be used to test FTP, HTTP, NTP, or can connect to netcat listening on a port (makes for a simple chat client!)
Replace /tcp/ with /udp/ to use UDP instead.