Linux directory structure - the lower

Chapter 1 / etc directory

1.1 /etc/inittab

1.1.1 view the current run level of the system

[root@nfsnobody ~]# runlevel 
N 3##查看系统当前运行级别 后面的数字表示当前运行级别

1.1.2 modify the run level

Temporary modification

[root@nfsnobody ~]# ##修改-临时修改
[root@nfsnobody ~]# init 5
永久修改
[root@nfsnobody ~]# tail -n5 /etc/inittab 
#   4 -unused
#   5 - X11
#   6 -reboot (Do NOT set initdefault to this)
# 
id:3:initdefault:     改这一行 修改成需要的级别即可

1.2 /etc/init.d

Service Management Command depository (this is a directory)

[root@nfsnobody ~]# ll /etc/init.d/

1.3 /etc/profile与/etc/bashrc

1.3.1 /etc/profile

Environment variables Alias
Alias also modify here

1.3.2 /etc/bashrc

Specially configured aliases file

1.3.3 mutual relations

/etc/profile全局
/etc/bashrc国法
~/.bashrc局部
~/.bash_profile家法

1.4 /etc/issue与/etc/motd

1.4.1 /etc/issue

/etc/issue.net 
file content is displayed before the user login system
work in order to secure server information will usually clear the contents of the file to prevent its display

[root@nfsnobody ~]# cat /etc/issue
CentOS release 6.9 (Final)
Kernel \r on an \m

1.4.2 /etc/motd

Contents of the file after the user login system displays
the default content of the file there is no need to add

1.5 /etc/sysconfig/i18n

Permanent configuration where aliases

Chapter 2 / usr directory

2.1 /usr/local与/usr/share

2.1.1 /usr/local

Under linux install software to compile and install the default location

2.1.2 /usr/share

Documentation and Help

Common way to install software under Chapter 3 linux

3.1 yum

yum point takeaway takeaway solve what is missing less
for you to download for you to install the missing stuff for you to address
the need for network

[root@nfsnobody ~]# yum install tree -y
-y表示命令运行后 操作都选择yes/同意

3.2 rpm  

rpm supermarket frozen dumplings (semi-finished) lack of Han Han themselves less
rpm -ivh package .rpm ## rpm package

[root@nfsnobody ~]# ###rpm -qa   q查询a 所有

3.2.1 compile and install

Compile and install according to their own preferences to
prepare dishes cooking the meal

./configmake     make install

3.3 Understanding lrzsz    

rz upload the file to the linux
#sz downloaded from Linux into the windows

Chapter 4 / var directory

/ var directory variable often change
/ var / log log

4.1 / var / messages

System default log

4.2 How elegant view log

How elegant view log

1.head
2.tail
3.grep
4.less    一页一页查看内容
          空格  或者f 下一页
          b上一页
          q  退出
5.more  一页一页查看内容  快捷键和less相同

        
Cutting the log (Log polling) 

4.3 / var / log / secure

Record user login information log

/var/log/secure  #安全日志  记录用户的登陆信息日志 
Jul 10 21:51:25 nfsnobody sshd[25452]: Failedpassword for root from 10.0.0.1 port 56276 ssh2
Jul 10 21:51:26 nfsnobody sshd[25452]: Failedpassword for root from 10.0.0.1 port 56276 ssh2
                                          failed 错误的

4.4 View real-time updates

Tail -f command

比如tail -f /var/log/ secure
输入命令后只要不撤销 日志有更新就会一直显示在底部

Guess you like

Origin www.cnblogs.com/wenrulaogou/p/11982029.html