linux bash路径_Linux Bash目录和不断变化的当前工作路径

linux bash路径

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]

LEARN MORE  Linux pwd Command Tutorial With Examples
了解更多Linux pwd命令教程和示例

翻译自: https://www.poftut.com/linux-bash-directories-changing-current-working-path/

linux bash路径

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值