A regular

 

00. Course Review Description
1) inode and block
concept note:
the birth process:
Features:
file name is stored in a directory on the block
View:
2) file type file permissions
File
rwx - three user
files or directories related commands
the Find tar
3) soft vs hard links link
concept action:
features:
creation:
directory can not create hard links
4) the owner is a group of
users on the system type
super administrator normal user virtual user
5) documents of the time information (modified)
atime access time
mtime modification time
ctime change time (file attributes)

DATE
find -mtime by day to find data
-mmin

after use find to find files, batch processing:
1) bulk delete
find / oldboy_dir / -type f -mtime -1 | xargs rm -f

xargs action:
01. a plurality of rows may be integrated as a single line with a space information separated
[[email protected] oldboy_dir] # Find / oldboy_dir / F -type -mtime -1
/oldboy_dir/test01.txt
/ oldboy_dir / test02.txt
/oldboy_dir/test03.txt
/oldboy_dir/test04.txt
/oldboy_dir/test05.txt
[[email protected] oldboy_dir] # Find / oldboy_dir / -type -mtime F -1 | xargs
/ oldboy_dir / /oldboy_dir/test02.txt /oldboy_dir/test03.txt /oldboy_dir/test04.txt /oldboy_dir/test05.txt test01.txt
photo row of information can be split into a plurality of rows with a space as a resolving
Conclusion: linux system, not all commands can directly manipulate files
TR -cd '0-9a-zA-the Z' </ dev / urandom
[[email protected] oldboy_dir] # xargs -n 2 <test01.txt
01 02
03 04
05 06
07 08
09 10
[[email protected] oldboy_dir]# xargs -n 3 <test01.txt
01 02 03
04 05 06
07 08 09
10

01. symbol information system
system special symbol
system wildcard
system is the symbol
Note: when query information, will bring convenience

02. The system special symbol
1) base symbol series
$
A variable information retrieved
b normal user types of users $
c taken in conjunction with the file awk column
[[email protected] oldboy_dir] # xargs -n 2 <test01 .txt | awk '{Print $ 2}'
02
04
06
08
10
[[email protected] oldboy_dir] # xargs -n 2 <test01.txt | awk '{$ 1} Print'
01
03
05
07
09
[ oldboy_dir [email protected]] # xargs -n 2 <test01.txt | awk '{0} Print $'
01 02
03 04
05 06
07 08
09 10

!
A forced action WQ!
B may be implemented negated
[[email protected] oldboy_dir] awk # '! / Oldgirl /' test02.txt
oldboy01
oldboy02
oldboy03
oldboy04

[[email protected] oldboy_dir] # LL / oldboy_dir /
Total. 8
drwxr the root-XR-2 X 2019 oldboy01 the root. 6 On Feb. 4
-rw-R & lt - r--. 1 the root the root 30 Jan 16 09:16 test01.txt
-rw-R & lt - r-- the root 46 is the root. 1 Jan 16 09:39 test02.txt
-rw-R & lt - r-- the root the root. 1 0 16 Jan 09:08 test03.txt
-rw-R- the root 0 Jan the root. 1 -r-- 16 09:08 test04.txt
-rw-R & lt - r-- the root the root. 1 0 16 Jan 09:08 test05.txt
[[email protected] oldboy_dir] # the Find / oldboy_dir / The -type f!
/ oldboy_dir /
/ oldboy_dir / oldboy01

c information can be quickly retrieved execution history command (with caution)!
CAT ~ / .bash_history - command history record information, but not real-time recording
history - display All entered the history command
01. Check your wrong operation, confirmed the wrong reasons
02. expert review of the operation

|
a function to achieve pipeline
The results of the previous command to the command processing pipeline behind the
general pipe symbol often used in conjunction with xargs command and
batch deletes
the Find / Oldboy The -type f -name "* .txt Oldboy" | xargs RM
the Find / oldboy_dir / - f -delete of the type
the Find / oldboy_dir / The -type f -exec RM -f {} \;

find the specified data replication
find / oldboy -type f -name "oldboy * .txt" | xargs -i cp {} / oldgirl /
Find / F -name -type Oldboy "Oldboy * .txt" | xargs -t CP / oldgirl /
Find / F -name -type Oldboy "Oldboy * .txt"} {-a -exec CP / oldgirl \;

Find the specified data information to the mobile
Find / F -name -type Oldboy "Oldboy * .txt" | Music Videos xargs -i {} / oldgirl /
Find / F -name -type Oldboy "Oldboy * .txt" | Music Videos xargs -t / oldgirl /
Find / F -name -type Oldboy "Oldboy * .txt" Music Videos -exec {} / oldgirl \;
Conclusion: heel xargs (eyes) after the command is not recognized alias information

#
a representation of the profile information to annotate
b represents the user's identity information super user

2) quotes a series of symbols
, "" substantially similar functions and single quotation marks may be made to resolve the $ command `` some special symbols == $ (command)
'' written on the inside of what What WYSIWYG output
action:
01. Specifies output information
02. the information collection use quotation marks separated by a space as a whole

`` ($ ()) inside the quotation marks command execution result, to use the command outside the quotes

3) the redirection symbol
> / 1> standard output redirection symbol
>> / >> 1 additional standard output redirection symbol
2> error output redirection symbol
2 >> additional error output redirection symbol

<Standard input redirection symbol
tr xargs
enter additional criteria redirection symbols <<
A command to generate more than one line
[[email protected] oldboy_dir] # CAT oldboy.txt >> << Oldboy
> oldgirl01
> oldgirl02
> oldgirl03
> Oldboy

4) logic symbol series
logic: When one thing is completed there is a reasonable order
before && command operation is executed successfully, and then perform the operation behind the command
command operation failed before ||, then operate behind the implementation of the command
[[email protected] oldboy_dir] # mkdir / old_dir && echo "Create the dir Sucess" || echo "Create the dir failed"
Create the dir Sucess
[[email protected] oldboy_dir] # mkdi / old_dir && echo "Create the dir Sucess" || echo "Create the dir failed "
-bash: mkdi: the Command not found
the Create dir failed The

03. The system wildcard
what wildcard symbol: used to match the file name information, easy to quickly find files find information

* Matches all information
find / oldboy -type f -name "oldboy *" --- all the information at the beginning of oldboy check out the
find / oldboy -type f -name "* oldboy" --- Information to check out are beginning oldboy
Find / F -name -type Oldboy "oldgirl * Oldboy"
--- the information oldgirl beginning
to the end information are inquiries from Oldboy
{} sequence information generating
consecutive sequences:
[[email protected] oldboy_dir] # {01..05} echo
01 02 03 04 05
[[email protected] oldboy_dir] A..Z} {# echo
ABCDEFGHIJKLMNOPQRSTU VWXYZ
[[email protected] oldboy_dir] {A # echo } ..Z
ABCDEFGHIJKLMNOPQRSTU VWXYZ

generating discontinuous sequence
a contiguous sequence not regular
[[email protected] oldboy_dir] # echo 01..05..2} {
01 03 05
[[email protected] oldboy_dir]# echo {a..z..2}
a c e g i k m o q s u w y

Discontinuous not regular sequence b
[[email protected] oldboy_dir] {# echo WWW, BBS, Blog}
WWW BBS Blog

generate a combined sequence
[[email protected] oldboy_dir] # echo {1 , 2} {A, B}
. 1A. IB. 2A 2B
[[email protected] oldboy_dir] # echo {1,2} {A, B} {A, B}
1aA 1aB 1bA 1bB 2AA of 2AB 2bA 2bB

echo A{a,b}
Aa Ab

A=oldboy.txt

A oldboy.txt {echo, B}
oldboy.txta oldboy.txtb

[[email protected] ~] # echo {A, B}
A Ab
A oldboy.txt =
B = .bak

CP oldboy.txt { , .bak} == cp oldboy.txt oldboy.txt.bak
fast backup file command
[[email protected] oldboy_dir] CP # oldboy.txt {,.} BAK
[[email protected]. oldboy_dir CN] # LL
-rw-R & lt - r-- the root. 1 Jan 30 16 11:12 oldboy.txt the root
-rw-R & lt - r-- the root. 1 Jan 30 16 11:56 oldboy.txt.bak the root
fast The method of restoring data
[[email protected] oldboy_dir] CP # .bak oldboy.txt {,}
-rw-R & lt - r-- the root. 1 Jan 30 16 12:02 oldboy.txt the root
-rw-R & lt the root 30 Jan the root. 1 --r-- 16 11:56 oldboy.txt.bak
# echo B {A,}
AB A
{.bak oldboy.txt,} == cp oldboy.txt.bak oldboy.txt

04. Unknown people will not help you
how to get expert help reasons for

the ultimate goal of
Zhao 110101199901045121
money 110101199901045121
Sun 11010119990104512X
Lee 110101299901045121
Chen oldboy
week 110101199981045121
Wu 110101199901045121
Zheng 11010149990104512X
Liu oldgirl
king 110101199908045121
von 110111199901045121



jobs:
01. bulk data copy or move











Guess you like

Origin www.cnblogs.com/nsh123/p/12158708.html