Bo's Oracle Station

查看: 1809|回复: 0

课程第10次

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2019-4-28 10:46:13 | 显示全部楼层 |阅读模式
sort 和uniq:
[root@station60 labs]# sort -n 1.txt
1
3
3
6
20
------------------------------------------
[root@station60 labs]# sort -n 1.txt | uniq  -c
      1 1
      2 3
      1 6
      1 20
------------------------

  1. </blockquote></div><p>在二级命令处,进行多行标准输入:</p><p><div class="blockcode"><blockquote>#!/bin/sh

  2. /u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus <<-EOF
  3. conn / as sysdba
  4. startup
  5. exit
  6. EOF
复制代码
  1. [root@station60 labs]# read -p "Please input the value of A: " A  < 4.txt
  2. [root@station60 labs]# echo $A
  3. 100
  4. [root@station60 labs]# ls
  5. 1.txt  2.txt  3.txt  4.txt
  6. [root@station60 labs]# ls
  7. 1.txt  2.txt  3.txt  4.txt
  8. [root@station60 labs]# ls >  5.txt
  9. [root@station60 labs]# cat 5.txt
  10. 1.txt
  11. 2.txt
  12. 3.txt
  13. 4.txt
  14. 5.txt
  15. [root@station60 labs]# ls -l
  16. total 20
  17. -rw-r--r--. 1 root root  11 Apr 28 08:14 1.txt
  18. -rw-r--r--. 1 root root 224 Apr 28 08:26 2.txt
  19. -rw-r--r--. 1 root root  13 Apr 28 08:38 3.txt
  20. -rw-r--r--. 1 root root   4 Apr 28 08:56 4.txt
  21. -rw-r--r--. 1 root root  30 Apr 28 09:00 5.txt
  22. [root@station60 labs]# ls
  23. 1.txt  2.txt  3.txt  4.txt  5.txt
  24. [root@station60 labs]# read B < 5.txt
  25. [root@station60 labs]# echo $B
  26. 1.txt
  27. [root@station60 labs]# B=$(cat 5.txt)
  28. [root@station60 labs]# echo $B
  29. 1.txt 2.txt 3.txt 4.txt 5.txt
  30. [root@station60 labs]#
复制代码

注意空格:
  1. [root@station60 labs]# ls  1.txt  botang.txt >7.txt   2>&1
  2. [root@station60 labs]# cat 7.txt
  3. ls: cannot access botang.txt: No such file or directory
  4. 1.txt
  5. [root@station60 labs]# ls  1.txt  botang.txt &>8.txt
  6. [root@station60 labs]# cat 8.txt
  7. ls: cannot access botang.txt: No such file or directory
  8. 1.txt
  9. [root@station60 labs]# ls  1.txt  botang.txt & >9.txt
  10. [1] 19920
  11. [root@station60 labs]# ls: cannot access botang.txt: No such file or directory
  12. 1.txt

  13. [1]+  Exit 2                  ls --color=auto 1.txt botang.txt
复制代码






参考:



  1. firewall-cmd --permanent --add-service=http
  2. firewall-cmd --reload
复制代码

  1. <VirtualHost *:80>
  2. DocumentRoot /var/www/html/station60/
  3. ServerName  station60.example.com
  4. CustomLog  logs/station60.log combined
  5. </VirtualHost>

  6. <VirtualHost *:80>
  7. DocumentRoot /var/www/html/www60/
  8. ServerName  www60.example.com
  9. CustomLog  logs/www60.log combined
  10. </VirtualHost>
复制代码

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

  5. ########################################################################
  6. #
  7. #   Define the location of the zone files, clean daily,
  8. #   and possibly specify forwarders.
  9. #
  10. ########################################################################
  11. // Define ACL(s) here
  12. acl exampleNetwork { 192.168.0.0/24; };
  13. acl crackerNetwork { 192.168.1.0/24; };
  14. acl internal       { 127.0.0.1; 192.168.0.0/24; 192.168.1.0/24; };
  15. acl bogusNets      { 0.0.0.0/8;
  16.                      1.0.0.0/8;
  17.                      2.0.0.0/8;
  18.                      192.0.2.0/24;
  19.                      224.0.0.0/3;
  20.                      10.0.0.0/8;
  21.                      172.16.0.0/12;
  22. };
  23. options {
  24.         // Where do our zone files live?
  25.         directory "/var/named";

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

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

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

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

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

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

  50. #########################################################################
  51. #
  52. #   Help out root nameservers; take responsibility for localhost.
  53. #
  54. #########################################################################
  55. // file names are arbitrary and can be anything
  56. // RFC 1033 uses .zone in their examples and so shall we
  57. zone "localhost" {
  58.         type master;
  59.         file "localhost.zone";
  60. };

  61. zone "0.0.127.in-addr.arpa" {
  62.         type master;
  63.         file "127.0.0.zone";
  64. };

  65. ########################################################################
  66. #
  67. #   Provide a hint to the root nameservers
  68. #
  69. ########################################################################

  70. zone "." {
  71.         type hint;
  72.         file "named.ca";
  73. };


  74. #########################################################################
  75. #
  76. #   Master nameserver for example.com and 192.168.0/24
  77. #
  78. #########################################################################

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

  88. zone "0.168.192.in-addr.arpa" {
  89.         type master;
  90.         file "192.168.0.zone";
  91.         forwarders {};
  92. };

  93. #########################################################################
  94. #
  95. #    Master nameserver for cracker.org and 192.168.1/24
  96. #
  97. #########################################################################

  98. zone "cracker.org" {
  99.         type master;
  100.         file "cracker.org.zone";
  101.         forwarders{};
  102. };

  103. zone "1.168.192.in-addr.arpa" {
  104.         type master;
  105.         file "192.168.1.zone";
  106.         forwarders{};
  107. };

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

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

  3. ; Begin Start Of Authority resource record
  4. example.com. IN  SOA station90.example.com. root.station90.example.com. (
  5.                                 2003040100        ; serial number
  6.                                 1H                 ; refresh slave
  7.                                 5M                 ; retry query
  8.                                 1W                 ; expire
  9.                                 1M                 ; negative TTL
  10. )

  11. ; Specify our name servers
  12. ; !!WARNING: You can not use CNAMEs for RDATA here !!
  13. ; owner                        TTL        CL  type                RDATA
  14. @                                IN  NS                station90.example.com.

  15. ; Specify our mail exchangers
  16. ; !!WARNING: You can not use CNAMEs for RDATA here !!
  17. ; owner                        TTL        CL  type          RDATA
  18. @                                IN  MX          10  station90.example.com.

  19. ; This is broken and against RFC but must be done to placate the masses
  20. ; owner                        TTL        CL  type        RDATA
  21. example.com.                        IN  A                192.168.0.90

  22. ; List our CNAME records ( aliases ) here
  23. ; owner                        TTL        CL  type        RDATA
  24. mail.example.com.        3600           IN  CNAME        server1.example.com.
  25. kerberos.example.com.        3600        IN  CNAME        server1.example.com.

  26. ; List our A records ( hosts ) here
  27. ; owner                        TTL        CL  type        RDATA
  28. station1.example.com.                IN  A                192.168.0.1
  29. station2                        IN  A                192.168.0.2
  30. station3                        IN  A                192.168.0.3
  31. station4                        IN  A                192.168.0.4
  32. station5                        IN  A                192.168.0.5
  33. station6                        IN  A                192.168.0.6
  34. station7                        IN  A                192.168.0.7
  35. station8                        IN  A                192.168.0.8
  36. station9                        IN  A                192.168.0.9
  37. station10                        IN  A                192.168.0.10
  38. station11                        IN  A                192.168.0.11
  39. station12                        IN  A                192.168.0.12
  40. station13                        IN  A                192.168.0.13
  41. station14                        IN  A                192.168.0.14
  42. station15                        IN  A                192.168.0.15
  43. station16                        IN  A                192.168.0.16
  44. station17                        IN  A                192.168.0.17
  45. station18                        IN  A                192.168.0.18
  46. station19                        IN  A                192.168.0.19
  47. station20                        IN  A                192.168.0.20
  48. server1                                IN  A                192.168.0.254

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

  53. ; Set up the rest of the station records.

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

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

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

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

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

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

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

  3. ; Begin Start Of Authority resource record
  4. 0.168.192.IN-ADDR.ARPA. IN  SOA station90.example.com. root.station90.example.com.(
  5.                                 2003040100        ; serial number
  6.                                 1H                 ; refresh slave
  7.                                 5M                 ; retry query
  8.                                 1W                 ; expire
  9.                                 1M                 ; negative TTL
  10. )

  11. ; Specify our name servers
  12. ; !!WARNING: You can not use CNAMEs for RDATA here !!
  13. ; owner                        TTL        CL  type        RDATA
  14. @                                IN  NS          station90.example.com.

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

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


  218. 254                                IN  PTR                server1.example.com.

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





回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-4-29 10:27 , Processed in 0.040472 second(s), 24 queries .

快速回复 返回顶部 返回列表