linux重要子目录总结,linux的重要子目录

本文详细介绍了Linux系统的运行级别、环境变量配置、系统日志、软件安装位置、用户登录信息以及系统资源监控等方面的内容,包括如何切换运行级别、查看系统别名、环境变量、登录欢迎信息以及CPU和内存信息等。同时,提到了/var/log/secure中的用户登录安全日志和系统负载情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

at /etc/inittab

# inittab is only used by upstart for the default runlevel.

#

# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.

#

# System initialization is started by /etc/init/rcS.conf

#

# Individual runlevels are started by /etc/init/rc.conf

#

# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf

#

# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,

# with configuration in /etc/sysconfig/init.

#

# For information on how to write upstart event handlers, or how

# upstart works, see init(5), init(8), and initctl(8).

#

# Default runlevel. The runlevels used are:

#   0 - halt (Do NOT set initdefault to this)

#   1 - Single user mode

#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)

#   3 - Full multiuser mode

#   4 - unused

#   5 - X11

#   6 - reboot (Do NOT set initdefault to this)

#

id:3:initdefault:

2.7运行级别说明

运行级别

说明

0

关机

1

单用户模式,root密码忘了,默认没有网络

2

多用户模式,没有NFS(网路文件系统

3

完全多用户模式,命令模式

4

没有使用

5

图像界面模式,桌面模式

6

重启

2.71如何切换运行级别

[root@zzz]# init 5

[root@zzz]# runlevel ##查看当前运行级别

3 5 ##上一次运行级别  当前运行级别

[root@zzz]#

永久切换

[root@zzz39 zzz]# grep "id:" /etc/inittab

id:3:initdefault:

2.8 存放的是软件管理的命令

cd /etc/init.d/

abrt-ccpp         functions         lvm2-monitor      postfix           saslauthd

abrtd             haldaemon         mdmonitor         psacct            single

abrt-oops         halt              messagebus        quota_nld         smartd

acpid             ip6tables         netconsole        rdisc             sshd

atd               iptables          netfs             rdma              svnserve

auditd            irqbalance        network           restorecond       sysstat

blk-availability  kdump             nfs-rdma          rngd              udev-post

cpuspeed          killall           ntpd              rsyslog

crond             lvm2-lvmetad      ntpdate           sandbox

2.9 存放系统别名----存放系统环境变量

[root@zzz39 ~]# cat /etc/profile

# /etc/profile

# System wide environment and startup programs, for login setup

# Functions and aliases go in /etc/bashrc

# It's NOT a good idea to change this file unless you know what you

# are doing. It's much better to create a custom.sh shell script in

# /etc/profile.d/ to make custom changes to your environment, as this

# will prevent the need for merging in future updates.

................

2.10用户的环境变量

cat ~/.bashrc

# .bashrc

# User specific aliases and functions

#alias rm='rm -i'

alias cp='cp -i'

alias mv='mv -i'

# Source global definitions

if [ -f /etc/bashrc ]; then

. /etc/bashrc

fi

...........................

2.11用户的环境变量

cat ~/.bash_profile

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

2.12用户登录或远程连接之后显示的内容

[root@zzz ~]# cat /etc/motd

[root@zzz ~]# echo "welcome to  linux training" >> /etc/motd

Last login: Wed Jul 19 20:09:36 2017 from 10.0.0.1

welcome to  linux training

2.13/usr/local/编译安装的默认位置

安装软件的方法

yum软件管家(yellow dog)

从网上下载自动替你安装

rpm命令安装软件

缺少东西自己加工,自己下载

编译安装

自己做,自己编译

./configure     make   make install

2.14 /var/log/secure用户的登录信息

cat /var/log/secure

Jul 16 13:15:05 zzz39 sshd[1454]: Server listening on 0.0.0.0 port 22.

Jul 16 13:15:05 zzz39 sshd[1454]: Server listening on :: port 22.

Jul 16 13:16:45 zzz39 login: pam_unix(login:session): session opened for user root by LOGIN(uid=0)

Jul 16 13:16:45 zzz39 login: ROOT LOGIN ON tty1

Jul 16 13:28:38 zzz39 sshd[2096]: reverse mapping checking getaddrinfo for bogon [10.0.0.1] failed - POSSIBLE BREAK-IN ATTEMPT!

Jul 16 13:28:45 zzz39 sshd[2096]: Accepted password for root from 10.0.0.1 port 58100 ssh2

Jul 16 13:28:45 zzz39 sshd[2096]: pam_unix(sshd:session): session opened for user root by (uid=0)

Jul 16 17:10:41 zzz39 sshd[1605]: Server listening on 0.0.0.0 port 22.

Jul 16 17:10:41 zzz39 sshd[1605]: Server listening on :: port 22.

2.15用户的系统日志

/var/log/messages

tail -20 /var/log/messages

Jul 19 21:44:10 zzz39 init: prefdm main process (6959) terminated with status 1

Jul 19 21:44:10 zzz39 init: prefdm main process ended, respawning

Jul 19 21:44:10 zzz39 init: prefdm main process (6976) terminated with status 1

Jul 19 21:44:10 zzz39 init: prefdm main process ended, respawning

Jul 19 21:44:11 zzz39 init: prefdm main process (6993) terminated with status 1

Jul 19 21:44:11 zzz39 init: prefdm main process ended, respawning

Jul 19 21:44:11 zzz39 init: prefdm main process (7010) terminated with status 1

Jul 19 21:44:11 zzz39 init: prefdm main process ended, respawning

Jul 19 21:44:11 zzz39 init: prefdm main process (7027) terminated with status 1

Jul 19 21:44:11 zzz39 init: prefdm main process ended, respawning

Jul 19 21:44:11 zzz39 init: prefdm main process (7044) terminated with status 1

2.16cpu信息

cpu cores   : 2

apicid      : 0

initial apicid  : 0

fpu     : yes

fpu_exception   : yes

cpuid level : 22

wp      : yes

...................

2.17内存的信息

cat /proc/meminfo

MemTotal:        1004112 kB

MemFree:          656036 kB

Buffers:           44760 kB

Cached:           179504 kB

SwapCached:            0 kB

Active:           101796 kB

Inactive:         136168 kB

Active(anon):      13920 kB

Inactive(anon):        8 kB

Active(file):      87876 kB

Inactive(file):   136160 kB

.........................

2.18平均负载,系统的繁忙程度

cat /proc/loadavg

0.00 0.01 0.00 2/181 7211

2.19系统挂载信息

cat /proc/mounts

rootfs / rootfs rw 0 0

proc /proc proc rw,relatime 0 0

sysfs /sys sysfs rw,relatime 0 0

devtmpfs /dev devtmpfs rw,relatime,size=487428k,nr_inodes=121857,mode=755 0 0

devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0

*tmpfs /dev/shm tmpfs rw,relatime 0 0

/dev/sda3 / ext4 rw,relatime,barrier=1,data=ordered 0 0

/proc/bus/usb /proc/bus/usb usbfs rw,relatime 0 0

/dev/sda1 /boot ext4 rw,relatime,barrier=1,data=ordered 0 0

none /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0

/dev/sr0 /mnt/cdrom iso9660 ro,relatime 0 0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值