当前位置:网站首页>Basic file operation of cmder
Basic file operation of cmder
2022-07-27 06:24:00 【Thinking and feeling】
1.Cmder function
cmder Itself is a software package , Is an enhanced command line tool . have access to windows,linux,shell The order of .
2.Cmder Shortcut keys
ctrl + c,cmder Termination key in
ctrl + w, Close page
Right mouse button , Paste
Tab, Auto fill path
start ., Open the current folder
rm -rf Delete all files on the hard disk
3. Check the addition, deletion and modification of documents
notes :Cmder The default opening position is .exe File location of .
cd ~/Desktop/, Change the current directory to the desktop .
check :
1.pwd(process working directory Catalog / Folder )
Show the current absolute path
2.ls(list)
Displays all files in the current directory
notes :ls Default not to show . Opening file
ls + route , View the contents of the specified directory ( example :ls git-demo-1/)
3. View file contents
- cat + route , Show the whole content of the document ( example :cat style.css)
- head + route , Show the first ten lines of the document
notes :head The first ten lines are displayed by default , Through parameters -n Numbers , Before the exhibition ( This number ) Row content
head style.css( route ) -n 14, Exhibition style.css Before 14 That's ok
- tail + route , Show the last ten lines of the document
- less + route , The default display is one page ,↑ and ↓( or j/k) Show the contents of the previous page and the next page ,q Exit the current file view
increase :
1. create a file
- touch file name , create a file ( example :touch 1.txt 2.txt)
- echo Content > file name , Rewrite the contents of the file into the file ( example :echo hi>1.txt)
- echo Content >> file name , Append the contents of the file to the file ( example :echo hahaha>1.txt)
- echo -e "1\n2">1.txt,-e Parameter multi line input
notes :echo Write directly when the command folder exists , If it does not exist, it will be newly created
> Representation override , Re cover ; and >> Means additional content , No coverage .
2. Create directory ( Folder )
mkdir Directory name , Create directory ( example :mkdir a b)
3. Copy
- cp file name 1 file name 2, Copy files 1 To file 2( example :cp 1.txt 2.txt)
- cp -r Catalog 1 Catalog 2, replica catalog 1 To catalog 2( example :cp -r a b)
Delete :
1. Delete file (remove)
rm file name ( example :rm 1.txt)
2. Delete directory (remove recursive Recursive )
rm -r Directory name ( example :rm -r a)
Change :
1. Modify file
- start file name , Open the file by default ( example : start 1.txt)
- echo
- code file name , use VScode Modify file ( example :code 1.txt)
2. Empty files
- echo ''>1.txt, Empty string overlay
- start/code Open empty and save
3. Move / Change file name (move)
- mv file name Directory name , Put the file in the directory ( example :mv 1.txt git-demo-1)
- mv file name 1 file name 2, Rename to file name 2( example : mv 1.txt 2.txt)
notes :mv The command always operates on the previous one ,
for example :mv 1.txt a, take 1.txt Put it in the directory a in
mv a/1.txt ., take 1.txt Move to the current directory
4. Modify the file update time
- ls -l, Check the last update time of the file
- touch file name , Open file update. The last update time is the current time
4. Check out the manual
command --help
command --help | less( Page turning form ), example :ls --help | less
tldr - command , example :tldr -ls
notes :tldr(too long;didn't read Compact version view help tool ),
Download mode npm i -g tldr/yarn global add tldr
5. Check the command status
touch 1.txt && echo Create success
notes : Generally, the command is successful , Nothing ; Command fails , return error.
Successfully returns 0, Failure returns to non 0(error code).
6. Script files
1. Multi command connection operation :
&&, Execute the next command after one command succeeds .
;, Execute the next command whether it succeeds or not .
alt + ., Copy the last parameter last time .
2. Script file creation process
- After creating the script command file
- chmod +x file name , Add executable rights
- sh Relative paths , Run the script file
notes : Another way is to add the directory of the executable file to the environment variable PYTH in , Then you can directly use the file name as your command .
therefore ls Such an operation will only .exe Put in cmder Of bin Has been added to pyth in , So it can be directly executed as a command .( Advanced systems > environment variable > System variables / User variables ) The essence of the command line is an executable file .
边栏推荐
- Summary of the use of C # Jason code in TCP communication
- Reading and writing of file content - data flow
- Multi threaded CAS, synchronized lock principle, JUC and deadlock
- Robot navigation implementation
- 接口测试概念及Postman工具简介使用
- Force deduction problem solving monotonous stack
- Some experience of learning technology and theoretical knowledge
- Install Wireshark correctly
- jmeter简介
- Simple understanding of network principle
猜你喜欢

ROS node name duplicate

The problem that tqdm cannot display in a single line

Unity engine starts to migrate from mono to.Net coreclr

切线空间以及TBN矩阵

Unityshader depth texture (understanding and problems encountered)

Sexy prime number (acwing daily question)

wireshark图形界面介绍

ROS distributed communication

wireshark数据包修改--添加或修改消息字段(二)

Unity shader overview
随机推荐
数据库在终端的基础操作
Solve binary tree (6)
[dynamic planning - steel bar cutting]
Solving binary tree with force deduction (8)
Simple understanding of network principle
Multi coordinate transformation
Brief introduction to unity menu interface
Brief introduction to unity window interface
UnityShader-LowPoly
IP核之ROM
The problem that tqdm cannot display in a single line
Briefly remember the top ten orders
This is my blog
Related knowledge of multithreading
Li Kou's first week's wrong question set
无法启动程序,拒绝访问?
通信机制比较
多线程的相关知识
IP core summary
Remote sensing image recognition imaging synthesis