Archive for the 'linux' Category

FreeBSD, (SuSE) Linux date differences

I wanted to retrieve yesterdays date with a format of YYYYMM
This was solved in FreeBSD like this:

date -v-1d “+%Y%m”

(SuSE) Linux doesn’t know the -v option
The same thing in Linux could be done like this:

date -d yesterday “+%Y%m”

Why the difference?

ANSI Highlighting With less

My less command of my FreeBSD installation doesn’t show the ansi colors embedded in the Rails log file. Well it does shows the codes, but I don’t want to see those.

I found a simple solution for this:

export LESS=’–RAW-CONTROL-CHARS’

Put the code above in the ~/.bashrc/ file and less will finally show the colors…!