≡ Menu

gnu

I'm trying to match words using GNU awk command and getting the following error:

echo 'foo bar this that blah' | awk '{gsub("\<regex-word\>", "NEW-WORD");print}'

But getting the following warning on screen and it is not working:
awk: warning: escape sequence `\< ' treated as plain `<' awk: warning: escape sequence `\>' treated as plain `>'

How do I fix this problem under Unix like operating systems?
[click to continue…]

Truncate: UNIX Binary Log File

How do I truncate a UNIX binary log file using command line options?
[click to continue…]

Linux/UNIX: Move File Starting With A Dash

In Unix or Linux operating systems, how do I move file(s) starting with a dash (e.g., /home/you/--filename.txt or /home/you/-filename.txt)?
[click to continue…]

Apple Mac OS X Open And View .chm File

I know how to open .chm files under Linux, but how do you open and view .CHM files under Apple Mac OS X?
[click to continue…]

sed Delete / Remove ^M Carriage Return [ Line Feed ]

How can I remove the ^M or ^M (carriage Return / line feed ) from text file using sed under UNIX or Linux operating systems?
[click to continue…]

Can you explain me usage of nullglob variable under BASH? How do I check for any *.c files in any directory?
[click to continue…]

Solaris UNIX Case-Insensitive Find File Search

I'd like to match all filename like foo.c, FOO.C, fOO.c, Foo.C and so on using find command under UNIX. How do I do a case-insensitive find search under Sun Solaris / OpenSolaris UNIX systems?
[click to continue…]