Unix 101 : Showing non-printing characters in text files (ex : DOS files)

A non-printing character is a character which won’t actually get directly printed (or displayed) but rather interpreted. Such non-printing characters are for example line-feed or tabulation. The interpretation of those characters can differ from one system to the next. For example the line-feed character is different on Unix or DOS.

If you need an easy way to confirm that a text file is DOS or UNIX formatted (they differ with respect to the end of line character(s) for example) or if you wish to display normally non-printing characters of a text file, you can use the -vET command line switches of the cat utility.

As explained in the man page :

  • -v : will use the ^ and M- notation for control and multibytes characters
  • -E : will make ends of lines visible
  • -T : will make tabulations visible

For example : Continue reading Unix 101 : Showing non-printing characters in text files (ex : DOS files)

Linux / Unix : Disk usage and identifying biggest files

When working as a systems administrator, you’ll always end up having to solve a file system full error in a hurry. Here are a few commands and hints to help you get out of it quickly on a UNIX like system.
Continue reading Linux / Unix : Disk usage and identifying biggest files

Xen : OpenSolaris 2008.11 DomU running on a Linux Dom0

This post is a step by step explanation about how to get an OpenSolaris 2008.11 run as a Xen DomU on a Linux Dom0.
To follow this, you’ll need a Linux machine ready for Xen (I run Xen 3.3.0), with vncviewer installed.

This post doesn’t explain the basics of Xen, so you might want to start by learning Xen if you don’t already know a bit of it.

Continue reading Xen : OpenSolaris 2008.11 DomU running on a Linux Dom0

shell tip : identify broken symlinks

If you need to identify broken symlinks, you can do the following :
find -L . -type l

The -L options instructs find to follow symlinks when possible. Hence no “working symlink” will ever get returned as the targets won’t match -type l (meaning “file is a symlink”).

On the other hand, find will not be able to follow broken symlinks, so the information will be taken from the symlink itself and not from the non-existent or otherwise unreachable target. The -type l will then be a match and the broken symlink filename will be returned.

Broken symlinks

Case solved 😉

Thanks to the “Ferg’s Gaff” blog (especially the comments) for showing the way !