linux bash路径
[rps-include post=6835]
[rps-include post = 6835]
A simple shell command echo pof tut
consist of command itself followed by arguments, separated by spaces. Also more complex command can be created. Generally simple commands are used and after execution exit status is provided by wait pid.
一个简单的shell命令echo pof tut
由命令本身,后跟参数(由空格分隔)组成。 也可以创建更复杂的命令。 通常使用简单的命令,执行后退出状态由wait pid提供。
$ echo pof tut
pof tut
目录和路径 (Directories and Paths)
While working with bash we use paths, file names, directories etc. As you can see below there is a tilde ~ at the end of the prompt which means current working directory is home of the current user.
使用bash时,我们使用路径,文件名,目录等。正如您在下面看到的,在提示符末尾有一个波浪号〜,这表示当前工作目录是当前用户的家。
[[email protected] ~]$
You may want to change directory. cd is command used to change directory. For example to change into /etc run following command.
您可能要更改目录。 cd是用于更改目录的命令。 例如,要更改为/ etc,请运行以下命令。
[[email protected] ~]$ cd /etc
[[email protected] etc]$
We changed only single level directory but there are alternatives like changing more than one level directory.
我们只更改了一个级别的目录,但还有其他一些选择,例如更改多个级别的目录。
[[email protected] ~]$ cd /etc/systemd/
[[email protected] systemd]$
Simple way to go current users home directory is just issuing cd command. After issuing command we can see tilde that means current users home directory.
进入当前用户主目录的简单方法是发出cd命令。 发出命令后,我们可以看到代字号,它表示当前用户的主目录。
[[email protected] etc]$ cd
[[email protected] ~]$
As you know directories are a tree hierarchy. To go upper directory cd .. command is used. In bash .. mean upper/parent directory.
如您所知,目录是树层次结构。 要进入上层目录,请使用cd ..命令。 在bash ..中表示上/上级目录。
[[email protected] ~]$ cd ..
[[email protected] home]$
To point current working directory . is used. When calling a script that resides in current directory the following command is given.
指向当前工作目录。 用来。 当调用驻留在当前目录中的脚本时,将给出以下命令。
$ ./test.sh
[rps-include post=6835]
[rps-include post = 6835]
翻译自: https://www.poftut.com/linux-bash-directories-changing-current-working-path/
linux bash路径