To make developer/user/manager have consistent environment.
Try the following command to see directory hierarchy
$ tree / -L <depth>
$(prefix)/bin # binary files
$(prefix)/sbin # system-usage binary files
$(prefix)/lib # library file, object file (lib*.a, lib*.so, lib*.dylib, ...)
$(prefix)/share # reference file (manpage, example, ...)
$(prefix)/include # library header file (*.h, *.hpp...)
$(prefix)/src # software source code
$(prefix)/etc # software configuration file
/var/cache # process cache
/var/lib # process data storage (e.g. database)
/var/lock # process resource lock
/var/log # process log message
/var/spool # some queuing message (e.g. email)
/var/run # process information (usually linking to /run)
/boot # For boot usage (grub configs are in /boot/grub/)
/dev # Computer Device
/run # process information (e.g. pid)
/media, /mnt # Mounted filesystem (e.g. CD or USB ...)
/root, /home/$(user)
/tmp # Temporary file
# On Memory
/lost+found # ext2/ext3 usage
/proc # device info, process info (pid, openfile,...)
/sys # system loaded module
/etc/passwd
[Format]
account:password:uid:gid:userInfo:homeDirectory:loginShell
[Example]
root:x:0:0:root:/root:/bin/bash
math120908:x:41701:200:math120908:/home/dept/ta/math120908:/bin/bash
/etc/shadow
[Example]
root:$6$hOwDoyoUtUrNtHISOn:16184:0:99999:7:::
[Format]
group:password:gid:userList
[Example]
root:x:0:
linuxadmin:*:62001:tmt514,tmtS14,TwT514,ta221,ta217,ta204,ta219,ta223
You can use following command to see specified entry
$ getent passwd [username]
$ getent group [groupname]
sysctl tool
$ sysctl -a # show all variables
$ sysctl [variable] # read some variable
$ sysctl -w [variable[=value] ...] # write some variable
$ locale
LANG=zh_TW.Big5
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
Format: IP Hostname Alias
140.112.30.46 linux15.csie.ntu.edu.tw linux15
static
auto eth0
iface eth0 inet static
address 140.112.30.46
netmask 255.255.255.0
network 140.112.30.0
broadcast 140.112.30.255
gateway 140.112.30.254
dns-nameservers 140.112.30.21 140.112.254.4 140.112.2.2
dns-search csie.ntu.edu.tw
#up route add -net 192.168.1.128 netmask 255.255.255.128 gw 192.168.1.2
#down route del -net 192.168.1.128 netmask 255.255.255.128 gw 192.168.1.2
DHCP
auto eth0
iface eth0 inet dhcp
See details by
System Level log
dmesg # Boot message log
syslog # Almost all log collected here
messages # Leave some error message
auth.log # Authendication Log
wtmp, faillog # User Logging Information
Application logs (Especially for daemon)
[Example] mail.X, apt, apache, cups ...
Service Name
auth, cron, daemon, kern, lpr, mail, news, syslog,
user, uucp, local0 ~ local7
# local0 = postgresql
# local2 = sudo
# local3 = SpamAssassin
# local4 = slapd
Level (priority)
\* (all) > emerg (panic) > alert > crit > err (error) >
warn (warning) > notice > info > debug > none (nothing)
Format
<service>.<level> <logfile> # log service msgs >= level into logfile
<service>.=<level> <logfile> # log service msgs == level
<service>.!<level> <logfile> # log service msgs != level
# logfile can be file, pipe, user, remote, ...etc
# note: hyphen before <logfile> means async to disk.
See manpage
Example
/var/log/syslog
{
rotate 7
daily
missingok
notifempty
delaycompress
compress
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}
See the parameter details by
Show logrotate procedure
logrotate -v /etc/logrotate.conf
Force logrotate
logrotate -fv /etc/logrotate.conf
Peform logrotate into file rotation -> savelog