Linux directory switching implementation code example

Linux directory switching implementation code example

Switching files is a common operation in Linux. When you first learn Linux, the first command you come into contact with is file switching.

pwd: Display the current directory

~: root directory

/: root directory

ls: View all files and directories in the current directory

cd usr Switch to the usr directory under this directory

cd ../ Switch to the previous directory

cd / Switch to the system root directory

cd ~ Switch to the user's home directory

cd - switch to the previous directory (go back)

Code Sample

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

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to switch directories efficiently in Linux
  • How to determine whether files and directories exist in Linux shell
  • How to extract file names and directory names from Linux shell
  • How to change the MySQL database directory location under Linux (CentOS) system
  • Find the running nginx directory in Linux system
  • Batch extract all directories and file names under a folder in Linux
  • Detailed explanation of how to find files filtered by time in a directory in Linux
  • How to enter directory/folder in Linux without using CD command

<<:  Introduction to reactive function toRef function ref function in Vue3

>>:  Summary of MySQL usage specifications

Recommend

Detailed steps to install mysql in Win

This article shares the detailed steps of install...

CSS style to center the HTML tag in the browser

CSS style: Copy code The code is as follows: <s...

Webpack loads css files and its configuration method

webpack loads css files and its configuration Aft...

Detailed explanation of Angular routing basics

Table of contents 1. Routing related objects 2. L...

Docker image analysis tool dive principle analysis

Today I recommend such an open source tool for ex...

Two ways to export csv in win10 mysql

There are two ways to export csv in win10. The fi...

vue.js Router nested routes

Preface: Sometimes in a route, the main part is t...

Docker builds python Flask+ nginx+uwsgi container

Install Nginx First pull the centos image docker ...

Installing Win10 system on VMware workstation 14 pro

This article introduces how to install the system...

Linux View File System Type Example Method

How to check the file system type of a partition ...

Html sample code for reading and displaying pictures in a local folder

One purpose Select a local folder on the Html pag...

Implementation of mysql backup strategy (full backup + incremental backup)

Table of contents Design scenario Technical Point...

mysql 5.7.17 winx64.zip installation and configuration method graphic tutorial

Preface: I reinstalled win10 and organized the fi...

10 content-related principles to improve website performance

<br />English address: http://developer.yaho...