Create directories using mkdir
A note on notation:
Directories is a great place to store and organize files, and creating them is easy. The
mkdir command is used to create directories. To create a directory we can use the
mkdir command followed by the name of the directory we wish to create.
Note: the three periods follow an arguments in the description in above, it means that the arguments can be repeated.
$ mkdir foo $ ls -l drwxr-xr-x 2 bindi staff 68 15 Sep 23:17 foo
$ mkdir foo bar $ ls -l drwxr-xr-x 2 bindi staff 68 15 Sep 23:17 foo drwxr-xr-x 2 bindi staff 68 15 Sep 23:17 bar
Create Intermediate Directories (
mkdir command allows us to create nested directories using the
$ mkdir -p foo/bar/now $ ls -la /foo/bar/now total 0 drwxr-xr-x 2 robin staff 68 16 Sep 00:38 . drwxr-xr-x 3 robin staff 102 16 Sep 00:38 ..
Above shos the
ls command to see that
now directory exists and currently empty.
Verbose Output (
mkdir command supports a verbose mode flag,
-v . Adding the
-v flag will print the results of
mkdir to the console.
$ mkdir -v foo madir: created directory 'foo'
-v flag can provide useful report when writing scripts with lot of commands.
- Dependency injection
- Directives and Pipes
- Data binding
- HTTP Get vs. Post
- Node.js is everywhere
- MongoDB root user
- Prefer Async Script Loading
- Components, Bootstrap and DOM
- What is HEAD in git?
- Show the changes in Git.
- What is AngularJS 2?
- Confidence Interval for a Population Mean
- Accuracy vs. Precision
- Sampling Distribution
- Working with the Normal Distribution
- Standardized score - Z score
- Evaluating the Normal Distribution
- What is Nodejs? Advantages and disadvantage?
- How do I debug Nodejs applications?
- Sync directory search using fs.readdirSync