0% found this document useful (0 votes)
35 views1 page

How To Create Files and Directories

Uploaded by

Ranjeet Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views1 page

How To Create Files and Directories

Uploaded by

Ranjeet Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

- Files can be create in multiple ways.

However,
directories can only be created with one command.

- Creating File with touch command:


Examples:
#- touch file1
#- ls
#- touch file2 file3 file4
#- ls
Note : If the file already exists, it will update the
timestamp on it to the current date and time.

- Creating files with vi editor:


Examples:
#- vi filename
- add text
- save and exit

- Creating directories using mkdir command:


Examples:
#- mkdir dir1
To create a directory called dir1

#- mkdir a b c
To create 3 directories a b c.

#- mkdir -p 1/2/3
To create hierarchy of sub-directories.

You might also like