Gold University of Minnesota M. Skip to main content.University of Minnesota. Home page.
 
 

What's inside.

Account Management

E-mail

Hardware and Media

Network and Wireless

Offsite Access

Printing

Processes

Security and Passwords

Software and Tools

Systems Staff

Web Development

 

Help Home

IT Labs Home

 
 
 
 
 

 
  Home > Account Management > Unix Account Configuration

Unix Account Configuration

Configuring Your Dot Files

"Dot files" are files in which the first character of the filename is a "." (dot or period). In UNIX, such files are hidden in the sense that the "ls" command will not display them by default. These files usually contain configuration information needed by different programs.

To list the dotfiles in a directory, type the following command:

ls -a

To copy dotfiles, type the following command:

cp .* <target_location>

Please note: Your UNIX environment is loaded when you log in and every time you open a new xterm. After making changes to your dot files you will need to either logout and log back in, or open a new xterm in order for the changes to take effect. When you open a new xterm, your environment will be loaded using the modified dot file.

Be sure to test any changes you have made to your dotfiles before logging out. It is possible to disable your account with a simple typo in your edits. To test your new configuration, log into a different computer with your new settings. If you are unable to successfully open a new X session, you probably have a typo in your modified file.

.aliases

This file allows you to assign longer, more complicated commands to a single word. Within the file, use the following format:

alias <shortcut_name> "longer command"

For example, if you wanted to create a command called "web" to create a file in your web space that is readable on the Internet, you would add the following line to your .aliases file:

alias web "cd ~/.www && chmod 755"

To use the new alias open a new terminal and type the following command:

web me.jpg

Executing this command will change the permissions of the "me.jpg" file in your .www directory to 755 permissions.

.cshrc

The rest of the dot files are more complicated and can have drastic effects on your X Windows environment. The .cshrc controls the behavior of the csh shell (the default shell is tcsh, an updated version of csh). Not only does this file control what modules are loaded, but it also allows you to set a default printer or editor.

To locate the module information look for a line in your .cshrc that looks like the following: "module load software1 software2 ...". To add more modules to your environment, type the following command:

module initadd <software>

After executing this command, the module name will be added to the "module load" line, allowing it to be loaded every time you log in. If you misspell the module name it can have inadvertent effects on your X Windows environment. The best way to fix this problem is to correct the module name in this section of .cshrc. See the modules help page for more information.

.fvwm2rc

This file controls the GUI that makes up your X Windows system. Two window managers are currently supported: FVWM2 and Window Maker. Both are controlled by the .fvwm2rc file. Editing .fvwm2rc is beyond the scope of this help file, but what isn’t self-explanatory can easily be found online.

.xinitrc

While the above three files are for configuration purposes, .xinitrc is the only executable script. This file actually launches your window manager when you log in. Use wmaker for Windows Maker or fvwm2 for the older FVWM2. If there is a program you want to launch every time you log in, enter it in .xinitrc immediately before the fvwm2 or wmaker commands.

Repairing Your Dot Files

Although it is highly unlikely that your dot files can do anything to permanently damage your data or your user account (unless you code them to do just that), a misconfigured file can mess up X Windows. In fact, the most common result of a badly designed configuration is that you will not be able to log in at all. You will know this is the case when the system recognizes your password, starts logging in for a second or two, and then kicks you back to the login screen. Luckily, there are some very easy ways to correct this problem:

Edit the file directly

If you edited one of the above dot files and your X Windows environment is now messed up, remove the changes you made. Your account should now start fine.

Copy the default file back to your home directory

When you initialize your IT Labs account for the very first time, your dot files are copied from the ~template directory. If you know which dot file is causing the problem, just copy that default version of the file from the ~template directory to your home directory using the following command:

cp ~template/<name_of_screwed_up_file> ~/<name_of_screwed_up_file>

The '~' character by itself symbolizes your home directory while '~template' symbolizes the home directory of the user "template" (in this case, it is just a placeholder). The tilde (~) is to the left of the number 1 on PC-style keyboards and near the backspace on Sun keyboards.

Run resetenv

The most drastic--and most effective--way of fixing your dot files is to run the following command:

opt/local/bin/resetenv

This script copies all of your current dot files to a backup directory and then copies the default files from ~template into your home directory. This effectively reverts your X Windows system back to the defaults. Be sure to read the output from the resetenv command carefully. It will tell you which dot files have been set to the defaults and which ones have been kept the same. It also tells you the directory where your old dot files have been stored.

Of course, it is difficult to attempt any of these repairs if the system will not let you log in to begin with. One way around this is to SSH to an IT Labs machine. This will allow you to log in to your Unix account without starting the majority of your X Windows system. You can run SSH from a computer in one of the Windows labs or from most off-campus machines that have an SSH client installed and are connected to the Internet.

If you need additional assistance, please contact the systems operator.

 
The University of Minnesota is an equal opportunity educator and employer.
IT Labs Online Help