|
28.
|
|
|
The <command>cd</command> command changes directories. When you open a terminal you will be in your home directory. To move around the file system you will use <command>cd</command>.
|
|
|
|
<command>cd</command>命令改变目录。 打开终端后您位于主目录。要在系统中移动,需要使用 <command>cd</command>命令。
|
|
Translated and reviewed by
Feng Chao
|
|
|
|
Located in
basic-commands/C/basic-commands.xml:79(para)
|
|
29.
|
|
|
To navigate into the root directory, type: <screen>cd /</screen>
|
|
|
|
要浏览到根目录,键入:<screen>cd /</screen>
|
|
Translated and reviewed by
Yiding He
|
|
|
|
Located in
basic-commands/C/basic-commands.xml:88(para)
|
|
30.
|
|
|
To navigate to your home directory, type: <screen>cd</screen> or <screen>cd ~</screen>
|
|
|
|
要浏览你的主目录,键入:<screen>cd</screen>或者<screen>cd ~</screen>
|
|
Translated and reviewed by
1+1=2
|
|
|
|
Located in
basic-commands/C/basic-commands.xml:94(para)
|
|
31.
|
|
|
The <command>~</command> character represents the current user's home directory. As seen above, <command>cd ~</command> is equivalent to <command>cd /home/username/</command>. However, when running a command as root (using <command>sudo</command>, for example), <command>~</command> points instead to <filename class="directory">/root</filename>. When running a command with <command>sudo</command>, the full path to your home directory must be given.
|
|
|
|
<command>~</command>代表当前用户的主目录。正如上面介绍的, <command>cd ~</command> 等价于 <command>cd /home/username/</command>。 然而,当作为 root 用户时(例如使用 <command>sudo</command>命令), <command>~</command> 指向 <filename class="directory">/root</filename>。当使用 <command>sudo</command>命令时,需要提供主目录的完整路径。
|
|
Translated and reviewed by
Feng Chao
|
|
|
|
Located in
basic-commands/C/basic-commands.xml:100(para)
|
|
32.
|
|
|
To navigate up one directory level, type: <screen>cd ..</screen>
|
|
|
|
要浏览上一层目录,键入:<screen>cd ..</screen>
|
|
Translated and reviewed by
1+1=2
|
|
|
|
Located in
basic-commands/C/basic-commands.xml:111(para)
|
|
33.
|
|
|
To navigate to the previous directory (or back), type: <screen>cd -</screen>
|
|
|
|
要浏览先前的目录(或者后退), 键入: <screen>cd -</screen>
|
|
Translated by
Wentao Tang
|
|
Reviewed by
1+1=2
|
|
|
|
Located in
basic-commands/C/basic-commands.xml:117(para)
|
|
34.
|
|
|
To navigate through multiple levels of directories at once, specify the full directory path that you want to go to. For example, type: <screen>cd /var/www</screen> to go directly to the <filename class="directory">/www</filename> subdirectory of <filename class="directory">/var/</filename>. As another example, type: <screen>cd ~/Desktop</screen> to move you to the <filename class="directory">Desktop</filename> subdirectory inside your home directory.
|
|
|
|
如需跨过多级目录变更当前目录,需要指明您想进入的目录的完整路径。例子一,若直接进入目录 <filename class="directory">/var/</filename> 下的子目录 <filename class="directory">/www</filename>,则键入:<screen>cd /var/www</screen>。例子二,若进入 home 目录下的子目录 <filename class="directory">Desktop</filename>,则键入:<screen>cd ~/Desktop</screen>。
|
|
Translated and reviewed by
Tao Wei
|
|
|
|
Located in
basic-commands/C/basic-commands.xml:124(para)
|
|
35.
|
|
|
pwd
|
|
|
|
pwd
|
|
Translated by
Wentao Tang
|
|
Reviewed by
1+1=2
|
|
|
|
Located in
basic-commands/C/basic-commands.xml:141(title)
|
|
36.
|
|
|
<application>GNOME Terminal</application> also displays this information in the title bar of its window.
|
|
|
|
<application>GNOME 终端</application>也会在窗口的标题栏显示该信息。
|
|
Translated and reviewed by
Yiding He
|
|
|
|
Located in
basic-commands/C/basic-commands.xml:151(para)
|
|
37.
|
|
|
The <command>pwd</command> command outputs which directory you are currently located in (<acronym>pwd</acronym> stands for <quote>print working directory</quote>). For example, typing <screen>pwd</screen> in the <filename class="directory">Desktop</filename> directory, will show <computeroutput>/home/username/Desktop</computeroutput>. <placeholder-1/>
|
|
|
|
<command>pwd</command> 命令用于显示当前所在的目录 (<acronym>pwd</acronym> 代表 <quote>print working directory</quote>)。例如在 <filename class="directory">Desktop</filename> 目录输入 <screen>pwd</screen>,将会显示 <computeroutput>/home/username/Desktop</computeroutput>。<placeholder-1/>
|
|
Translated and reviewed by
Yiding He
|
|
|
|
Located in
basic-commands/C/basic-commands.xml:142(para)
|