Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Please look in to the picture,here am trying to open(with vi editor) my server console log file(around 100MB) and it takes more than two minutes to open with so many special characters.after deleting the first line (means typing "dd")then i can easily view the file and size of the file is also reduced very much.My server OS is RHEL 5.4 and jboss is running in to it.

Please help me to avoid such junk characters coming to my server console log files and it helps me to save my valuable space in server.

alt text

share|improve this question
What console log are we talking about? – ringø Jan 15 '11 at 11:33
Those are nulls. Any idea what's writing them to your log? That's pretty weird. – Dennis Williamson Jan 15 '11 at 15:03
up vote 1 down vote accepted

simplest way would be filter non-printable chars, like that

cat console.log |perl -pe 's/[^[:print:]\n]//gi' > cleared_log.file

or just

perl -pe 's/[^[:print:]\n]//gi' console.log

But best way would be to figure out why u have such a junk in that log file

share|improve this answer

In VI, a ^@ represents a NULL (ASCII value 0) character. Googling for appears to suggest this is a known issue with JBoss and Logrotate. Check this website for some insight and a suggested fix:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.