- 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.