Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jul 122010
 

Compare the difference between two directories

Answer:

You have two directories, say /foo and /bar, and you want to compare the difference between this two directories, you can use

# diff -r /foo /bar

If you only want to know which files difference, you can use

# diff -qr /foo /bar

Jul 092010
 

Print large banner on printer

Answer:

This is a less well known command for Linux. It allow you to prints a large, high quality banner on the standard output.

Example:

# banner -w 80 Hello World

Where -w change the width of the output, in which the default is 132.

Jul 082010
 

Test if local SMTP server is running

Answer:

To test if a local SMTP server is running, you can try to ping the port 25

# echo -e "quit" | nc localhost 25
220 ubuntu ESMTP Postfix (Ubuntu)
221 2.0.0 Bye

If no SMTP server is listening

# echo -e "quit" | nc localhost 25
localhost.localdomain [127.0.0.1] 25 (?) : Connection refused