如何在Windows 10的命令提示符中更改目錄

The Windows 10 logo.

One of the first things you’ll need to learn as you become more familiar with?Command Prompt on Windows 10 is how to change directories in the operating system’s file system. There are a few ways you can do this, so we’ll walk you through them.

隨著您對Windows 10上的命令提示符更加熟悉,您需要學習的第一件事是如何更改操作系統文件系統中的目錄。 您可以通過多種方式進行此操作,因此我們將引導您完成這些操作。

First, type “cmd” in the Windows Search bar to?open Command Prompt, and then select “Command Prompt” from the search results.

首先,在Windows搜索欄中鍵入“ cmd”以打開“命令提示符”,然后從搜索結果中選擇“命令提示符”。

Click "Command Prompt" in the Windows 10 search results.

With Command Prompt opened, you’re ready to change directories.

打開命令提示符后,就可以更改目錄了。

使用拖放方法更改目錄 (Change Directories Using the Drag-and-Drop Method)

If the folder you want to open in Command Prompt is on your desktop or already open in?File Explorer, you can quickly change to that directory. Type?cd followed by a space, drag and drop the folder into the window, and then press Enter.

如果要在命令提示符下打開的文件夾在桌面上或已經在文件資源管理器中打開,則可以快速切換到該目錄。 鍵入cd后跟一個空格,將文件夾拖放到窗口中,然后按Enter。

An animated GIF showing a file being dragged and dropped in Command Prompt.

The directory you switched to will be reflected in the command line.

您切換到的目錄將反映在命令行中。

在命令提示符下更改目錄 (Change Directories Within Command Prompt)

It’s not always convenient to open File Explorer and drag and drop. That’s why it’s cool that you can also type a command to change directories right in Command Prompt.

打開文件資源管理器并拖放并不總是很方便。 這就是為什么您還可以直接在命令提示符下鍵入命令以更改目錄的原因。

Say, for example, you’re in your user folder, and there’s a “Documents” directory in the next file path. You can type the following command in Command Prompt to switch to that directory:

假設您位于用戶文件夾中,并且下一個文件路徑中有一個“文檔”目錄。 您可以在命令提示符下鍵入以下命令以切換到該目錄:

cd Documents

cd Documents

Note that this only works if you’re in the immediate file structure. In our case, that would be (user folder) > Documents. In our current directory, we wouldn’t be able to use this method to jump to a directory nested two levels down.

請注意,這僅在您處于直接文件結構中時才有效。 在我們的例子中,該目錄為(用戶文件夾)>文檔。 在當前目錄中,我們將無法使用此方法跳轉到向下嵌套兩個級別的目錄。

So, let’s say we’re currently in the user folder and want to go to the “How-To Geek” folder, which is nested in “Documents.” If we try to jump straight to “How-To Geek” without first going to “Documents,” we get the error shown in the image below.

因此,假設我們當前位于用戶文件夾中,并且想要轉到嵌套在“文檔”中的“ How-To Geek”文件夾。 如果我們嘗試直接跳到“ How-To Geek”而沒有先去“ Documents”,則會收到下圖所示的錯誤。

"The System Cannot Find the Path Specified" error message in Command Prompt.

Let’s take things one directory at a time, for now. As we mentioned previously, we’re currently in our user folder. We type?cd Documents?in Command Prompt to visit “Documents.”

現在,讓我們一次將一個目錄放在一個目錄中。 如前所述,我們當前位于用戶文件夾中。 我們在命令提示符下鍵入cd Documents以訪問“ Documents”。

The "cd Documents" command in Command Prompt.

We’re now in the “Documents” folder. To move down another level, we type?cd?on the command line followed by the name of that directory.

我們現在位于“文檔”文件夾中。 要向下移動一個級別,請在命令行上鍵入cd ,然后輸入該目錄的名稱。

The "cd How-To Geek" command in Command Prompt.

Now, let’s say we’re back in our user folder and want to skip that extra step and jump two directories down. In our case, this would be our “How-To Geek” folder. We type the following command:

現在,假設我們回到了用戶文件夾中,并希望跳過該額外的步驟并向下跳兩個目錄。 就我們而言,這就是我們的“ How-To Geek”文件夾。 我們輸入以下命令:

cd Documents\How-To Geek

This allows us to move two directory levels with one command.

這使我們可以使用一個命令移動兩個目錄級別。

The "cd Documents\How-To Geek" command in Command Prompt.

If you ever go to the wrong directory and want to turn back, type the following command:

如果您進入錯誤的目錄并想返回,請鍵入以下命令:

This allows you to move up a level.

這使您可以向上移動一個級別。

The "cd . .?" command in Command Prompt.

導航提示 (A Navigation Tip)

If you want to be a bit more efficient with your directory changes, type?cd?on the command line, followed by the first few letters of the directory you want. Then, press Tab to autocomplete the directory name.

如果要使目錄更改更加有效,請在命令行上鍵入cd ,然后輸入所需目錄的前幾個字母。 然后,按Tab鍵自動完成目錄名稱。

An Animated GIF showing autocomplete in Command Prompt.

Alternatively, you can type cd, followed by the first letter of the directory, and then press Tab multiple times until the correct directory appears.

或者,您可以鍵入cd ,然后鍵入目錄的首字母,然后多次按Tab鍵,直到出現正確的目錄。

An animated GIF showing directories being toggled in Command Prompt.

查看目錄內容 (See Directory Contents)

If you’re ever lost and not sure where to go next, you can view the contents of your current directory by typing dir?on the command line.

如果您迷路了并且不確定下一步要去哪里,可以在命令行上輸入dir來查看當前目錄的內容。

The "dir" command and a directory's contents in Command Prompt.

This will give you a hint as to which directory to navigate to next.

這將提示您要導航到下一個目錄。

翻譯自: https://www.howtogeek.com/659411/how-to-change-directories-in-command-prompt-on-windows-10/

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/278261.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/278261.shtml
英文地址,請注明出處:http://en.pswp.cn/news/278261.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

jQuery 購物車

html代碼 <!--shoppingCar start--> <table id"TB"> <tr> <td colspan"7" class"title"> <div class"img_box"> <div class"logo_box"> <img src"img/jd…

MySQL優化總結

2019獨角獸企業重金招聘Python工程師標準>>> 從這幾天看MySQL性能優化來看&#xff0c;基本的思路就是分分分&#xff0e;&#xff0e;&#xff0e; 1&#xff0c;分讀&#xff0c;用緩存來分攤讀表的壓力; 2&#xff0c;讀寫分離&#xff0c;主從分離&#xff0c;寫…

瘋狂java講義

封裝&#xff1a; 封裝&#xff1a;將對象狀態信息隱藏在對象內部&#xff0c;不允許外部程序直接訪問對象內部信息&#xff0c;而是用類所提供的方法訪問和操作。訪問控制符&#xff1a;private&#xff08;當前類訪問權&#xff09; ,protected&#xff08;子類訪問&#xff…

將背景色添加到Word 2007文檔中

Instead of using the standard white background with Word documents, here is how to add some background color to spice up your documents. 代替在Word文檔中使用標準的白色背景&#xff0c;這是如何添加一些背景顏色來為文檔增添色彩。 Open your word document and ch…

jquery實現增刪改(偽)-老男孩作業day13

使用jquery進行&#xff0c;文件的編寫&#xff0c;實現自增id,刪除&#xff0c;添加&#xff0c;編輯模式。 jquery放在本地&#xff0c;src"jquery_js.js" 可以改成其他&#xff0c;或者在線的路徑 readme<!DOCTYPE html> <html lang"en"> &…

uoj#119. 【UR #8】決戰圓錐曲線(線段樹+復雜度分析)

題解 傳送門 題解 然而要我來說我感覺只是個爆搜啊…… //minamoto #include<bits/stdc.h> #define R register #define ll long long #define ls (p<<1) #define rs (p<<1|1) #define fp(i,a,b) for(R int ia,Ib1;i<I;i) #define fd(i,a,b) for(R int ia…

如何在Raspberry Pi上設置兩因素身份驗證

Kiklas/ShutterstockKiklas /快門The Raspberry Pi is everywhere now, which is why it’s caught the eye of threat actors and cybercriminals. We’ll show you how to secure your Pi with two-factor authentication. Raspberry Pi現在無處不在&#xff0c;這就是為什么…

Laravel Passport里的授權類型介紹

本文來自pilishen.com----原文鏈接; 歡迎來和pilishen一起學習php&Laravel&#xff1b;學習群&#xff1a;109256050OAuth2是一個安全框架&#xff0c;控制著程序受保護部分的準入&#xff0c;主要是控制不同的客戶端如何來調取API&#xff0c;保證它們在請求相應資源的時候…

vue 開發環境搭建

1.創建vue項目 1.node js 生成項目&#xff0c;編譯項目 2.hbuilder 開發環境 1.下載安裝node js http://nodejs.cn/download/ 確認是否安裝成功 如果安裝不了 代碼錯誤2503 解決方法&#xff1a; 管理員命令運行cmd; cd\ cd C:\Users\Administrator\Desktop msiexec/package n…

iphone視圖放大_如何將iPhone用作放大鏡

iphone視圖放大It’s a common problem: Some things are just too hard to see. Usually, they’re too far away, too dark, or too small. With a feature called Magnifier, your iPhone can function as a magnifying glass and sight aid. Here’s how to use it. 這是一…

chmod權限

本文引用:https://www.cnblogs.com/zhangym/p/5826200.html linux數字權限解釋 644 第一位代表文件所有者的權限,第二位代表同組用戶的權限&#xff0c;第三位代表其他用戶的權限. 讀取權限等于4,用r表示;寫入權限2,用w表示;執行權限1,用x表示. 通過4、2、1組合,得到以下幾種權…

輸出最大值MXNet實現

網絡結構&#xff0c;輸入為2個數&#xff0c;先經過10個節點的全連接層&#xff0c;再經過10個節點的ReLu&#xff0c;再經過10個節點的全連接層&#xff0c;再經過1個節點的全連接層&#xff0c;最后輸出。 #-*-coding:utf-8-*- import logging import math import random im…

discord linux_如何在Discord中應用文本格式

discord linuxDiscord allows for text-and audio-based chatting between gamers and other like-minded individuals. If you want to make a bigger impact on Discord, you can use formatting to jazz up your text-based messages. Here’s how. Discord允許游戲玩家和其…

一張圖看懂阿里云網絡產品[十二]云企業網

2019獨角獸企業重金招聘Python工程師標準>>> 摘要&#xff1a; 阿里云致力于為用戶提供優質、高效、穩定的網絡傳輸環境&#xff0c;云企業網&#xff08;Cloud Enterprise Network&#xff09;將提供一種能夠快速構建混合云和分布式業務系統的全球網絡&#xff0c;…

# 2019-2020.3 《java程序設計》第一周學習總結

2019-2020-3 《Java 程序設計》第一周學習總結 在本周的學習中&#xff0c;學習到了好多也收獲了好多&#xff0c;從最基礎的安裝虛擬機開始&#xff0c;根據老師的博客中的教程一步一步的進行&#xff0c;在這過程中也遇到了好多問題&#xff0c;因為是初步接觸Linux系統&…

聊聊Java反射

反射是Java最重要的特性。通過Java反射可以在運行時知道一個類的所有成員和方法&#xff0c;知道一個對象的類類型、成員和方法的所有信息&#xff0c;進而調用對象的方法或生成對象的代理或包裝類。Java是面向對象語言&#xff0c;除了靜態變量或原始數據類型外都是完全面向對…

01. 把存儲過程結果集SELECT INTO到臨時表

原文:01. 把存儲過程結果集SELECT INTO到臨時表在開發過程中&#xff0c;很多時候要把結果集存放到臨時表中&#xff0c;常用的方法有兩種。 一. SELECT INTO 1. 使用select into會自動生成臨時表&#xff0c;不需要事先創建 select * into #temp from sysobjects select * fro…

day5學python 基礎+裝飾器內容

基礎裝飾器內容 遞歸特性# 1.必須有一個明確的結束條件# 2.每次進入更深一層遞歸時&#xff0c;問題規模相比上次遞歸應有所減少# 3.遞歸效率不高 def run(n):print(n)if int(n/2)>0:return run(n / 2)print("-->",n) run(10) 局部變量與全局變量知識 1.全局變…

如何在Windows 10上跳過回收站以刪除文件

Windows 10 normally sends files you delete to the Recycle Bin. They’ll be kept until you empty it—or, in some cases, until Windows 10 automatically empties your Recycle Bin. Here’s how to skip the Recycle Bin and delete files immediately. Windows 10通常…

OSChina 周日亂彈 —— 我叫張一條

2019獨角獸企業重金招聘Python工程師標準>>> Osc亂彈歌單&#xff08;2018&#xff09;請戳&#xff08;這里&#xff09; 【今日歌曲】 萊布妮子 &#xff1a;分享Lube的單曲《Skoro dembel》 《Skoro dembel》- Lube 手機黨少年們想聽歌&#xff0c;請使勁兒戳&am…