Tag archive for bash commands

find difference between two text files with one item per line

find difference between two text files with one item per line

grep -Fxvf file1 file2 Where -F, –fixed-strings Interpret PATTERN as a list of fixed strings, separated by newlines, any of which is to be matched. -x, –line-regexp Select only those matches that exactly match the whole line. -v, –invert-match Invert the sense of matching, to…

Continue reading →

my minimum dot bashrc file

my minimum dot bashrc file

Here is one of the few minimum configurations I like to have on my personal .bashrc file export PS1="\[\033[0;36m\]{\[\033[0;50m\]\w/\[\033[0;36m\]} \[\033[0;32m\]what now… \[\033[0;39m\]" Ok, mac doesn’t have a proper root user, but I often run 2 virtual machines at the same times and one of them…

Continue reading →

Add and append text to a file

Add and append text to a file

There are different ways, I like is: echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn append text to a file echo "ServerName localhost-appended" | sudo tee -a /etc/apache2/conf.d/fqdn

Continue reading →

Bash: TAB completion to be case-insensitive

Bash: TAB completion to be case-insensitive

If you want the TAB completion to be case-insensitive, like it is in MS-DOS for instance, you can in your ~/.inputrc set: set completion-ignore-case On Now, BASH will auto-correct the case of files and directories for you.

Continue reading →

Fork bomb

Fork bomb

:(){ :|:& };: http://en.wikipedia.org/wiki/Fork_bomb

Continue reading →