Unix Tagged Q & A

How do I find out my DNS server IP address assiged my my ISP under Unix or Linux operating system using command prompt? How do I find preferred dns server under Debian / Ubuntu / Fedora Linux desktop system?

{ 6 comments }

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?

{ 0 comments }

I would like to move all desktop:~/Downloads/*.avi files from my desktop to laptop:~/Download/ using rsync. How do I delete source file after successful transfer is done using rsync command under BSD/Unix/Linux/Apple OS X operating systems?

{ 6 comments }

I often type the wrong command as follows under Linux bash shell:
rsync -av dir1 user@server1.cyberciti.biz:/path/to/dir1
OR
cp -av file1*.txt file2*.txt /path/to/dest

I need to correct those command as follows:

rsync -av dir5 user@server1.cyberciti.biz:/path/to/dir1
cp -av delta1*.txt delta2*.txt /path/to/dest

How do I replace dir1 with dir5 or file with delta and repeat the last command under bash shell?

{ 5 comments }

I got over 100s of HTML files in the following format:
….
…..

<PRE>
my data 1
my data 2
my data 3
my data 10000
my data N times
</PRE>
.....
..

How do I extract text between two words (<PRE> and </PRE>) in unix or linux using grep command?

{ 9 comments }

How do I mirror files from remote ftp server using lftp command? How do put the entier directory from a local disk to a remote ftp server (reverse mirror) using lftp command under Linux and Unix like operating systems?

{ 8 comments }

How do I import a MySQL .SQL text file to MySQL database sever using command line or gui tools?

{ 9 comments }