botang 发表于 2019-4-28 10:46:13

课程第10次

sort 和uniq:
# sort -n 1.txt
1
3
3
6
20
------------------------------------------# sort -n 1.txt | uniq-c
      1 1
      2 3
      1 6
      1 20
------------------------
</blockquote></div><p>在二级命令处,进行多行标准输入:</p><p><div class="blockcode"><blockquote>#!/bin/sh

/u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus <<-EOF
conn / as sysdba
startup
exit
EOF
# read -p "Please input the value of A: " A< 4.txt
# echo $A
100
# ls
1.txt2.txt3.txt4.txt
# ls
1.txt2.txt3.txt4.txt
# ls >5.txt
# cat 5.txt
1.txt
2.txt
3.txt
4.txt
5.txt
# ls -l
total 20
-rw-r--r--. 1 root root11 Apr 28 08:14 1.txt
-rw-r--r--. 1 root root 224 Apr 28 08:26 2.txt
-rw-r--r--. 1 root root13 Apr 28 08:38 3.txt
-rw-r--r--. 1 root root   4 Apr 28 08:56 4.txt
-rw-r--r--. 1 root root30 Apr 28 09:00 5.txt
# ls
1.txt2.txt3.txt4.txt5.txt
# read B < 5.txt
# echo $B
1.txt
# B=$(cat 5.txt)
# echo $B
1.txt 2.txt 3.txt 4.txt 5.txt
#

注意空格:
# ls1.txtbotang.txt >7.txt   2>&1
# cat 7.txt
ls: cannot access botang.txt: No such file or directory
1.txt
# ls1.txtbotang.txt &>8.txt
# cat 8.txt
ls: cannot access botang.txt: No such file or directory
1.txt
# ls1.txtbotang.txt & >9.txt
19920
# ls: cannot access botang.txt: No such file or directory
1.txt

+Exit 2                  ls --color=auto 1.txt botang.txt






参考:



firewall-cmd --permanent --add-service=http
firewall-cmd --reload

<VirtualHost *:80>
DocumentRoot /var/www/html/station60/
ServerNamestation60.example.com
CustomLoglogs/station60.log combined
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /var/www/html/www60/
ServerNamewww60.example.com
CustomLoglogs/www60.log combined
</VirtualHost>

/etc/named.conf:
# /etc/named.conf
#
# This file should be used for all classes except RH320.
# Replaces: named.conf-isolated, named.conf-internet

########################################################################
#
#   Define the location of the zone files, clean daily,
#   and possibly specify forwarders.
#
########################################################################
// Define ACL(s) here
acl exampleNetwork { 192.168.0.0/24; };
acl crackerNetwork { 192.168.1.0/24; };
acl internal       { 127.0.0.1; 192.168.0.0/24; 192.168.1.0/24; };
acl bogusNets      { 0.0.0.0/8;
                     1.0.0.0/8;
                     2.0.0.0/8;
                     192.0.2.0/24;
                     224.0.0.0/3;
                     10.0.0.0/8;
                     172.16.0.0/12;
};
options {
      // Where do our zone files live?
      directory "/var/named";

      cleaning-interval 1440;
      // Use the ACL to say who can query us
      allow-query { internal; };

      // Allow recursion for localnets( not really needed becauses of above )
      allow-recursion { internal; };

      // Allow zone transfers only to exampleNetwork ACL
      allow-transfer { exampleNetwork; };

      // Blackhole illegal addresses commonly used for spoofing
      // This is also redundant but we are showing off
      blackhole { bogusNets; };

      // If you're behind a firewall but have Internet access, you
      // might need to run DNS lookups through another name server
      // that can see through it, to resolve outside hosts.
      // The commented-out line below works for Meridian.
      # forwarders { 192.168.22.250; };

      // Get rid of annoying reminder of default that is, in fact, the
      // opposite of what man named.conf would have you believe.
      auth-nxdomain no;
};
// Magic to make rndc work
include "/etc/rndc.key";
controls {
      inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

#########################################################################
#
#   Help out root nameservers; take responsibility for localhost.
#
#########################################################################
// file names are arbitrary and can be anything
// RFC 1033 uses .zone in their examples and so shall we
zone "localhost" {
      type master;
      file "localhost.zone";
};

zone "0.0.127.in-addr.arpa" {
      type master;
      file "127.0.0.zone";
};

########################################################################
#
#   Provide a hint to the root nameservers
#
########################################################################

zone "." {
      type hint;
      file "named.ca";
};


#########################################################################
#
#   Master nameserver for example.com and 192.168.0/24
#
#########################################################################

zone "example.com" {
      type master;
      file "example.com.zone";
      // The forwarders line below turns off forwarding, if specified
      // above, for delegated subdomains (domainXX.example.com, etc).
      // (So we talk directly to the server for the zone we delegated,
      // rather than asking the forwarder to do it for us.)
      forwarders {};
};

zone "0.168.192.in-addr.arpa" {
      type master;
      file "192.168.0.zone";
      forwarders {};
};

#########################################################################
#
#    Master nameserver for cracker.org and 192.168.1/24
#
#########################################################################

zone "cracker.org" {
      type master;
      file "cracker.org.zone";
      forwarders{};
};

zone "1.168.192.in-addr.arpa" {
      type master;
      file "192.168.1.zone";
      forwarders{};
};

zone "something.net" {
      type master;
      file "something.net.zone";
      // The forwarders line below turns off forwarding, if specified
      // above, for delegated subdomains (domainXX.example.com, etc).
      // (So we talk directly to the server for the zone we delegated,
      // rather than asking the forwarder to do it for us.)
      forwarders {};
};

/var/named/chroot/var/named/example.com.zone:
; Specify the time-to-live( TTL ) for the zone
$TTL 86400; 1 Day ( we could have used 1D )

; Begin Start Of Authority resource record
example.com. INSOA station90.example.com. root.station90.example.com. (
                              2003040100      ; serial number
                              1H               ; refresh slave
                              5M               ; retry query
                              1W               ; expire
                              1M               ; negative TTL
)

; Specify our name servers
; !!WARNING: You can not use CNAMEs for RDATA here !!
; owner                        TTL      CLtype                RDATA
@                              INNS                station90.example.com.

; Specify our mail exchangers
; !!WARNING: You can not use CNAMEs for RDATA here !!
; owner                        TTL      CLtype          RDATA
@                              INMX          10station90.example.com.

; This is broken and against RFC but must be done to placate the masses
; owner                        TTL      CLtype      RDATA
example.com.                        INA                192.168.0.90

; List our CNAME records ( aliases ) here
; owner                        TTL      CLtype      RDATA
mail.example.com.      3600         INCNAME      server1.example.com.
kerberos.example.com.      3600      INCNAME      server1.example.com.

; List our A records ( hosts ) here
; owner                        TTL      CLtype      RDATA
station1.example.com.                INA                192.168.0.1
station2                        INA                192.168.0.2
station3                        INA                192.168.0.3
station4                        INA                192.168.0.4
station5                        INA                192.168.0.5
station6                        INA                192.168.0.6
station7                        INA                192.168.0.7
station8                        INA                192.168.0.8
station9                        INA                192.168.0.9
station10                        INA                192.168.0.10
station11                        INA                192.168.0.11
station12                        INA                192.168.0.12
station13                        INA                192.168.0.13
station14                        INA                192.168.0.14
station15                        INA                192.168.0.15
station16                        INA                192.168.0.16
station17                        INA                192.168.0.17
station18                        INA                192.168.0.18
station19                        INA                192.168.0.19
station20                        INA                192.168.0.20
server1                              INA                192.168.0.254

; Okay, my fingers are getting tired.BIND 8.1 and BIND 9.1 and later supports
; a shortcut.$GENERATE creates a record for each value in the
; numerical range specified in the first argument, replacing any $
; in the template with the current value of the iterator.

; Set up the rest of the station records.

$GENERATE 21-100 station[      DISCUZ_CODE_9      ]nbsp;                A 192.168.0.$

; Set up CNAMEs for www1.example.com and so on.

$GENERATE 1-100      www[      DISCUZ_CODE_28      ]nbsp;                     CNAME station$

; Delegate owner1.example.com and so on to the individual stations.

$GENERATE 1-100      domain$.example.com.      NS station$.example.com.
$GENERATE 1-100      hierarchy$.example.com.      NS station$.example.com.

; The $GENERATE shortcut is normally used to simplify delegating
; subnets on a non-octet boundary.(This is for non-traditional
; network sizes -- everything but /8, /16, and /24 subnets.)

; For the RHEL5.1 RH253 changes:
$GENERATE 101-200 server$.example.com.      A 192.168.0.$
$GENERATE 101-200 domain$.example.com.      NS server$.example.com.
$GENERATE 101-200 www[      DISCUZ_CODE_28      ]nbsp;                     CNAME server$
/var/named/chroot/var/named/192.168.0.zone:
; Specify the time-to-live( TTL ) for the zone
$TTL 86400; 1 Day ( we could have used 1D )

; Begin Start Of Authority resource record
0.168.192.IN-ADDR.ARPA. INSOA station90.example.com. root.station90.example.com.(
                              2003040100      ; serial number
                              1H               ; refresh slave
                              5M               ; retry query
                              1W               ; expire
                              1M               ; negative TTL
)

; Specify our name servers
; !!WARNING: You can not use CNAMEs for RDATA here !!
; owner                        TTL      CLtype      RDATA
@                              INNS          station90.example.com.

; List our PTR records ( rev lookup ) here
; owner                        TTL      CLtype      RDATA
1.0.168.192.IN-ADDR.ARPA.      INPTR                station1.example.com.
2                              INPTR                station2.example.com.
3                              INPTR                station3.example.com.
4                              INPTR                station4.example.com.
5                              INPTR                station5.example.com.
6                              INPTR                station6.example.com.
7                              INPTR                station7.example.com.
8                              INPTR                station8.example.com.
9                              INPTR                station9.example.com.
10                              INPTR                station10.example.com.
11                              INPTR                station11.example.com.
12                              INPTR                station12.example.com.
13                              INPTR                station13.example.com.
14                              INPTR                station14.example.com.
15                              INPTR                station15.example.com.
16                              INPTR                station16.example.com.
17                              INPTR                station17.example.com.
18                              INPTR                station18.example.com.
19                              INPTR                station19.example.com.
20                              INPTR                station20.example.com.
21                              INPTR                station21.example.com.
22                              INPTR                station22.example.com.
23                              INPTR                station23.example.com.
24                              INPTR                station24.example.com.
25                              INPTR                station25.example.com.
26                              INPTR                station26.example.com.
27                              INPTR                station27.example.com.
28                              INPTR                station28.example.com.
29                              INPTR                station29.example.com.
30                              INPTR                station30.example.com.
31                              INPTR                station31.example.com.
32                              INPTR                station32.example.com.
33                              INPTR                station33.example.com.
34                              INPTR                station34.example.com.
35                              INPTR                station35.example.com.
36                              INPTR                station36.example.com.
37                              INPTR                station37.example.com.
38                              INPTR                station38.example.com.
39                              INPTR                station39.example.com.
40                              INPTR                station40.example.com.
41                              INPTR                station41.example.com.
42                              INPTR                station42.example.com.
43                              INPTR                station43.example.com.
44                              INPTR                station44.example.com.
45                              INPTR                station45.example.com.
46                              INPTR                station46.example.com.
47                              INPTR                station47.example.com.
48                              INPTR                station48.example.com.
49                              INPTR                station49.example.com.
50                              INPTR                station50.example.com.
51                              INPTR                station51.example.com.
52                              INPTR                station52.example.com.
53                              INPTR                station53.example.com.
54                              INPTR                station54.example.com.
55                              INPTR                station55.example.com.
56                              INPTR                station56.example.com.
57                              INPTR                station57.example.com.
58                              INPTR                station58.example.com.
59                              INPTR                station59.example.com.
60                              INPTR                station60.example.com.
61                              INPTR                station61.example.com.
62                              INPTR                station62.example.com.
63                              INPTR                station63.example.com.
64                              INPTR                station64.example.com.
65                              INPTR                station65.example.com.
66                              INPTR                station66.example.com.
67                              INPTR                station67.example.com.
68                              INPTR                station68.example.com.
69                              INPTR                station69.example.com.
70                              INPTR                station70.example.com.
71                              INPTR                station71.example.com.
72                              INPTR                station72.example.com.
73                              INPTR                station73.example.com.
74                              INPTR                station74.example.com.
75                              INPTR                station75.example.com.
76                              INPTR                station76.example.com.
77                              INPTR                station77.example.com.
78                              INPTR                station78.example.com.
79                              INPTR                station79.example.com.
80                              INPTR                station80.example.com.
81                              INPTR                station81.example.com.
82                              INPTR                station82.example.com.
83                              INPTR                station83.example.com.
84                              INPTR                station84.example.com.
85                              INPTR                station85.example.com.
86                              INPTR                station86.example.com.
87                              INPTR                station87.example.com.
88                              INPTR                station88.example.com.
89                              INPTR                station89.example.com.
90                              INPTR                station90.example.com.
91                              INPTR                station91.example.com.
92                              INPTR                station92.example.com.
93                              INPTR                station93.example.com.
94                              INPTR                station94.example.com.
95                              INPTR                station95.example.com.
96                              INPTR                station96.example.com.
97                              INPTR                station97.example.com.
98                              INPTR                station98.example.com.
99                              INPTR                station99.example.com.
100                              INPTR                station100.example.com.

; For the RHEL5.1 changes
101                              INPTR                server101.example.com.
102                              INPTR                server102.example.com.
103                              INPTR                server103.example.com.
104                              INPTR                server104.example.com.
105                              INPTR                server105.example.com.
106                              INPTR                server106.example.com.
107                              INPTR                server107.example.com.
108                              INPTR                server108.example.com.
109                              INPTR                server109.example.com.
110                              INPTR                server110.example.com.
111                              INPTR                server111.example.com.
112                              INPTR                server112.example.com.
113                              INPTR                server113.example.com.
114                              INPTR                server114.example.com.
115                              INPTR                server115.example.com.
116                              INPTR                server116.example.com.
117                              INPTR                server117.example.com.
118                              INPTR                server118.example.com.
119                              INPTR                server119.example.com.
120                              INPTR                server120.example.com.
121                              INPTR                server121.example.com.
122                              INPTR                server122.example.com.
123                              INPTR                server123.example.com.
124                              INPTR                server124.example.com.
125                              INPTR                server125.example.com.
126                              INPTR                server126.example.com.
127                              INPTR                server127.example.com.
128                              INPTR                server128.example.com.
129                              INPTR                server129.example.com.
130                              INPTR                server130.example.com.
131                              INPTR                server131.example.com.
132                              INPTR                server132.example.com.
133                              INPTR                server133.example.com.
134                              INPTR                server134.example.com.
135                              INPTR                server135.example.com.
136                              INPTR                server136.example.com.
137                              INPTR                server137.example.com.
138                              INPTR                server138.example.com.
139                              INPTR                server139.example.com.
140                              INPTR                server140.example.com.
141                              INPTR                server141.example.com.
142                              INPTR                server142.example.com.
143                              INPTR                server143.example.com.
144                              INPTR                server144.example.com.
145                              INPTR                server145.example.com.
146                              INPTR                server146.example.com.
147                              INPTR                server147.example.com.
148                              INPTR                server148.example.com.
149                              INPTR                server149.example.com.
150                              INPTR                server150.example.com.
151                              INPTR                server151.example.com.
152                              INPTR                server152.example.com.
153                              INPTR                server153.example.com.
154                              INPTR                server154.example.com.
155                              INPTR                server155.example.com.
156                              INPTR                server156.example.com.
157                              INPTR                server157.example.com.
158                              INPTR                server158.example.com.
159                              INPTR                server159.example.com.
160                              INPTR                server160.example.com.
161                              INPTR                server161.example.com.
162                              INPTR                server162.example.com.
163                              INPTR                server163.example.com.
164                              INPTR                server164.example.com.
165                              INPTR                server165.example.com.
166                              INPTR                server166.example.com.
167                              INPTR                server167.example.com.
168                              INPTR                server168.example.com.
169                              INPTR                server169.example.com.
170                              INPTR                server170.example.com.
171                              INPTR                server171.example.com.
172                              INPTR                server172.example.com.
173                              INPTR                server173.example.com.
174                              INPTR                server174.example.com.
175                              INPTR                server175.example.com.
176                              INPTR                server176.example.com.
177                              INPTR                server177.example.com.
178                              INPTR                server178.example.com.
179                              INPTR                server179.example.com.
180                              INPTR                server180.example.com.
181                              INPTR                server181.example.com.
182                              INPTR                server182.example.com.
183                              INPTR                server183.example.com.
184                              INPTR                server184.example.com.
185                              INPTR                server185.example.com.
186                              INPTR                server186.example.com.
187                              INPTR                server187.example.com.
188                              INPTR                server188.example.com.
189                              INPTR                server189.example.com.
190                              INPTR                server190.example.com.
191                              INPTR                server191.example.com.
192                              INPTR                server192.example.com.
193                              INPTR                server193.example.com.
194                              INPTR                server194.example.com.
195                              INPTR                server195.example.com.
196                              INPTR                server196.example.com.
197                              INPTR                server197.example.com.
198                              INPTR                server198.example.com.
199                              INPTR                server199.example.com.
200                              INPTR                server200.example.com.


254                              INPTR                server1.example.com.

; Note that we're not actually delegating the students authority to
; manage their IP addresses...so their server and our server will
; disagree on the correct reverse lookup for their IP address, and
; we're both claiming to be authoritative.Naughty of us.:)We
; have to do this, since their server won't be there most of the
; time to delegate to.Doesn't matter for ownerXX.example.com.





页: [1]
查看完整版本: 课程第10次