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
------------------------
- </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
复制代码- [root@station60 labs]# read -p "Please input the value of A: " A < 4.txt
- [root@station60 labs]# echo $A
- 100
- [root@station60 labs]# ls
- 1.txt 2.txt 3.txt 4.txt
- [root@station60 labs]# ls
- 1.txt 2.txt 3.txt 4.txt
- [root@station60 labs]# ls > 5.txt
- [root@station60 labs]# cat 5.txt
- 1.txt
- 2.txt
- 3.txt
- 4.txt
- 5.txt
- [root@station60 labs]# ls -l
- total 20
- -rw-r--r--. 1 root root 11 Apr 28 08:14 1.txt
- -rw-r--r--. 1 root root 224 Apr 28 08:26 2.txt
- -rw-r--r--. 1 root root 13 Apr 28 08:38 3.txt
- -rw-r--r--. 1 root root 4 Apr 28 08:56 4.txt
- -rw-r--r--. 1 root root 30 Apr 28 09:00 5.txt
- [root@station60 labs]# ls
- 1.txt 2.txt 3.txt 4.txt 5.txt
- [root@station60 labs]# read B < 5.txt
- [root@station60 labs]# echo $B
- 1.txt
- [root@station60 labs]# B=$(cat 5.txt)
- [root@station60 labs]# echo $B
- 1.txt 2.txt 3.txt 4.txt 5.txt
- [root@station60 labs]#
复制代码
注意空格:
- [root@station60 labs]# ls 1.txt botang.txt >7.txt 2>&1
- [root@station60 labs]# cat 7.txt
- ls: cannot access botang.txt: No such file or directory
- 1.txt
- [root@station60 labs]# ls 1.txt botang.txt &>8.txt
- [root@station60 labs]# cat 8.txt
- ls: cannot access botang.txt: No such file or directory
- 1.txt
- [root@station60 labs]# ls 1.txt botang.txt & >9.txt
- [1] 19920
- [root@station60 labs]# ls: cannot access botang.txt: No such file or directory
- 1.txt
- [1]+ 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/
- ServerName station60.example.com
- CustomLog logs/station60.log combined
- </VirtualHost>
- <VirtualHost *:80>
- DocumentRoot /var/www/html/www60/
- ServerName www60.example.com
- CustomLog logs/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. IN SOA 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 CL type RDATA
- @ IN NS station90.example.com.
- ; Specify our mail exchangers
- ; !!WARNING: You can not use CNAMEs for RDATA here !!
- ; owner TTL CL type RDATA
- @ IN MX 10 station90.example.com.
- ; This is broken and against RFC but must be done to placate the masses
- ; owner TTL CL type RDATA
- example.com. IN A 192.168.0.90
- ; List our CNAME records ( aliases ) here
- ; owner TTL CL type RDATA
- mail.example.com. 3600 IN CNAME server1.example.com.
- kerberos.example.com. 3600 IN CNAME server1.example.com.
- ; List our A records ( hosts ) here
- ; owner TTL CL type RDATA
- station1.example.com. IN A 192.168.0.1
- station2 IN A 192.168.0.2
- station3 IN A 192.168.0.3
- station4 IN A 192.168.0.4
- station5 IN A 192.168.0.5
- station6 IN A 192.168.0.6
- station7 IN A 192.168.0.7
- station8 IN A 192.168.0.8
- station9 IN A 192.168.0.9
- station10 IN A 192.168.0.10
- station11 IN A 192.168.0.11
- station12 IN A 192.168.0.12
- station13 IN A 192.168.0.13
- station14 IN A 192.168.0.14
- station15 IN A 192.168.0.15
- station16 IN A 192.168.0.16
- station17 IN A 192.168.0.17
- station18 IN A 192.168.0.18
- station19 IN A 192.168.0.19
- station20 IN A 192.168.0.20
- server1 IN A 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:
|