当前位置:网站首页>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
边栏推荐
- Common cluster deployment schemes in redis
- Volatile and JMM memory models
- Interface learning
- Is the securities account of Qiantang education safe? Is it reliable?
- You can't specify target table for update in from clause error in MySQL
- SAP ui5 application development tutorial XXIX - Introduction to routing and navigation functions of SAP ui5 trial version
- MySQL -- optimize query statements and use not in with cases
- By inserting a section break, the word header, footer, and page number can start from any page
- SAP ui5 tutorial for beginners part XXVI - detailed steps for using OData service with mock server trial version
- Do you know what a three-tier architecture is?
猜你喜欢
Technology inventory: Technology Evolution and Future Trend Outlook of cloud native Middleware

Word quickly makes multiple single-sided table labels, number plates, etc

Semantic segmentation cvpr2019-advance: advantageous enterprise minimization for domain adaptation in semantic segmentation
Kubevela v1.2 release: the graphical operation console velaux you want is finally here!

Design of IM login server and message server

Excel splits a worksheet into multiple worksheets according to conditions, and how to split multiple worksheets into independent tables

05 virtual machine stack

50 days countdown! Are you ready for the Landbridge cup provincial tournament?

Deep learning non local neural networks

Code learning-cvpr2020 unsupervised domain adaptive semantic segmentation: intra advance
随机推荐
Technology inventory: Technology Evolution and Future Trend Outlook of cloud native Middleware
Go implements LRU cache
Jenkins installation and configuration
Click to send text messages without response is a common problem for many users in building the elegant grass Dragonfly Q system - solve the problem of clicking to send text messages without response
Transformations of pytorch torch torch vision
CSDN cerebral palsy bug has wasted nearly two hours of hard work
Part 33 of SAP ui5 application development tutorial - trial version of responsiveness of SAP ui5 applications
Yunda's cloud based business in Taiwan construction 𞓜 practical school
Day21 JMeter usage basis
You can't specify target table for update in from clause error in MySQL
Guava common collection tool classes
Voxel based and second network learning
Understanding of process, thread, task queue, event loop, macro task, micro task, execution stack and other concepts in JS
PIP connects to Tsinghua source by default
"APEC industry +" biov Tech talks about the cross-border of Chinese biotechnology enterprises and "Pratt & Whitney Kangyu" | apec-hub public welfare
Get the first letter of Chinese phonetic alphabet in Excel and capitalize it
Introduction to sap ui5 tools
SAP ui5 date type sap ui. model. type. Analysis of date parsing format
1.5.3 use tcpdump to observe ARP communication process
Summary of 6 common methods of visual deep learning model architecture