linux 系统管理【1】
来源:互联网 发布:阴司守门人网络剧剧照 编辑:程序博客网 时间:2024/06/05 16:42
[1]5中Linux发行版本
---ReadHat Enterprise Linux ES
---Fedora Core
---SUSE Linux Enterprise
---Debian GNU/linux
---Ubuntun
[2]$grep 查找命令
RFC -->request for commnets请求评议
linux手册分9节
1->用户命令和应用程序
2->系统调用和内核出错代码
3->库调用
4->设备驱动程序和网络协议
5->标准文件格式
6->游戏和演示
7->各种文件和文档
8->系统管理命令
9->少见隐蔽的内核规范和接口
man内容路径->/usr/share/man/man1=>man8(ubuntu)
以gzip压缩(man命令知道如何当场将他们解压缩)
man格式路径->/var/cache/man/cat1=>cat8(ubuntu)
[3]$manpath
$cat /etc/manpath.config
#
#---------------------------------------------------------
# Program definitions. These are commented out by default as the value
# of the definition is already the default. To change: uncomment a
# definition and modify it.
#
#DEFINE pager pager -s
#DEFINE cat cat
#DEFINE tr tr '/255/267/264/327' '/055/157/047/170'
#DEFINE grep grep
#DEFINE troff groff -mandoc
#DEFINE nroff nroff -mandoc
#DEFINE eqn eqn
#DEFINE neqn neqn
#DEFINE tbl tbl
#DEFINE col col
#DEFINE vgrind vgrind
#DEFINE refer refer
#DEFINE grap grap
#DEFINE pic pic -S
#
#DEFINE compressor gzip -c7
#---------------------------------------------------------
# Misc definitions: same as program definitions above.
#
#DEFINE whatis_grep_flags -i
#DEFINE apropos_grep_flags -iEw
#DEFINE apropos_regex_grep_flags -iE
#---------------------------------------------------------
# Section names. Manual sections will be searched in the order listed here;
# the default is 1, n, l, 8, 3, 0, 2, 5, 4, 9, 6, 7. Multiple SECTION
# directives may be given for clarity, and will be concatenated together in
# the expected way.
# If a particular extension is not in this list (say, 1mh), it will be
# displayed with the rest of the section it belongs to. The effect of this
# is that you only need to explicitly list extensions if you want to force a
# particular order. Sections with extensions should usually be adjacent to
# their main section (e.g. "1 1mh 8 ...").
#
SECTION 1 n l 8 3 2 3posix 3pm 3perl 5 4 9 6 7
#
#---------------------------------------------------------
# Range of terminal widths permitted when displaying cat pages. If the
# terminal falls outside this range, cat pages will not be created (if
# missing) or displayed.
#
#MINCATWIDTH 80
#MAXCATWIDTH 80
#
# If CATWIDTH is set to a non-zero number, cat pages will always be
# formatted for a terminal of the given width, regardless of the width of
# the terminal actually being used. This should generally be within the
# range set by MINCATWIDTH and MAXCATWIDTH.
#
#CATWIDTH 0
#
#---------------------------------------------------------
# Flags.
# NOCACHE keeps man from creating cat pages.
#NOCACHE
..........................................................................................................................................................................................
---[man命令用法]
$man -k translate
...............................................................................................................
---[whereis / which命令用法]
$which man=======>使用shell的which命令来搜索路径
/usr/bin/man
...................................................................................................................
$whereis man=======>显示系统完整的目录结构和shell搜索路径无关
man: /usr/bin/man /usr/local/man /usr/share/man /usr/share/man/man1/man.1.gz /usr/share/man/man7/man.7.gz
..........................................................................................................................................................................................
---[locate命令用法]
$locate man========>通过预先已经建立好的文件系统索引来在查询含有该查询单词的目录
locate的数据库由update命令在每天晚上重新生成,这条命令有cron来运行
...................................................................................................................
$rpm -q python========>(redhat)
$apt-get install python=======>(ubuntu)
查询是否存在python rpm 软件包
...................................................................................................................
ls --help=======>不是一个“独立”的工具,是命令的选项(参数)
man ls=========|若man页中介绍在info中也有体现,那么man页中会有参考“info页更多详细内容”的字样
|====>man显示的非GNU的信息是唯一的,info显示的GNU信息是man内容副本补充。
info ls=========|显示比man更为完整,以及最新的GUN工具信息
...................................................................................................................
引导==>bootstrapping
启动==>start up a computer
...................................................................................................................
进程init的PID(进程号)为1
bootstrapping的过程==>
--------1初始化内核
内核本身就是一个程序,系统bootstrapping时第一任务就是把Linux内核本身这个程序加载到内存中,一边执行它。
内核路径名(Ubuntu)/boot/vmlinuz
加载过程:1.系统Rom(只读存储器,固化存储器)把一个小的引导程序从磁盘载入到内存
2.将这个引导程序加载到内核中
内核执行内存检测来确定RAM内存可以。内核中一些内部数据结构以静态方式分配器内存,当内核启动时,它就为自己划分 一块固定大小的内存空间,用户级进程不能使用。
-------2配置硬件
执行内核的第一任务之一就是检查机器的环境的硬件,内核开始执行时候,他试图找到并初始化以及告诉它的每一个设备。
-------3内核线程
内核在用户空间创建几个自发的进程,这些进程不是通过系统正规的fork机制创建的。
自发进程的数量和特性随系统的不同而不同。
Linux上看不到PID为0的进程。启动init(PID为1)进程。
--------4操作员干预(仅仅用于手工引导)
输入用户名和密码
--------5执行启动脚本
启动脚本就是普通的Shell脚本,是由init根据一定的算法来选择并运行它们的。
--------6多用户运行
init生成getty进程。getty进程监听终端或者控制台。
...................................................................................................................
bootstrapping的流程如下:
PC上,初始化的引导代码叫BIOS(basic input/output system基本输入/输出系统)
PC上有多种级别的BIOS:
1.用于机器本身
2.用于显示卡
3.用于SCSI卡(如果系统有SCSI卡)
4.其他外部设备如网卡
...................................................................................................................
GRUB(Grand Unified Boot loader)
...................................................................................................................
init运行级别:
0:完全关闭系统级别
1/S:单用户模式
2/3/4/5:多用户级别
6:重新引导(reboot)级别
ubuntu的脚本管理程序update-rc.d
运行2、3、4、5启动sshd, 运行0/1/6停止它=====>$sudo /usr/sbin/update-rc.d sshd start 2345 stop 456
...................................................................................................................
shutdown===>停止或者重启系统最安全、考虑最周到的方式
$shutdown -h 12:00:00 "shudown "
$shutdown -h +12 ”shutdown"
...................................................................................................................
$halt====>关闭系统所需的基本任务 让机器停止
$halt -n不执行sync调用
$poweroff == $halt
$reboot=====>快速重启
$reboot -n不执行sync调用
$telinit 1/2/3/4/5/6让init进入特定的运行级别
...................................................................................................................
user identification numbers(UID) ---------->映射到/etc/passwd
group identification numbers(GID) ---------->映射到/etc/group
...................................................................................................................
访问root
$su
$/bin/su(推荐使用)
...................................................................................................................
$sudo与$su的比较
$sudo比$su以root登陆系统快
............................................................................................................
PID:进程ID号
PPID:父PID=======>当一个进程被克隆时候,原来的进程叫做父进程,克隆的新进程叫子进程。
............................................................................................................
UID:真实的ID
EUID:有效地ID=======>用来确定进程在任何给定的时刻对哪些资源和文件具有访问权限
一般而言==>UID和EUID是一样的
特殊====>setuid程序
saved UID=====>进程EUID的副本,除非进程采取措施删除这个保存下来的UID,否则它就留下来,作为UID或者EUID来使用
FSUID======>控制着对文件系统权限的判断
............................................................................................................
GID:进程的真实的组标志号
EGID:有效地GID
............................................................................................................
信号:是系统进程的中断请求。
---在进程间发送信号
---在终端驱动程序发送信号去终止、中断或挂起进程
............................................................................................................
进程的状态
Runnable
Sleeping
Zombie------->进程试图消亡
Stopped ----->进程被挂起(不执行)
............................................................................................................
$ps aux
$ps lax
USER===>进程属主的用户名
PID====>进程ID
%CPU==>该进程正在使用的CPU百分比
%MEM==>该进程正在使用的实际内存百分比
VSZ====>进程的虚拟大小
RSS====>内存中页的数量
TTY====>控制终端的ID
STAT===>当前进程的状态
R---->可运行
D---->在等待磁盘
S---->在睡眠(<20s)
T---->被跟踪或者被停止
Z---->僵进程
附加标志:
W---->进程被交换
<=--->进程拥有比普通进程更高的优先级
N----->进程拥有比普通进程更低的优先级
L----->有些页面被锁在内存中
s----->进程是会话的先导进程
START===>启动进程的时间
TIME====>进程已经消耗掉的CPU时间
COMMAND=>命令的名称和参数
NI======>谦让值
WCHAN===>正在等待的资源
............................................................................................................
$find /home -size +1M -print0 | xargs -0 ls -l
将/home 目录中文件大于1M的文件列出来
............................................................................................................
$fuser -mv /usr
查看系统上所有用户的进程
............................................................................................................
Linux文件类型7种类:
普通文件--------------------------->-
目录-------------------------------->d
字符设备文件----------------------->c
块设备文件------------------------->b
本地域套接口----------------------->s
有名管道(FIFO)----------------->p
符号链接---------------------------->l
$ls -ld========>用来查看现有文件的类型
- linux 系统管理【1】
- linux系统管理(1)---man
- Linux系统管理入门(1)
- 【系统管理】LINUX系统管理相关
- RedHat Linux 系统管理(1-4)
- Linux系统管理
- linux系统管理
- linux系统管理
- Linux系统管理
- linux系统管理
- 【linux】系统管理
- LINux系统管理
- linux系统管理
- linux系统管理
- linux系统管理
- linux 系统管理
- Linux系统管理
- Linux系统管理
- Text ProgressBar
- 学习VB
- HDU_3687
- 《深入理解Linux内核》--第五章 内核同步:读书笔记
- 驱动程序中使用CPPUnit
- linux 系统管理【1】
- Eclipse 3.5 RCP项目发布
- BOOL与bool区别
- 2010--11--12
- 这个 对于 程序该学什么语言 很有指导意义
- DXT纹理压缩
- Cygwin和VC++一起使用
- 彼得·德鲁克
- 留着这些话激励自己