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:
Find random strings within /dev/urandom. Using grep filter to just Alphanumeric characters, and then print the first 30 and remove all the line feeds.
Prints a graphical directory tree from your current directory
I sometimes want to know what packages are installed on my Ubuntu system. I still haven't figured out how to use aptitude effectively, so this is the next best thing. This allows finding by name.
The grep '^ii' limits the display to only installed packages. If this is not specified, then it includes listing of non-installed packages as well.
Change the -p argument for the port number. See "man nmap" for different ways to specify address ranges.
Check if Fail2Ban is running on the system and alert it with a message in the terminal
Surround the first letter of what you are grepping with square brackets and you won't have to spawn a second instance of grep -v. You could also use an alias like this (albeit with sed):
alias psgrep='ps aux | grep $(echo $1 | sed "s/^\(.\)/[\1]/g")'
Shows the current directory and those below it in a simple tree structure. Recommended use:
* = where
checking files in current and sub directories, finding out the files containing "sampleString" and removing the containing lines from the file.
* Beware that The command will update the original file [no backup].
The command can be extended if play with 'find' command together,
e.g. it is possible to execute on certain type of files: *.xml, *.txt... (find -name "*.xml" | grep....)
if anybody knows a better solution on that, please drop a comment. thx.
Counts number of lines of code in *.h and *.cc files
show physical disk using, except tmpfs, gvfs, and so on.
Allows to check if shared library could be dynamically loaded
allows to grep very narrow subset of files
Alias the grep command to show colored results by default.
Use the aliased command 'nsl'
its useful to run dos2unix command later on them.