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.

May 282011
 

Enable cron log in Ubuntu 10.04 (Lucid Lynx)

Answer:

By default, the output from cron goes into the default general system log "/var/log/syslog" in Ubuntu.

If you prefer to have an unique file for cron log, you can edit the file "/etc/rsyslog.d/50-default.conf"

Uncomment the line (Remove the #):

#cron.*

And finally restart the log service

# service rsyslog restart

May 262011
 

Revert the effect of an earlier changeset in Mercurial

Answer:

In Mercurial, if you want to revert the effect of an earlier changeset, even the changes have been pushed to remote, it is still possible with the hg backout command.

1. Find the revision you want to backout using hg log
# hg log

2. Assume you want to backout to the revision 99, then you can
# hg backout -r 99

May 242011
 

Printing the exclamation mark using echo

Answer:

You might observed a problem when you try to print the exclamation mark (!) using the echo command

E.g.

# echo "test!"
-bash: !": event not found

To solve it, you can use single quote instead

# echo 'test!'
test!