登录linux,输入ls显示anaconda-ks.cfg cobbler.ks ....., 原因在于root@ ~ / 区别

 今天登录linux测试机,想要创建目录,ls的时候,找不到之前的的目录,才发现是目录不对的问题。

首先,先要弄清楚 [root@330c353813ea ~] 和 [root@330c353813ea /] 区别

 [root@330c353813ea ~]  是linux主目录,相当于/root

 [root@330c353813ea /] 是根分区,相当于根目录

➜ ~ ssh root@xxx       //登录linux
root@xxx's password:    //输入密码
Last login: Thu Dec 27 16:19:57 2018 from 172.24.36.37
[root@330c353813ea ~]# pwd  //查看目前所在的工作目录的绝对路径
/root
[root@330c353813ea ~]# ls   //显示当前目录下的内容
anaconda-ks.cfg cobbler.ks install.log install.log.syslog ks-post.log ks-post-nochroot.log ks-pre.log
[root@330c353813ea ~]# cd /  //进入根目录
[root@330c353813ea /]# pwd  

[root@330c353813ea /]# ls   
alc alphacloud_info boot dev home lib64 lost+found misc net proc root selinux srv sys usr
alphacloud_env bin cgroup etc lib libexec media mnt opt python-supervisord-3.1.3-5.x86_64.rpm sbin share supervisord-after-install.sh tmp var
[root@330c353813ea /]# cd home/
[root@330c353813ea home]# ls
sysadmin sysrd project
[root@330c353813ea home]#

 

转载于:https://www.cnblogs.com/renzm0318/p/10185737.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值