1. Computing & Technology

Linux Newbie Administrator Guide

From

6.13 Some administration commands

su

(=substitute user id) Assume the superuser (=root) identity (you will be prompted for the password). Type "exit" to return you to your previous login. Don't habitually work on your machine as root. The root account is for administration and the su command is to ease your access to the administration account when you require it. You can also use "su" to assume any other user identity, e.g. su barbara will make me "barbara" (password required unless I am the superuser).

alias ls="ls --color=tty"

Create an alias for the command "ls" to enhance its format with color. In this example, the alias is also called "ls" and the "color" option is only evoked when the output is done to a terminal (not to files). Put the alias into the file /etc/bashrc if you would like the alias to be always accessible to all users on the system. Aliases are a handy way to customize your system. Type "alias" alone to see the list of aliases for your account. Use unalias alias_name to remove an alias.

cat /var/log/httpd/access_log

Show who connected to your http (apache) server since the last time the log file was "rotated" (normally rotated once a day, when cron runs). The previous log file is access_log.1, the yet previous access_log.2, etc.

cat /var/log/secure

(as root) Inspect the important system log. It is really a good idea to do it from time to time if you use Internet access.

ftpwho

(as root) Determine who is currently connected to your ftp server.

printtool

(as root in X-terminal) Configuration tool for your printer(s). Settings go to the file /etc/printcap and (strangely) /var/spool/lpd.

setup

(as root) Configure mouse, soundcard, keyboard, X-windows, and system services. There are many distibution-specific configuration utilities,setup is the default on RedHat. Mandrake 7.0 offers very nice DrakConf .

linuxconf

(as root, either in text mode or in the X terminal). You can access and change hundreds of network setting from here. Very powerful--don't change too many things at the same time, and be careful with changing entries you don't understand. ReadHats network configuration utility netconf is a subset of linuxconf, therefore it is simpler and sometimes easier to use.

mouseconf

(as root). Simple tool to configure your mouse (after the initial installation). Mandrake includes also an alternative mousedrake.

kudzu

(as root). Automatically determines and configures your hardware. If having mysterious problems with your mouse (or other serial hardware), you may want to disable kudzu, so it does not run on the system startup (kudzu messed up my system so I could not have my mouse working). You can run it manually when you need it.

timeconfig

(as root) Set the timezone for your system. My computer hardware clock (BIOS setup) keeps time in UTC (Coordinated Universal Time, which was once called GMT or the Greenwich Mean Time). This way, I avoid any possible problems associated with switching timezones due to the daylight savings time, transferring files across the globe through the network, or a physical travel. It is customary to keep time on a server computers in UTC to avoid time ever going "backwards" (which could cause problems). Timestamps on files are always kept in UTC and displayed in the local time using the time zone information. For example, many applications (e.g., compilers, databases) depend on being able to distinguish a newer file from an older one by comparing their timestamps. It is important to keep the timezone correct. The only reason why I could select to keep BIOS time in the local time is to avoid problems when when dual booting from the same computer, and when the other operating system (MS Windows?) does not know how to handle UTC. Then, I let my Linux server know about this by checking the box "Hardware clock set to GMT", so that Linux can back-calculate the UTC which it needs.

setclock

(as root). Set your computer hardware clock from the current Linux system time. Use the command "date" first to set up the Linux system time. E.g., I could change the date and time to 2000-12-31 23:57 using this command:

date 123123572000

and then write the time to the hardware

* License

* Linux Newbie Administrator Guide Index

©2012 About.com. All rights reserved.

A part of The New York Times Company.