美文网首页
linux cd 命令的几个技巧

linux cd 命令的几个技巧

作者: rich_linn | 来源:发表于2018-08-03 11:29 被阅读0次

用法:

help cd

cd: cd [-L|[-P [-e]]] [dir]
Change the shell working directory.

Change the current directory to DIR.  The default DIR is the value of the
HOME shell variable.

The variable CDPATH defines the search path for the directory containing
DIR.  Alternative directory names in CDPATH are separated by a colon (:).
A null directory name is the same as the current directory.  If DIR begins
with a slash (/), then CDPATH is not used.

If the directory is not found, and the shell option `cdable_vars' is set,
the word is assumed to be  a variable name.  If that variable has a value,
its value is used for DIR.

Options:
    -L      force symbolic links to be followed
    -P      use the physical directory structure without following symbolic
    links
    -e      if the -P option is supplied, and the current working directory
    cannot be determined successfully, exit with a non-zero status

The default is to follow symbolic links, as if `-L' were specified.

Exit Status:
Returns 0 if the directory is changed, and if $PWD is set successfully when
-P is used; non-zero otherwise.

1,回到当前用户的主目录
#cd ~
2,回到当前用户的主目录 同上条指令
#cd (不带参数)
3,回到上一次的工作目录
#cd -
4,回到根目录
#cd /
5,回到当前目录的父目录
#cd ..
6,把上个命令的参数作为cd参数使用。
#cd !$
7,.表示当前目录
#cd .

相关文章

  • linux cd 命令的几个技巧

    用法: help cd cd: cd [-L|[-P [-e]]] [dir]Change the shell w...

  • cd command

    Linux cd命令使用小技巧: cd 进入用户主目录; cd ~ 进入用户主目录; cd - ...

  • Linux基础命令大全

    Linux教程Linux 常用命令学习 pwd 命令 pwd - 显示当前路径 cd 命令 cd - 切换目录cd...

  • 小菜鸡的实验楼入门

    学习了几个Linux命令 Linux命令---cd: 用来切换工作目录的命令不加参数时,默认切换到用户主目录,即环...

  • 稳固知识点Lunux cd命令

    Linux cd 命令可以说是Linux中最基本的命令语句,其他的命令语句要进行操作,都是建立在使用 cd 命令上...

  • (2)cd命令

    Linux cd命令可以说是Linux中最基本的命令语句,其他的命令语句要进行操作,都是建立在使用cd命令上的。 ...

  • 每天学点Linux命令(一)

    更多内容请关注我的个人博客: 每天学点LInux命令(一) cd命令 cd / ...

  • Linux命令

    Linux命令 linux命令查询网站:https://explainshell.com 常用命令 cd:进入目录...

  • 初学Linux命令

    cd命令 cd命令是Linux中的基本命令 用法及参数: 1.cd 回到用户主目录(cd ~一样) 2.cd te...

  • Linux 指令

    基本的几个指令 终端命令格式 终端命令的几个技巧 ls 延申 cd 拓展 相对路径和绝对路径 touch mkdi...

网友评论

      本文标题:linux cd 命令的几个技巧

      本文链接:https://www.haomeiwen.com/subject/ceryvftx.html