当前位置:网站首页>6. Copy, move and file content commands
6. Copy, move and file content commands
2022-07-22 21:40:00 【WuJiaYFN】
6 Copy, move and file content commands
One 、 Copy and copy commands
command | Corresponding to English | effect |
---|---|---|
tree[ Directory name ] | tree | List the directory structure in a tree view |
cp Source file Target file | copy | Copy files or directories |
mv Source file Target file | move | Move files or directories / File or directory renaming |
1.tree command
- tree The command can list the file directory structure in a tree view
- Option parameters -d Show only directories
2. cp command
cp The function of the command will be given file Or directory Copy to another Documents or Directory
Options meaning -i Prompt before overriding the file -r If the given source file is a directory file , be cp All directories and files under this directory will be copied recursively , The destination file must be a directory name , Be careful : Don't use it directly cp Command to copy a directory file , To copy a directory file, you must add -r, root rm The command is the same as deleting the directory file
3. mv command
mv Commands can be used directly to move file Or catalogue , You can also rename files or directories
Option parameters : -i Prompt before overriding the file
Two 、 File content command
command | Corresponding to English | effect |
---|---|---|
cat file name | concatenate | View file contents 、 create a file 、 File merge 、 Add file content and other functions |
more file name | more | Display the contents of the document in separate screens |
grep Search for text file names | grep | Search for text file content |
1. cat command
cat The command can be used to view the contents of a file , create a file 、 File merge 、 Add file content and other functions
cat All the content will be displayed at once 、 Suitable for viewing text files with less content
Options meaning -b For non empty output line number -n Number all lines of output Be careful :Linux One more
nl
The order of andcat -b
The effect is equivalent to
2. more command
more The command can be used to display the contents of the file in separate screens , Only one page at a time
It is applicable to text files with more contents
Use more The operation key of :
Operation key | function |
---|---|
Space bar | Display the next screen of the manual page |
Enter key | Scroll one line of the man page at a time |
b | Roll back one screen |
f | Roll one screen forward |
q | sign out |
/word | Search for word character string |
3. grep command
Linux In the system grep Command is a powerful search tool
grep Allow text files to be modified Pattern lookup , The so-called pattern search , Also known as regular expressions
Options meaning -n Show matching lines and line numbers -v Display does not contain matching text of all lines ( It's like asking for the opposite ) -i Ignore case Two commonly used modes to find
Parameters | meaning |
---|---|
^a | Head of line , Search for a Beginning line |
ke$ | At the end of the line , Search for ke The line at the end |
边栏推荐
猜你喜欢
安全至上北京现代i-GMP平台厉害之处到底在哪?
Cartesi 2022 年 3 月回顧
Blue Bridge Cup - underground palace treasure taking
Drinking soda scenario 2: recursion
Learning notes of wechat applet introduction tutorial - operation feedback of UI chapter
Binance 华语社区 x Cartesi AMA 回顾
Automated test JSON general parser
煤矿无线广播系统解决方案
Network Accounting - layered structure, OSI communication process, tcp/ip model and 5-layer reference model
1. Virtualization and container technology
随机推荐
Juc-7.0-thread collaboration countdownlatch
Bash variable -- environment variable
编译gdb7.11.1报错解决
sed使用心得
Network Accounting - layered structure, OSI communication process, tcp/ip model and 5-layer reference model
MVCC
ssh时提示“WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED”
6.拷贝移动及文件内容命令
Makefile心得
记录:问题1,电脑闪屏;问题2,电脑桌面图标双击没有反应
英语四六级听力有线传输无线发射系统方案
蓝桥杯-连号区间数
Process control
蓝桥杯-K倍区间
RPM package management - Yum online management - Yum command
Solve the thirdscripterror error of wechat applet
Why do independent business owners accept CTSI
Function of extern "C"
为什么独立企业主会接受 CTSI
解决编译mosquitto时遇到的问题