博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux 命令行快速切换回切换目录之前的目录
阅读量:4228 次
发布时间:2019-05-26

本文共 769 字,大约阅读时间需要 2 分钟。

看到这个标题,是不是感觉有点绕?Linux 下的 cd (change directory)命令相信大家都用过,虽然不敢说是大家使用最多的命令,但至少算使用最多之一的了吧!

快速切换回切换目录之前的目录(cd -)

[root@master ruby_learning]# pwd/root/ruby_learning[root@master ruby_learning]# cd /usr/local/src/[root@master src]# pwd/usr/local/src[root@master src]# cd -/root/ruby_learning[root@master ruby_learning]# pwd/root/ruby_learning

快速切换回用户 home 目录(cd ~)

如果是 root 用户,home 目录就是 /root, 如果不是 root 用户,home 目录就是 /home/<username> 目录

[root@master ruby_learning]# cd ~[root@master ~]# pwd/root[looking@master ruby_learning]$ pwd/home/looking/ruby_learning[looking@master ruby_learning]$ cd ~[looking@master ~]$ pwd/home/looking[looking@master ~]$

快速切换回上级目录(cd ..)

[root@master ruby_learning]# pwd/root/ruby_learning[root@master ruby_learning]# cd ..[root@master ~]# pwd/root

 

转载地址:http://icjqi.baihongyu.com/

你可能感兴趣的文章
A Developer's Guide to SQL Server 2005
查看>>
Active Directory Cookbook, 2nd Edition
查看>>
Designing and Developing Scalable IP Networks
查看>>
Bluetooth Demystified
查看>>
SWT (Developer's Notebook)
查看>>
Java 2: The Complete Reference, Fifth Edition
查看>>
Java Programming on Linux
查看>>
Microsoft Access VBA Programming for the Absolute Beginner, Second Edition
查看>>
Content Networking: Architecture, Protocols, and Practice
查看>>
Managing Agile Projects
查看>>
Creating a Digital Home Entertainment System with Windows Media Center
查看>>
Java Concurrency in Practice
查看>>
Red Hat Fedora 5 Unleashed
查看>>
AdvancED Flash Interface Design (Advanced Design)
查看>>
Quartz Job Scheduling Framework: Building Open Source Enterprise Applications
查看>>
C++ GUI Programming with Qt 4
查看>>
Effective Use of Microsoft Enterprise Library: Building Blocks for Creating Enterprise Applications
查看>>
Java For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
查看>>
Moodle E-learning Course Development
查看>>
VoIP For Dummies
查看>>