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

How to use MySQL common functions to process JSON

Official documentation: JSON Functions Name Descr...

Introduction to general_log log knowledge points in MySQL

The following operation demonstrations are all ba...

MySQL SQL Optimization Tutorial: IN and RANGE Queries

First, let's talk about the in() query. It is...

Implementation of element shuttle frame performance optimization

Table of contents background Solution New Questio...

How to implement vue page jump

1. this.$router.push() 1. Vue <template> &l...

HTML sample code for implementing tab switching

Tab switching is also a common technology in proj...

Common array operations in JavaScript

Table of contents 1. concat() 2. join() 3. push()...

js realizes horizontal and vertical sliders

Recently, when I was doing a practice project, I ...

View the dependent libraries of so or executable programs under linux

View the dependent libraries of so or executable ...

A simple example of creating a thin line table in html

Regarding how to create this thin-line table, a s...

Detailed discussion of the differences between loops in JavaScript

Table of contents Preface Enumerable properties I...

MySQL Series 14 MySQL High Availability Implementation

1. MHA ​By monitoring the master node, automatic ...