Linux/Unix fundamentals: Dotfiles

This is going to be what's know as a fundamentals post. Today I'm going to look at an important concept, and explain it so that we can use that knowledge later. We won't necessarily do anything with practical utility with it this time round, we're mostly laying framework for future posts.

In this first fundamentals post, I'm going to take a look at dotfiles.

Under most operating systems which act like Unix, dotfiles are files which begin with a dot character (.). The important point here is that dotfiles are almost always 'hidden'.

Like files marked 'hidden' under Windows, these files won't show up while you're browsing around through a file manager or through the command line, so if you want a file to be hidden, start its name with a dot.

Beware, though, it's easy to see dotfiles. If you're in a graphical file manager, head to View > Show Hidden Files, or if you're in the terminal use:

$ ls -a

(the a switch to ls) to see hidden files.

[Quick aside - any Mac OS X users, this still applies to you - but the Finder doesn't let you view dotfiles by default. You can coax it into showing all files with a quick Terminal command (/Applications/Utilities/Terminal):

$ defaults write com.apple.Finder AppleShowAllFiles YES

Restart the Finder and then you'll see dotfiles and some OS X-specific stuff too. Change YES to NO in the command and restart the Finder again to turn back off.]

Or, if you're using a traditional Unix system in a graphical configuration, try going into your home folder and viewing hidden files. You'll see loads of dotfiles (well, folders) with names of different bits of software.

Dotfiles in ~

These are actually configuration files for all the various bits of software you might have played with (and obviously the ones you use every day). Don't delete these, or you might lose your settings! Still, know they're there.

That about concludes it for this quick fundamentals post - now you should know what dotfiles are, how you can hide stuff, and that they're often used for configuration files.

Avatar for peter Peter Upfold - http://peter.upfold.org.uk/

Peter Upfold is a technology enthusiast from the UK. Peter’s interest in Linux stems back to 2003, when curiosity got the better of him and he began using SUSE 9.0. Now he runs Linux Mint 9 on the desktop, runs a CentOS-based web server from home for his personal website and dabbles in all sorts of technology things across the Windows, Mac and open source worlds.

Home » Articles »

Discussion: Linux/Unix fundamentals: Dotfiles

  1. Chris (guest)

    # Posted on 13 February 2007 at 02:23 PM

    Now all my icons are semi-transparent... huh?



  2. Chris (guest)

    # Posted on 13 February 2007 at 02:24 PM

    I un-did the un-hiding and things are back to normal... fully opaque icons and all!



Home » Articles » Linux/Unix fundamentals: Dotfiles