Viewing a file is a few of the ways that you create the week summarizes the following three methods:
1. Using the LS command to combine the grep method:
Ls-l--time-style ' +%a ' | Grep-e "tuesday| Wednesday "
2. Method of using awk 1:
[Oracle@bys3 ~]$ ls-l--time-style ' +%a ' |awk ' $6== ' Friday ' | | $6== "Tuesday" {print $} '
-rw-r--r--1 Oracle oinstall 253 Friday archback.sh
-rw-r--r--1 Oracle Oinstall 199 Friday bbedfile.txt
-RW-R-----1 Oracle oinstall 1958583 Friday BYS3_ORA_13020.TRC
-rw-r--r--1 Oracle Oinstall Tuesday delarch.sh
Drwxr-xr-x 3 Oracle Oinstall 4096 Tuesday Oradiag_oracle
[Oracle@bys3 ~]$
3. Using Awk Method 2:--It's a little complicated.
Declare-a Array
Array= (' ls-l--time-style ' +%a ' | awk ' {print $} ')
Echo ${array[0]}
length=${#array [@]}
Echo $length
For ((i=0;i< $length; i++))
Todo
Case ${array[$i]} in tuesday| Wednesday)
Ls-l--time-style ' +%a ' | Grep-e ${array[$i]}
Esac
Done
~
Examples of several usages of the 4.ls-l--time-style command:--You can write the commonly used environment variables as alias ls= '
See more highlights of this column: http://www.bianceng.cn/database/storage/
[Oracle@bys3 ~]$ ls-l--time-style= "+%y-%m-%d $newline%m-%d%h:%m"--shows the detailed date of year
Total 1964
-rw-r--r--1 Oracle Oinstall 17 2013-12-04 12-04 14:09 10
lrwxrwxrwx 1 Oracle oinstall 2013-12-01 12-01 22:53alert_bys3.log->/u01/diag/rdbms/bys3/bys3/trace/alert_bys3 . log
-rw-r--r--1 Oracle Oinstall 253 2013-11-15 11-15 21:25
[Oracle@bys3 ~]$ ls-l--time-style= "ISO"
Total 1964
-rw-r--r--1 Oracle Oinstall 17 12-04 14:09 10
lrwxrwxrwx 1 Oracle oinstall 12-01 22:53 alert_bys3.log->/u01/diag/rdbms/bys3/bys3/trace/alert_bys3.log
-rw-r--r--1 Oracle Oinstall 253 11-15 21:25 archback.sh
[Oracle@bys3 ~]$ ls-l--time-style= "+%b%e%y$newline%b%e%h:%m"
Total 1964
-rw-r--r--1 Oracle Oinstall-DEC 4 2013Dec 4 14:09 10
lrwxrwxrwx 1 Oracle Oinstall DEC 1 2013Dec 1 22:53alert_bys3.log->/u01/diag/rdbms/bys3/bys3/trace/alert_bys 3.log
-rw-r--r--1 Oracle Oinstall 253 Nov 2013Nov 21:25 archback.sh
[Oracle@bys3 ~]$ ls-l--time-style= "locale"
Total 1964
-rw-r--r--1 Oracle Oinstall DEC 4 14:09 10
lrwxrwxrwx 1 Oracle Oinstall DEC 1 22:53 alert_bys3.log->/u01/diag/rdbms/bys3/bys3/trace/alert_bys3.log
-rw-r--r--1 Oracle oinstall 253 Nov 21:25