Linux 中【./】和【/】和【.】之间有什么区别?目录

Linux 中【./】和【/】和【.】之间有什么区别?

/是指根目录,就和Windows的我的电脑那个位置差不多。
./是指用户所在的当前目录。
如下所示:
[root~]# cd /etc
[root etc]# pwd
/etc
[rootetc]# cd /
[root /]# pwd
/
[root /]# cd /etc
[rootetc]# cd ./
[rootetc]# pwd
/etc
[root etc]#

 

下面是linux cd命令使用小技巧:
(1)cd 进入用户主目录
(2)cd ~ 进入用户主目录
(3)cd - 返回进入此目录之前所在目录
(4)cd .. 返回上一级目录
(5)cd ../..返回上两级目录
(6)cd !$ 把上个命令的参数作为cd 参数使用 

 

.表示执行的意思,就是执行这个文件
./呢就表示执行当前目录下的某个文件,就比如当前目录有一个脚本a.sh,那么./a.sh就表示执行它

. 当前工作目录

./ 也是当前工作目录 不过一般这种写法后面都跟一个脚本文件 用来执行脚本

    <span style="margin-left: 10px; font-weight: bold">作者:<a style="text-decoration: none; color: blue" href="https://www.cnblogs.com/mhq-martin/" target="_blank">mhq</a> —— <b style="color: red">mhq_martin</b></span>
    <br><br>
    <span style="margin-left: 10px; font-weight: bold">出处:<a style="text-decoration: none; color: blue" href="https://www.cnblogs.com/mhq-martin/" target="_blank">https://www.cnblogs.com/mhq-martin/</a></span>
    <br><br>
    <span style="margin-left: 10px; font-weight: bold; color: red">本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。</span>
</p>

分类: 7 Linux
<div id="blog_post_info">
0
0
<div class="clear"></div>
<div id="post_next_prev">

<a href="https://www.cnblogs.com/mhq-martin/p/11489227.html" class="p_n_p_prefix">« </a> 上一篇:    <a href="https://www.cnblogs.com/mhq-martin/p/11489227.html" title="发布于 2019-09-08 23:30">卷积</a>
<br>
<a href="https://www.cnblogs.com/mhq-martin/p/11537690.html" class="p_n_p_prefix">» </a> 下一篇:    <a href="https://www.cnblogs.com/mhq-martin/p/11537690.html" title="发布于 2019-09-17 22:24">ping-pong buffer</a>
posted @ 2019-09-15 16:22  mhq_martin  阅读( 967)  评论( 0编辑  收藏
</div><!--end: topics 文章、评论容器-->
    <div id="google_ads_iframe_/1090369/C2_0__container__" style="border: 0pt none;"><iframe id="google_ads_iframe_/1090369/C2_0" title="3rd party ad content" name="google_ads_iframe_/1090369/C2_0" width="468" height="60" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" srcdoc="" style="border: 0px; vertical-align: bottom;" data-google-container-id="adc2f9b0638cdf98b28d64a19936c911" data-load-complete="true"></iframe></div></div>
</div>
<div id="under_post_kb">
<div id="sideBar">
	<div id="sideBarMain">
时钟canvas
		<div id="blog-calendar" style="display: block;">
< 2020年2月 >
262728293031 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
1 2 3 4 5 6 7
		<div id="leftcontentcontainer">
			<div id="blog-sidecolumn">

我的随笔

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值