如何在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,一经查实,立即删除!

相关文章

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…