shell script 8-7

And redirection pipe character

A redirection --tr

= Program instructions (commands) + data (provided by the variable)

Redirect divided into three categories: redirect standard input, standard output redirection, to redirect error

 

Data Input: keyboard input ----- standard, but not the only way to enter

Standard input: cases useradd cqy; | passwd --stdin "cqy" (add a password to the user cqy)

For example: function add user useradd.sh user.txt text document 1000 users

 

 

Data output: Display ---- standard output, but the output is not the only way

  Ls /etc/ >a.txt

fd file identifier 0-9, 0 is used (standard output) is defined, 1 (standard input), 2 (O error (standard error))

Virtual File System VFS, used for translation, file system format ext2, ext2, reiserfs, FAT, NTFS, iso9660 and so on.

 

Common redirection symbols

1, the standard output:> dangerous] [Redirect cover (set -C (cover off redirection function, set + C plus coverage redirection function;> | forced redirection)) to view the environment scalar SET C

                        >> append redirection (not covered)

        

2, the input criteria: <tr (replace file content) tr set1 [set2] <file.txt

         

       << The multiple rows of data simultaneously input

Cat >> a.txt<<EOF

  >1

>2

>3

>EOF 

3, the error output: 2>

                     2>>

Not to output the contents, only the output state;

Ls /etc/ > /dev/null 2> /dev/null

Ls / etc / &> / dev / null (in front of the correct result regardless of whether or not, the result will be redirected to / dev / null in)

Second, the pipeline -tee

管道符就是前一个命令的执行结果交给后一个命令来执行

【Linux的思想:结合小功能实现大功能】

 

3、文本处理工具-wc,cut,sort,uniq

Tee :一路输入 两路输出

Tee /tmp/tee.out   //如果没有文件会创建,默认如果文件存在有内容时,会覆盖;

练习:

将/etc/passwd文件中的前五行内容转换为大写后保存至/tmp/passwd.out文件中

 

将登陆至当前系统上用户信息汇总的后3位信息转换为大写后保存至/tmp/who.out

who | tail -3 | cut -d’  ‘ -f1 |tr [[:lower:]] [[:upper:]] | tee /tmp/who.out

 

 

Windows server

活动目录(域【Windows server的精髓】)

域(domain):将网络中多台计算机逻辑上组织到一起,进行集中管理,这种区别于工作组的逻辑环境叫做域(有服务器和客户端角色之分,服务器用来管理客户端)

域是组织与存储资源的核心管理单元

工作组:所有的主机都是独立的,不存在管理关系,没有角色之分

域控制器(Domain Controller,简称DC):在域中,至少有一台DC,一般情况下一个域会有多台DC,域控制器中保存着整个域的用户账号和安全数据库,安装有Active Directory的主机,可以对资源进行统一的管理

活动目录(Active Director,AD):是存储网络对象信息并使网络用户使用这些数据的方法(相当于数据库)

活动目录特点:集中管理

便捷的网络资源访问(用户一次登录就可以访问整个网络资源,网络资源主要包含大量对象(用户账户,组,共享文件夹,打印机等))

域树(Tree):具有连续性的域名空间的多个域

林(Forest):林由一个或多个域树组成

 

组织单位(OU):组织单位是活动目录中最小的管理单元,OU可以建立子对象

利用OU可以建立管理模型

安装域控制器的条件:安装者必须具有本地管路员权限

          操作系统版本必须满足条件(Windows Server 2008除web版外都满足)

          本地磁盘至少有一个分区是NTFS文件系统

          有TCP/IP设置(IP地址、子网掩码等)

          有相应的DNS服务器支持

          有足够的可用空间

Guess you like

Origin www.cnblogs.com/cqyyyyy/p/11317277.html