系统版本:
[root@centos71d1 ~]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root@centos71d1 ~]# uname -r
3.10.0-229.el7.x86_64
以下演示LVM的基本操作:
1. PV的创建、查看、移除
2. VG的创建、查看、扩展、缩减
3. LV的创建、查看、扩展、缩减、快照、移除
继续阅读“LVM的基本操作”
网络·源于生活的热情
系统版本:
[root@centos71d1 ~]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root@centos71d1 ~]# uname -r
3.10.0-229.el7.x86_64
以下演示LVM的基本操作:
1. PV的创建、查看、移除
2. VG的创建、查看、扩展、缩减
3. LV的创建、查看、扩展、缩减、快照、移除
继续阅读“LVM的基本操作”
系统版本:
[root@centos67d1 ~]# cat /etc/redhat-release
CentOS release 6.7 (Final)
[root@centos67d1 ~]# uname -r
2.6.32-573.el6.x86_64
[root@centos71d1 ~]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root@centos71d1 ~]# uname -r
3.10.0-229.el7.x86_64
系统版本:
[root@node1 ~]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root@node1 ~]# uname -r
3.10.0-229.el7.x86_64
实时查找工具,通过遍历指定起始路径下文件系统层级结构完成文件查找。
继续阅读“find命令详解”
系统版本:
[root@node1 ~]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root@node1 ~]# uname -r
3.10.0-229.el7.x86_64
创建用户。
注:创建用户时的许多默认设定,由配置文件/etc/login.defs定义。
语法:
useradd [options] LOGIN
系统版本:
[root@node1 ~]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root@node1 ~]# uname -r
3.10.0-229.el7.x86_64
[root@node1 ~]# who
root tty1 2018-06-08 12:24
root pts/0 2018-06-08 10:58 (192.168.6.88)
[root@node1 ~]# who | cut -d' ' -f1 | uniq
or [root@node1 ~]# who | cut -d' ' -f1 | sort -u
root
系统版本:
[root@node1 ~]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root@node1 ~]# uname -r
3.10.0-229.el7.x86_64
示例:
[root@node1 network-scripts]# cd ~
[root@node1 ~]#
系统版本:
[root@node1 ~]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root@node1 ~]# uname -r
3.10.0-229.el7.x86_64
bash通过状态返回值来输出命令执行的状态结果,如成功,输出“0”值;失败,输出“1”到“255”之间的一个值。
命令执行完成之后,其状态返回值保存在bash的特殊变量$?
中。
示例:
[root@node1 ~]# ls
anaconda-ks.cfg
[root@node1 ~]# echo $?
0
[root@node1 ~]# ls /etcc
ls: cannot access /etcc: No such file or directory
[root@node1 ~]# echo $?
2
[root@node1 ~]# lsss /etc
-bash: lsss: command not found
[root@node1 ~]# echo $?
127
系统版本:
[root@node1 ~]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root@node1 ~]# uname -r
3.10.0-229.el7.x86_64
列出指定目录下的内容。
Filesystem Hierarchy Standard (FHS):重点在于规范每个特定的目录下应该要放置什么数据。这样做好处是,Linux操作系统能够在既有的面貌下(目录架构不变)发展出开发者想要的独特风格。
系统有很多放置执行文件的目录,但/bin比较特殊,因为/bin放置的是在单人维护模式下能够被操作的指令。 在/bin底下的指令可以被root与一般账号所使用,主要有:cat,chmod,chown,date,mv,mkdir,cp,bash等常用的命令。
Linux 中命令类型分为内部命令和外部命令。
使用type
命令判断内部和外部命令,示例如下:
[root@centos7 ~]# type cd
cd is a shell builtin
#cd是shell的内置命令
[root@centos7 ~]# type passwd
passwd is /usr/bin/passwd
#passwd命令存放在/usr/bin/passwd路径下