rogerxu / rogerxu.github.io

Roger Xu's Blog
2 stars 2 forks source link

鸟哥的Linux私房菜 基础学习篇 #240

Open rogerxu opened 5 years ago

rogerxu commented 5 years ago

鳥哥私房菜 - 鳥哥的首頁 (vbird.org)

鸟哥的Linux私房菜 基础学习篇 第四版 (豆瓣)

rogerxu commented 5 years ago

第2章 主机规划与磁盘分区

rogerxu commented 5 years ago

第4章 首次登录与在线求助

4.3 Linux系统的在线求助man page与info page

rogerxu commented 5 years ago

第5章 Linux的文件权限与目录配置

5.1 用户与用户组

5.2 Linux文件权限概念

5.3 Linux目录配置

FHS (Filesystem Hierarchy Standard)

/
|- /bin
|- /boot
|- /dev
|- /etc
|- /home
|- /lib
|- /lib64
|- /media
|- /mnt
|- /opt
|- /root
|- /run
|- /sbin - System Binary
|- /srv - Service
|- /tmp
|- /usr - Unix Software Resource
|- /var - Variable
rogerxu commented 5 years ago

第6章 Linux文件与目录管理

6.3 文件内容查看

6.4 文件与目录的默认权限与隐藏权限

umask

chattr

lsattr

file

6.5 命令与文件的查找

which - Locate a program in the user's path.

$ which -a executable

whereis - Locate the binary, source, and manual page files for a command.

$ whereis keyword

locate - Find filenames in the database.

$ locate pattern

find - Find files under the given directory tree.

$ find root_path -name '*.ext'
rogerxu commented 5 years ago

第7章 Linux磁盘与文件系统管理

7.1 认识Linux文件系统

7.1.1 磁盘组成与分区的复习

Sector Cylinder

7.1.3 Linux的ext2文件系统(inode)

inode

7.1.7 挂载点的意义(mount point)

7.1.9 XFS 文件系统简介

7.2 文件系统的简单操作

7.2.1 磁盘与目录的容量

df - display free disk space

$ df -h

du - display disk usage statistics

$ du -hs

7.2.2 硬链接与符号链接:ln

ln

7.3 磁盘的分区、格式化、检验与挂载

$ lsblk -f
$ blkid
$ parted /dev/sda print
rogerxu commented 4 years ago

第8章 文件与文件系统的压缩

8.3 打包命令:tar

$ tar [-z|-j|-J] [cv] [-f foo.tar.gz] filename... <== compress
$ tar [-z|-j|-J] [tv] [-f foo.tar.gz]             <== view
$ tar [-z|-j|-J] [xv] [-f foo.tar.gz] [-C dir]   <== decompress
rogerxu commented 4 years ago

第10章 认识与学习BASH

10.1 认识BASH这个Shell

type

$ type [-tpa] name
$ type ls
ls is aliased to `ls --color=auto'

$ type -t ls
alias

$ type -a ls
ls is aliased to `ls --color=auto'
ls is /usr/bin/ls

$ type cd
cd is a shell builtin

10.2 Shell的变量功能

echo

$ echo $PATH
$ echo ${PATH}

unset

$ unset name

env

$ env

set

$ set

export

$ env name

read

$ read -p 'Please enter: ' name
Please enter: abc
$ echo $name
abc

declare

$ declare -i sum=1+2
$ echo $sum
3

Set to environment variable

$ declare -x variable

Set to local variable

$ declare +x variable

Print attributes

$ declare -p variable
declare -i variable="450"

array

$ arr[1]=a
$ arr[2]=b
$ echo "${arr[1]}, ${arr[2]}"
a, b

ulimit

$ ulimit -a

Remove/replace variable value

image

Variable default value

image

$ var=${str:?"Value is empty"}
str: Value is empty

10.3 命令别名与历史命令

alias

$ alias lm='ls -al | more'

history

$ history
$ history 5

Execute the last command

$ !!

10.4 Bashshell的操作环境

image

10.5 数据流重定向

$ find /home -name .bashrc > list_right 2> list_error

Only display stdout

$ find /home -name .bashrc 2> /dev/null

Redirect stderr to stdout

$ find /home -name .bashrc > list_all 2>&1
$ find /home -name .bashrc &> list_all

Copy input.txt content to output.txt

$ cat > output.txt < input.txt

Input eof as end of input

$ cat > output.txt << "eof"
> This is a test.
> OK now stop
> eof
rogerxu commented 3 years ago

第11章 正则表达式与文件格式化处理

11.2 基础正则表达式

Special charactor class

grep

$ grep -n --color=auto -A3 -B2 'string' filename

sed

$ nl /etc/passwd | sed '2,5d'

11.3 扩展正则表达式

egrep

$ egrep -v '^$|^#' regular_express.txt

11.4 文件的格式化与相关处理

printf

awk

diff

patch

rogerxu commented 3 years ago

第12章 学习shell脚本

12.3 善用判断式

12.4 条件判断式

12.5 循环(loop)

rogerxu commented 2 years ago

第13章 Linux账号管理与ACL权限设置

13.1 Linux的账号与用户组

etc/passwd

etc/shadow

etc/group

13.2 账号管理

useradd

passwd

usermod

userdel

id

gpasswd

13.3 主机的详细权限规划:ACL的使用

setfacl

getfacl

13.4 用户身份切换

su

sudo

visudo

13.5 用户的特殊shell与PAM模块

/sbin/nologin

13.6 Linux主机上的用户信息传递

w

who

last

lastlog