如何在Windows中打开和使用命令提示符
入門 (Getting started)
Windows, MacOS and Linux have command line interfaces. Windows’ default command line is the command prompt. The command prompt allows users to use their computer without pointing and clicking with a mouse.
Windows,MacOS和Linux具有命令行界面。 Windows的默認(rèn)命令行是命令提示符。 命令提示符允許用戶使用計(jì)算機(jī)而無需用鼠標(biāo)指向和單擊。
The command prompt is a black screen where users type commands to use their computer. The same tasks that can be done by pointing and clicking with a mouse can also be done with the command prompt. The difference is that many tasks such as creating folders and deleting files can be done faster in the command prompt.
命令提示符是黑屏,用戶可以在其中鍵入命令以使用其計(jì)算機(jī)。 通過鼠標(biāo)指向和單擊可以完成的相同任務(wù)也可以在命令提示符下完成。 區(qū)別在于,可以在命令提示符下更快地完成許多任務(wù),例如創(chuàng)建文件夾和刪除文件。
Also, it allows users to configure their computer and run programs that they otherwise could not do by pointing and clicking.
此外,它還允許用戶通過單擊來配置計(jì)算機(jī)并運(yùn)行他們?cè)緹o法執(zhí)行的程序。
打開命令提示符 (Opening the Command Prompt)
To access the command prompt, click the windows start menu on the Desktop tool bar (you can also press the windows button on your keyboard) and type cmd and hit enter. The command prompt will appear, it will display some text like to following below:
要訪問命令提示符,請(qǐng)單擊桌面工具欄上的Windows開始菜單(也可以按鍵盤上的Windows按鈕),然后鍵入cmd并按enter 。 將出現(xiàn)命令提示符,它將顯示一些文本,如下所示:
C:\Users\YourUserName>導(dǎo)航目錄(在文件夾中移動(dòng)) (Navigating Directories (Moving through folders))
C:\Users\YourUserName is called your current working directory (directory is another way to say folder). It is like a street address that tells you where you are on your computer.
C:\Users\YourUserName稱為當(dāng)前工作目錄(目錄是另一種表示文件夾的方式)。 就像街道地址一樣,它告訴您您在計(jì)算機(jī)上的位置。
The current working directory can be a guide as you navigate through your computer. On the right of the > we can type cd, which stands for Change Directory, and the name of a directory that you want to navigate to. In this case we will type Documents. Enter cd Documents and your current working directory should look like the following:
當(dāng)您瀏覽計(jì)算機(jī)時(shí),當(dāng)前工作目錄可以作為指南。 在>的右側(cè),我們可以鍵入cd ,它代表更改目錄,以及您要導(dǎo)航到的目錄的名稱。 在這種情況下,我們將鍵入Documents 。 輸入cd Documents ,您當(dāng)前的工作目錄應(yīng)如下所示:
C:\Users\YourUserName\Documents>To go back one directory type and enter cd... Your current working directory should return to this:
要返回一個(gè)目錄,請(qǐng)輸入cd.. 。 您當(dāng)前的工作目錄應(yīng)返回到以下位置:
C:\Users\YourUserName>With the cd and cd .. commands you can move back and forth through directories. This might seem very basic at first but as you learn more commands the command prompt will become a very useful and efficient tool.
使用cd和cd ..命令,您可以在目錄之間來回移動(dòng)。 乍一看,這似乎很基礎(chǔ),但是隨著您了解更多命令,命令提示符將成為非常有用和高效的工具。
以下是一些常用命令: (Here is a list of common commands:)
用法示例: (Usage Examples:)
制作目錄 (Making a Directory)
mkdir name_of_the_directory_you_want_to_make獲取命令信息 (Getting Info on a Command)
your_command /?刪除文件和內(nèi)容 (Deleting a File and Contents)
rm /s name_of_directory_you_want_to_delete有用的提示: (Useful tips:)
The command Ipconfig shows your computer’s ip address
Ipconfig命令顯示您計(jì)算機(jī)的IP地址
If you type part of a directory’s name and hit the tab key the command prompt will autocomplete it and if you hit the tab key repeatedly it will cycle through directories that start with the same letter
如果鍵入目錄名稱的一部分并按tab鍵,命令提示符將自動(dòng)完成該目錄,如果反復(fù)按tab鍵,它將循環(huán)瀏覽以相同字母開頭的目錄
- You can use other shells or tools such as git bash or cmder to add more commands and functionality to your command prompt 您可以使用其他shell或工具(例如git bash或cmder)向命令提示符添加更多命令和功能。
Some tasks require you to run the command prompt as an administrator you clicking the windows button and typing cmd admin and hit the enter key
某些任務(wù)要求您以管理員身份運(yùn)行命令提示符,方法是單擊Windows按鈕并鍵入cmd admin然后按enter鍵
If you know the path to a file or directory can type cd PATH_TO_YOUR_DIRECTORY instead of changing directories several times to get to a directory or file
如果您知道文件或目錄的路徑,則可以鍵入cd PATH_TO_YOUR_DIRECTORY而不是多次更改目錄以進(jìn)入目錄或文件
- When you hit the up arrow key your previously entered command will appear and if you hit it repeatedly it will cycle through all of your previously entered commands 當(dāng)您按下向上箭頭鍵時(shí),您先前輸入的命令將會(huì)出現(xiàn),如果您反復(fù)按下它,它將循環(huán)顯示您先前輸入的所有命令
翻譯自: https://www.freecodecamp.org/news/how-to-use-the-command-prompt-in-windows/
總結(jié)
以上是生活随笔為你收集整理的如何在Windows中打开和使用命令提示符的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 梦到背柴是什么意思啊
- 下一篇: 梦到自己买中药啥意思