当前位置:网站首页>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

边栏推荐
- 【Kotlin学习】类、对象和接口——定义类继承结构
- LeetCode每日一题(2212. Maximum Points in an Archery Competition)
- [kotlin puzzle] what happens if you overload an arithmetic operator in the kotlin class and declare the operator as an extension function?
- [solution to the new version of Flink without bat startup file]
- Notes on numerical analysis (II): numerical solution of linear equations
- Powerdesign reverse wizard such as SQL and generates name and comment
- Spark 集群安装与部署
- Call the contents of Excel cells opened at the same time - button line feed
- LeetCode每日一题(2090. K Radius Subarray Averages)
- WARNING: You are using pip version 21.3.1; however, version 22.0.3 is available. Prompt to upgrade pip
猜你喜欢

Flink学习笔记(十一)Table API 和 SQL

NPM install installation dependency package error reporting solution

Crawler career from scratch (I): crawl the photos of my little sister ① (the website has been disabled)

【点云处理之论文狂读前沿版11】—— Unsupervised Point Cloud Pre-training via Occlusion Completion

Temper cattle ranking problem

Learning C language from scratch -- installation and configuration of 01 MinGW

IDEA 中使用 Hudi

【Kotlin疑惑】在Kotlin类中重载一个算术运算符,并把该运算符声明为扩展函数会发生什么?

2022-2-14 learning xiangniuke project - Session Management

About the configuration of vs2008+rade CATIA v5r22
随机推荐
2022-2-14 learning xiangniuke project - Session Management
Jestson Nano自定义根文件系统创建(支持NVIDIA图形库的最小根文件系统)
Build a solo blog from scratch
Matlab dichotomy to find the optimal solution
LeetCode每日一题(516. Longest Palindromic Subsequence)
[set theory] order relation (chain | anti chain | chain and anti chain example | chain and anti chain theorem | chain and anti chain inference | good order relation)
NPM install installation dependency package error reporting solution
【点云处理之论文狂读前沿版11】—— Unsupervised Point Cloud Pre-training via Occlusion Completion
2022-2-13 learning xiangniuke project - version control
Spark structured stream writing Hudi practice
Construction of simple database learning environment
Jetson Nano 自定义启动图标kernel Logo cboot logo
Hudi learning notes (III) analysis of core concepts
Filter comments to filter out uncommented and default values
Windows安装Redis详细步骤
ERROR: certificate common name “www.mysql.com” doesn’t match requested host name “137.254.60.11”.
【毕业季|进击的技术er】又到一年毕业季,一毕业就转行,从动物科学到程序员,10年程序员有话说
CATIA automation object architecture - detailed explanation of application objects (III) systemservice
文件系统中的目录与切换操作
The idea of compiling VBA Encyclopedia
