Linux基础命令- cd

Linux基础命令- cd

  • 作用:切换目录 语法:cd 目录名
  • cd ~ #回到当前用户的宿主(家)目录
  • cd … #表示返回到上级目录位置,也就是父目录
  • cd . #表示进入到当前目录
  • cd - #表示返回切换前的目录
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# cd	#回到当前用户的宿主(家)目录
[root@localhost ~]# cd ~	#回到当前用户的宿主(家)目录
[root@localhost ~]# pwd		#显示当前工作目录的路径
/root
[root@localhost ~]# cd ..	#表示返回到上级目录位置,也就是父目录
[root@localhost /]# pwd
/
[root@localhost /]# cd .	#表示进入到当前目录
[root@localhost /]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# cd -	#表示返回切换前的目录

猜你喜欢

转载自blog.csdn.net/m0_67159981/article/details/128699164
今日推荐