如何在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.mzph.cn/news/278261.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

MySQL优化总结

2019独角兽企业重金招聘Python工程师标准>>> 从这几天看MySQL性能优化来看,基本的思路就是分分分... 1,分读,用缓存来分摊读表的压力; 2,读写分离,主从分离,写…

将背景色添加到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文档中使用标准的白色背景,这是如何添加一些背景颜色来为文档增添色彩。 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;这就是为什么…

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. 这是一…

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系统&…

如何在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…

面向对象初识

一. 面向对象初识 1.1 回顾面向过程编程vs函数式编程 # 面向过程编程 测量对象的元素个个数。 s1 fjdsklafsjda count 0 for i in s1:count 1l1 [1,2,3,4] count 0 for i in l1:count 1 面向过程编程def func(s):count 0for i in s:count 1return count …

使用LiveClick升级您的实时书签

If you like to subscribe to feeds using Firefox’s Live Bookmarks feature, the LiveClick extension gives you so many upgrades that I can only cover the highlights of how great it is. 如果您想使用Firefox的“实时书签”功能订阅供稿&#xff0c;则LiveClick扩展程…

操作系统的概论梳理

转载于:https://www.cnblogs.com/hclhechunlu/p/10477470.html

win7下如何显示缅文和使用缅文输入法?

windows 7 操作系统默认不支持缅文&#xff0c;所以缅文在win7上不能显示&#xff0c;当然也没有提供缅文输入法。 一、显示缅文 windows系统下显示缅文字母只需要安装缅文字体就可以了。目前常见的缅文字体就是Zawgyi-One&#xff0c;Zawgyi-One是一种广泛使用的缅文字体。Zaw…

airpods2使用_如何使用AirPods和AirPods Pro:完整指南

airpods2使用Burdun Iliya/ShutterstockBurdun Iliya /快门Just bought yourself or received a new pair of AirPods or AirPods Pro? Welcome to the truly wireless earphones life. Setting up AirPods is quite straightforward, but here’s how to customize and get t…

如何在iPhone上共享视频之前从视频中删除音频

Sometimes, you’d like to share a video with others, but the accompanying audio track is distracting or perhaps introduces privacy concerns. Luckily, there’s a quick way to silence a video using Photos on iPhone and iPad. Here’s how. 有时&#xff0c;您想…

Java 并发工具箱之concurrent包

概述 java.util.concurrent 包是专为 Java并发编程而设计的包。包下的所有类可以分为如下几大类&#xff1a; locks部分&#xff1a;显式锁(互斥锁和速写锁)相关&#xff1b;atomic部分&#xff1a;原子变量类相关&#xff0c;是构建非阻塞算法的基础&#xff1b;executor部分&…

如何提高gps精度_如何在锻炼应用程序中提高GPS跟踪精度

如何提高gps精度l i g h t p o e t/Shutterstocklightpoet /快门Tracking your runs, bike rides, and other workouts is fun because you can see how much you’re improving (or, in my case, dismally failing to improve). For it to be effective, though, you have to …