当前位置:网站首页>Directory and switching operation in file system
Directory and switching operation in file system
2022-07-03 09:32:00 【Technology stuff】
cd
cd,change directory, Switch current working directory .
In addition to the specified directory , There are also the following special directories .
.: Current working directory ...: Parent working directory ./: root directory .~: home Catalog , The current user directory , You can also use environment variables$HOMEExpress . Assume that the current user is shanyue, be ~ The catalogue is/Users/shanyue(mac System ).
in addition ,cd - To enter the last working directory , Like git checout - Switch back to the last branch .
$ cd ~
$ cd -
$ cd $HOME
except cd Outside , There is a small tool with powerful function to switch directories autojump.
autojump Manual download is required .
# Switch to include foo A directory of substrings
$ j foo
Q: You know, autojump How it works , You can write a
autojumpCommand line gadgets ?
pwd
pwd,print working directory, Print current working directory .
# Print current path , The directory is react Source content
$ pwd
/Users/shanyue/Documents/react
ls
ls, List the contents of a working directory .
ls A single instruction will not be listed with . Opening file , such as .git、 .babelrc、.eslintrc Will not display by default . While using -a, All documents will be listed .
In daily work , Regular use ls -lah List the contents of the working directory .
# -l: Use long list format
# -a: List all files , Include . Opening file
# -h: Represent the file volume in readable form , such as 100M
$ ls -lah
total 2176
drwxr-xr-x 36 shanyue shanyue 1.1K 6 10 15:45 .
[email protected] 242 shanyue shanyue 7.6K 5 29 09:37 ..
drwxr-xr-x 3 shanyue shanyue 96B 6 10 15:45 .circleci
drwxr-xr-x 3 shanyue shanyue 96B 6 10 15:45 .codesandbox
-rw-r--r-- 1 shanyue shanyue 294B 5 22 2021 .editorconfig
-rw-r--r-- 1 shanyue shanyue 759B 6 10 15:45 .eslintignore
-rw-r--r-- 1 shanyue shanyue 8.4K 6 10 15:45 .eslintrc.js
drwxr-xr-x 14 shanyue shanyue 448B 6 10 15:45 .git
-rw-r--r-- 1 shanyue shanyue 12B 5 22 2021 .gitattributes
drwxr-xr-x 6 shanyue shanyue 192B 9 8 2021 .github
-rw-r--r-- 1 shanyue shanyue 881B 6 10 15:45 .gitignore
-rw-r--r-- 1 shanyue shanyue 7.6K 5 22 2021 .mailmap
-rw-r--r-- 1 shanyue shanyue 9B 6 10 15:45 .nvmrc
-rw-r--r-- 1 shanyue shanyue 546B 6 10 15:45 .prettierignore
-rw-r--r-- 1 shanyue shanyue 363B 5 22 2021 .prettierrc.js
-rw-r--r-- 1 shanyue shanyue 3B 5 22 2021 .watchmanconfig
-rw-r--r-- 1 shanyue shanyue 42K 5 22 2021 AUTHORS
-rw-r--r-- 1 shanyue shanyue 198K 6 10 15:45 CHANGELOG.md
-rw-r--r-- 1 shanyue shanyue 3.5K 5 22 2021 CODE_OF_CONDUCT.md
-rw-r--r-- 1 shanyue shanyue 216B 5 22 2021 CONTRIBUTING.md
-rw-r--r-- 1 shanyue shanyue 1.1K 5 22 2021 LICENSE
-rw-r--r-- 1 shanyue shanyue 5.1K 6 10 15:45 README.md
-rw-r--r-- 1 shanyue shanyue 1.5K 6 10 15:45 ReactVersions.js
-rw-r--r-- 1 shanyue shanyue 400B 5 22 2021 SECURITY.md
-rw-r--r-- 1 shanyue shanyue 671B 9 2 2021 appveyor.yml
-rw-r--r-- 1 shanyue shanyue 1.0K 5 22 2021 babel.config.js
drwxr-xr-x 6 shanyue shanyue 192B 9 4 2021 build
drwxr-xr-x 2 shanyue shanyue 64B 9 4 2021 build2
-rw-r--r-- 1 shanyue shanyue 7.5K 6 10 15:45 dangerfile.js
drwxr-xr-x 23 shanyue shanyue 736B 6 10 15:45 fixtures
-rw-r--r-- 1 shanyue shanyue 220B 5 22 2021 netlify.toml
drwxr-xr-x 1426 shanyue shanyue 45K 9 2 2021 node_modules
-rw-r--r-- 1 shanyue shanyue 7.2K 6 10 15:45 package.json
drwxr-xr-x 39 shanyue shanyue 1.2K 6 10 15:45 packages
drwxr-xr-x 22 shanyue shanyue 704B 9 2 2021 scripts
-rw-r--r-- 1 shanyue shanyue 733K 6 10 15:45 yarn.lock
That's in ls What information does each line represent ? In the next section .
Q: How to configure colors to distinguish directories and files , See the screenshot below .
exa
One ls substitute , Have more friendly colors and richer output , At the same time, more options are supported .
# Support the view git situation
$ exa -lah --git

tree
tree, List the files in a tree view .
This command needs to be downloaded manually .
# macos
$ brew install tree
# centos
$ yum install tree
It can be done by -L Specify the hierarchy , The following instructions can be used for normal work .
# -a: List all files
# -F: Add... To the end of the directory /, Add... To the end of the executable *
# -L: Specify the hierarchy
$ tree packages/react-dom -aF -L 2
packages/react-dom
|-- README.md
|-- client.js
|-- index.classic.fb.js
|-- index.experimental.js
|-- index.js
|-- index.modern.fb.js
|-- index.stable.js
|-- npm/
| |-- client.js
| |-- index.js
| |-- profiling.js
| |-- server.browser.js
| |-- server.js
| |-- server.node.js
| |-- test-utils.js
| `-- unstable_testing.js
|-- package.json
|-- server.browser.js
|-- server.js
|-- server.node.js
|-- src/
| |-- __tests__/
| |-- client/
| |-- events/
| |-- server/
| |-- shared/
| `-- test-utils/
|-- test-utils.js
|-- unstable_testing.classic.fb.js
|-- unstable_testing.experimental.js
|-- unstable_testing.js
|-- unstable_testing.modern.fb.js
`-- unstable_testing.stable.js
8 directories, 25 files
meanwhile , You can also use more advanced exa -T Print tree file .
# -T: --tree, List the files in a tree view
# -L: --level, Specify the hierarchy
$ exa -lah -T -L 2 packages/react-dom

边栏推荐
- The idea of compiling VBA Encyclopedia
- LeetCode每日一题(1362. Closest Divisors)
- 2022-2-14 learning xiangniuke project - generate verification code
- 【Kotlin疑惑】在Kotlin类中重载一个算术运算符,并把该运算符声明为扩展函数会发生什么?
- 制作jetson nano最基本的根文件系统、服务器挂载NFS文件系统
- Windows安装Redis详细步骤
- Crawler career from scratch (I): crawl the photos of my little sister ① (the website has been disabled)
- [solution to the new version of Flink without bat startup file]
- Call the contents of Excel cells opened at the same time - button line feed
- Common formulas of probability theory
猜你喜欢

2022-2-14 learning xiangniuke project - Session Management

Hudi 快速体验使用(含操作详细步骤及截图)

Flink-CDC实践(含实操步骤与截图)
![[kotlin puzzle] what happens if you overload an arithmetic operator in the kotlin class and declare the operator as an extension function?](/img/fc/5c71e6457b836be04583365edbe08d.png)
[kotlin puzzle] what happens if you overload an arithmetic operator in the kotlin class and declare the operator as an extension function?

Hudi 数据管理和存储概述
![[kotlin learning] control flow of higher-order functions -- lambda return statements and anonymous functions](/img/a3/b442508af9b059d279cffb34dee9bf.png)
[kotlin learning] control flow of higher-order functions -- lambda return statements and anonymous functions

Temper cattle ranking problem

Jenkins learning (III) -- setting scheduled tasks

There is no open in default browser option in the right click of the vscade editor

Alibaba cloud notes for the first time
随机推荐
Banner - Summary of closed group meeting
[kotlin learning] classes, objects and interfaces - define class inheritance structure
Flask+supervisor installation realizes background process resident
LeetCode每日一题(931. Minimum Falling Path Sum)
【Kotlin学习】运算符重载及其他约定——重载算术运算符、比较运算符、集合与区间的约定
Hudi学习笔记(三) 核心概念剖析
全球KYC服务商ADVANCE.AI 活体检测产品通过ISO国际安全认证 产品能力再上一新台阶
Usage of pandas to obtain MySQL data
About the configuration of vs2008+rade CATIA v5r22
文件系统中的目录与切换操作
Go language - Reflection
LeetCode每日一题(1024. Video Stitching)
Explanation of the answers to the three questions
【Kotlin疑惑】在Kotlin类中重载一个算术运算符,并把该运算符声明为扩展函数会发生什么?
Jetson Nano 自定义启动图标kernel Logo cboot logo
307. Range Sum Query - Mutable
DSP data calculation error
Detailed steps of windows installation redis
Basic knowledge of database design
LeetCode每日一题(2109. Adding Spaces to a String)
