Quick Start windows command line

CLI (command line interface): Command Line Interface
GUI (Graphical User Interface): a graphical user interface
in the GUI and things to do in the CLI is mutually corresponding, for example, opening the "this computer" on the desktop into the "python" file folders, command line interface, enter the destination folder by cd command

pwd (print working directory): print worktable of Contents(folder)

Display the full path to the current working directory is located, in order to determine where you are

cd ~: Back to the home directory

mkdir (make directory): Create a directory

For a directory containing spaces, you need to add double quotes such as: mkdir "I HAVE FUN"

cd (change directory): Change directory

Using the cd command exchanges between directory

cd:.. back to the directory level

ls (list): list the contents of a directory

rmdir (remove directory): Delete Contents

pushd and popd: switching the plurality of directories

pushed: the current directory where the "push" (push) to a list for later use, and then go to another directory
popd: the last push of the directory from the list of "pop" (pop), then back to this is the pop-up directory
Here Insert Picture Description

New-Item (create an empty file)

Not case-sensitive, for example, to create a text file named "dabao" in the command line, type: new-item dabao.txt can also type Chinese Dabao
distinguish mkdir command, mkdir is to create a folder, new-item you can create any kind of file
dabao.txt, dabao.doc, dabao.xlsx etc.

cp: copy files, copy files from one place to another

Syntax: cp source file new file
cp -r copy directories contain several files
Note:
Environment: In the disc D, there is a python folder, and wherein mapping comprises two subfolders workspace, there is a text file mapping 1.txt
1. Copy the folder 1.txt the mapping, and is named 2 .txt
operation: Back to the mapping directory, type the command cp 1.txt 2.txt, that is, in D: / python / mapping path, copy 1.txt, and name the new file 2.txt
grammar : cp source file name new file name
2. copy the mapping 1.txt folder beat workspace folder
operation: Back to the python directory, type the command cp mapping / 1.txt workspace, that is, in D: / python / path, 1.txt subfolder under the directory to copy the mapping workspace directory
syntax: cp path of the target file
3. create a folder in the workspace subfolder shui, and copy 1.txt to shui in
operation: Back python directory, type the command cp mapping / 1.txt workspace / shui, i.e., D: / python / path, the mapping 1.txt copied to the workspace in shui
syntax: cp path path
4. 1 .txt copied to the desktop
syntax: cp path ~ / desktop
Note : multiplexed When operating, the path to type correctly, the existing path, the operation can not be performed at the same level, is one-way, for example, has entered into D: / python / mapping path, and you want to copy to the workspace 1.txt is impossible, then type the command:
cp 1.txt workspace, the result is a folder in the mapping file copy 1.txt, and the name of the new file worksapce
proper operation using the cd command to go back to the previous python directory, type the command:..
cp mapping /1.txt workspace

mv: move files

Syntax: mv old file name new file name (equivalent to rename - rename)
or: mv path path

more (view file contents)

Enter to the parent directory is to view the file, type the command: more filename
to withdraw more, you can type q, q represents quit (exit)

cat (stream file content display)

Once the entire file input to the screen

rm (delete files)

Be careful when removing the loop file

exit (exit terminal)

Syntax want to get the relevant command, type man command in powershell, or get-help command; you can type in cmd help

Published 29 original articles · won praise 3 · Views 962

Guess you like

Origin blog.csdn.net/weixin_44813932/article/details/103287118
Recommended