Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the cd command in linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to use the cd command in linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Cd of the linux command

Cd command

Basic operation of directory

The cd command is used to switch the working directory to dirname. The dirName representation can be an absolute path or a relative path. If the directory name is omitted, change to the user's home directory (that is, the directory where the login was just located). In addition, ~ also means home directory. It indicates the directory where it is currently located. Represents the directory above the current directory location.

Grammar

Cd (option) (parameter) option

-p if the target directory you want to switch to is a symbolic link, switch directly to the target directory that the symbolic link points to-L if the target directory you want to switch is a symbolic connection, switch directly to the directory represented by the character connection name, not the target directory that the symbolic link points to. -when only the "-" option is applied, the current working directory will be changed to the directory represented by the environment variable "OLDPWD". Example

Cd enters the user's home directory; cd ~ enters the user's home directory; cd-returns the directory where it was before; cd. Return to the parent directory (if the current directory is "/", it will still be "/"; ".." after execution. " For the meaning of superior directory); cd.. /.. Return to the upper two-level directory; cd! $uses the parameter of the previous command as the cd parameter. Thank you for reading! This is the end of the article on "how to use cd commands in linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report