You create folders using the mkdir command:
$ mkdir fruits
You can create multiple folders with one command:
$ mkdir dogs cars
You can also create multiple nested folders by adding the -p option:
$ mkdir -p fruits/apples
Options in UNIX commands commonly take this form. You add them right
after the command name, and they change how the command behaves. You
can often combine multiple options, too.
You can find which options a command supports by typing man <commandname>.
Try now with 'man mkdir' for example
$ man mkdir
(press the 'q' key to esc the 'man page').
Man pages are the amazing built-in help for UNIX.
To create a new folder/directory
mkdir foldername
To view the contents of your folder
cd foldername -- to get inside the folder
then
ls or dir -- to view contents of the folder
To create a new file
touch example.txt -- filename and extension eg .js .html .txt
$sudo mkdir -m777 newFileName
777 is the permissions given to the file
For more info:( https://www.pluralsight.com/blog/it-ops/linux-file-permissions )
# Python program to explain os.makedirs() method
# importing os module
import os
# Leaf directory
directory = "Nikhil"
# Parent Directories
parent_dir = "D:/Pycharm projects/GeeksForGeeks/Authors"
# Path
path = os.path.join(parent_dir, directory)
# Create the directory
# 'Nikhil'
os.makedirs(path)
print("Directory '% s' created" % directory)
# Directory 'GeeksForGeeks' and 'Authors' will
# be created too
# if it does not exists
# Leaf directory
directory = "c"
# Parent Directories
parent_dir = "D:/Pycharm projects/GeeksforGeeks/a/b"
# mode
mode = 0o666
path = os.path.join(parent_dir, directory)
# Create the directory 'c'
os.makedirs(path, mode)
print("Directory '% s' created" % directory)
# 'GeeksForGeeks', 'a', and 'b'
# will also be created if
# it does not exists
# If any of the intermediate level
# directory is missing
# os.makedirs() method will
# create them
# os.makedirs() method can be
# used to create a directory tree