当前位置:网站首页>Rhcsa day 4
Rhcsa day 4
2022-06-25 05:57:00 【Xuantian · muxuanji】
day04
File search 4 Ways of planting
whereis The query scope searches for files through the path of system environment variables $PATH, All documents
which The query scope searches for files through the path of system environment variables $PATH, Looking for executable ( Find command file )
locate Global search , But you need to import the system files into the database before searching updatedb; Fast search speed
*find Global search for files .
matters needing attention : 1)-prune It has to be with -path,-o Use it together 2)-prune -o The order is not Can exchange 3)-name Etc. must be placed in -prune -o You can use it later
! -a -o
eg: find . -path ./tmp -prune -o -name "*.txt"
[[email protected] test]# find . ! -name "out" -a -name ".txt"
find / -name FILENAME -type f
find -name FILENAME
find ../.. -name FILENAME
-exec -ok
#-exec -ok find The result of finding the file is through The result of the previous command can be changed by default The line is recognized as multiple file parameters and processed by the following commands
find / -type f -exec cp -p {} /test \;
find / -type f -ok cp -p {} /test \;
[[email protected] test]# find . -type f |xargs -I {} cp {} /test
-I take xargs The name of each item of , It's usually assigned line by line to {}, It can be used {} Instead of .
File compression and decompression
tar
-c
-x
-t
-v
-f
-j
-J
-z
-C
File transfer :
window --linux xftp Realize file transfer
rz FILENAME receive sz delivery ---lrzsz package
linux--linux
File sending : scp mima [email protected]:/root
Documents received : scp [email protected]:/root/mima /passwd
scp -r
[[email protected] ~]# sftp 192.168.220.154 launch sftp Remote connection for
sftp> put file
sftp> get filename
File management name
touch > >> vi/vim nano
mkdir
rm -rf
cp
mv
wget
cat tac more less head tail (vim nano) grep
vim nano > >>
echo this is test > a.txt
cat <<EOF > file
grep wc cut sort uniq tr
whereis
which
locate
find
tar
bash characteristic
alias Define command aliases
alias Alias =" Order itself "
l Temporary alias , It only takes effect when the current terminal is running
vim /etc/bashrc 1--exit 2--bash 3--source /etc/bashrc
The permanent alias is valid for all users of the system
vim ~/.bashrc
Permanent aliases are only valid for current use
Command cache
1. Build command cache
Execute the command to automatically create in the cache
hash -p /usr/bin/touch touch
hash -p /usr/bin/touch chuangjian
2. Delete cache
hash -d chuangjian
hash -r Empty all caches
exit terminal
Caching features : Command cache ---alias-- Name order document
[[email protected] ~]# hash hits command 3 /usr/bin/vim 1 /usr/bin/cat 1 /usr/sbin/pidof 2 /usr/bin/su [[email protected] ~]# echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin [[email protected] ~]# which touch /usr/bin/touch [[email protected] ~]# touch a [[email protected] ~]# hash hits command 3 /usr/bin/vim 1 /usr/bin/cat 1 /usr/bin/touch 1 /usr/sbin/pidof 2 /usr/bin/su [[email protected] ~]# touch /usr/bin/touch ---= Priority through cache matching [[email protected] ~]# hash hits command 3 /usr/bin/vim 1 /usr/bin/cat 2 /usr/bin/touch 1 /usr/sbin/pidof 2 /usr/bin/su [[email protected] ~]# mv /usr/bin/touch /usr/local/bin [[email protected] ~]# touch b bash: /usr/bin/touch: No such file or directory [[email protected] ~]# hash -d touch [[email protected] ~]# hash hits command 3 /usr/bin/vim 1 /usr/bin/cat 1 /usr/sbin/pidof 3 /usr/bin/mv 2 /usr/bin/su [[email protected] ~]# touch b ---- There is no cache and the command file under the alias execution environment variable path [[email protected] ~]# hash -p /usr/bin/tac chakan -- Alias
history
边栏推荐
- Solve some prompt codes that pychar cannot recognize selenium
- Instant messaging project (I)
- Websocket in the promotion of vegetable farmers
- Mirror image of binary tree
- What is SAP sup - Sybase unwired platform
- Trouble of setting table property to null
- Various errors and solutions encountered when deploying SAP ui5 application to ABAP server with SAP Fiori tools
- Guava-IO
- MySQL transaction learning notes (I) first encounter
- Part 34 of SAP ui5 application development tutorial - device adaptation of SAP ui5 application based on device type
猜你喜欢

1.6.3 use tcpdump to observe DNS communication process

Day21 JMeter usage basis
Part 33 of SAP ui5 application development tutorial - trial version of responsiveness of SAP ui5 applications
Introduction to sap ui5 tools

Classic usage of the sumproduct function

Getting started with Silverlight development 1

Multithreading and thread pool
Part 34 of SAP ui5 application development tutorial - device adaptation of SAP ui5 application based on device type

"APEC industry +" biov Tech talks about the cross-border of Chinese biotechnology enterprises and "Pratt & Whitney Kangyu" | apec-hub public welfare

Only these four instructions are required to operate SQL data
随机推荐
Use generator-easy-ui5 to quickly create the engineering structure of SAP ui5 applications
Simple student management system
Day19 (variable parameter, enhanced for loop traversal, generic wildcard <? >, TreeSet, linkedhashset, nested traversal of sets, set set, static import,)
What are the reasons why most webmasters choose Hong Kong site group servers?
Soft exam information system project manager_ Management Science (Operations Research) -- senior information system project manager of soft test 033
Yunda's cloud based business in Taiwan construction 𞓜 practical school
Day21 performance test process
C language - minesweeping
手机开户一般哪个证券公司好?手机开户是安全么?
钱堂教育的证券账户安全吗?靠谱吗?
Code learning-cvpr2020 unsupervised domain adaptive semantic segmentation: intra advance
Mongodb delete data
同花顺软件究竟是什么?网上开户安全么?
Which securities company is good for opening a mobile account? Is it safe to open a mobile account?
Analysis of IM project framework
Excel splits a worksheet into multiple worksheets according to conditions, and how to split multiple worksheets into independent tables
Day22 send request and parameterization using JMeter
Technology Review: what is the evolution route of container technology? What imagination space is there in the future?
[day40 literature extensive reading] space and time in the child's mind: metallic or atomic
The k-th node of the binary search tree [sword finger offer]