poniedziałek, 26 listopada 2012

How to remove Ctrl^M from end of line in text file.



cat filename | perl -pe 's/\015\012/\n/g' > new_file_with_no_ctrl_m

Using "tar" to extract and compress data.


tar -cvfz mytarfile.tgz
tar -xvfz *.tar.gz

Searching text between string delimiters.

How to parse log file to get string between specific string delimiters:

example:

awk 'NR>1{print $1}' RS='(' FS=')' 

where:
- "Left" delimiter is RS=''
- "Right" delimiter is FS=''

!!!Delimiters can be string ;) !!!