Linux目录切换实现代码案例
文件目录切换在linux中是很常见的操作,刚学linux时,最先接触到的命令就是文件切换。
pwd:显示当前所在目录
~:root目录
/:根目录
ls:查看当前目录下所有的文件和目录
cd usr 切换到该目录下usr目录
cd ../ 切换到上一层目录
cd / 切换到系统根目录
cd ~ 切换到用户主目录
cd - 切换到上一个所在目录(返回)
代码实例
yangw@codecompile:~/RK3288_Lakala/kernel/arch/arm/boot/dts$ cd - /home/yangw yangw@codecompile:~$ pwd /home/yangw yangw@codecompile:~$ cd - /home/yangw/RK3288_Lakala/kernel/arch/arm/boot/dts yangw@codecompile:~/RK3288_Lakala/kernel/arch/arm/boot/dts$ pwd /home/yangw/RK3288_Lakala/kernel/arch/arm/boot/dts yangw@codecompile:~/RK3288_Lakala/kernel/arch/arm/boot/dts$ cd ~ yangw@codecompile:~$ pwd /home/yangw yangw@codecompile:~$ cd / yangw@codecompile:/$ pwd / yangw@codecompile:/$ cd - /home/yangw
相关推荐
farwang 2020-11-25
星愿心愿 2020-11-24
tianhuak 2020-11-24
zhjn0 2020-11-24
昭君出塞 2020-11-23
bluecarrot 2020-11-23
linuxwcj 2020-10-21
以梦为马不负韶华 2020-10-20
彼岸随笔 2020-10-20
yutou0 2020-10-17
applecarelte 2020-10-16
ourtimes 2020-10-16
waterhorse 2020-09-19
MRFENGG 2020-11-11
rainandtear 2020-10-30
kyssfanhui 2020-10-20
liuhangtiant 2020-10-20