Linux commands to create and remove the directories/sub-directories
mkdir command with options
kodingwindow@kw:~$ ls
a.out  kw.cpp   kw.py    Documents  Music     Public     Videos
kw.c   KW.java  Desktop  Downloads  Pictures  Templates  Weekdays

kodingwindow@kw:~$ pwd
/home/kodingwindow

kodingwindow@kw:~$ mkdir Linux
kodingwindow@kw:~$ cd Linux/

kodingwindow@kw:~/Linux$ pwd
/home/kodingwindow/Linux

kodingwindow@kw:~/Linux$ ls kodingwindow@kw:~/Linux$ mkdir -p Flavours/{Ubuntu/{Ubuntu_18.04,Ubuntu_20.04},Fedora/{Fedora_31,Fedora_32}} kodingwindow@kw:~/Linux$ ls Flavours kodingwindow@kw:~/Linux$ cd Flavours/Ubuntu/ kodingwindow@kw:~/Linux/Flavours/Ubuntu$ ls Ubuntu_18.04 Ubuntu_20.04 kodingwindow@kw:~/Linux/Flavours/Ubuntu$ cd .. kodingwindow@kw:~/Linux/Flavours$ ls Fedora Ubuntu kodingwindow@kw:~/Linux/Flavours$ mkdir -m a=r KaliLinux kodingwindow@kw:~/Linux/Flavours$ ls Fedora KaliLinux Ubuntu kodingwindow@kw:~/Linux/Flavours$ ls -l total 12 drwxrwxr-x 4 kodingwindow kodingwindow 4096 Jun 13 12:03 Fedora dr--r--r-- 2 kodingwindow kodingwindow 4096 Jun 13 12:04 KaliLinux drwxrwxr-x 4 kodingwindow kodingwindow 4096 Jun 13 12:03 Ubuntu kodingwindow@kw:~/Linux/Flavours$ mkdir -v CentOS LinuxMint mkdir: created directory 'CentOS' mkdir: created directory 'LinuxMint' kodingwindow@kw:~/Linux/Flavours$ ls CentOS Fedora KaliLinux LinuxMint Ubuntu
rmdir command with options
kodingwindow@kw:~/Linux/Flavours$ rmdir CentOS/
kodingwindow@kw:~/Linux/Flavours$ ls
Fedora  KaliLinux  LinuxMint  Ubuntu

kodingwindow@kw:~/Linux/Flavours$ rm -r KaliLinux/
rm: remove write-protected directory 'KaliLinux/'? y

kodingwindow@kw:~/Linux/Flavours$ ls
Fedora LinuxMint Ubuntu

kodingwindow@kw:~/Linux/Flavours$ cd
kodingwindow@kw:~$ ls
a.out  kw.cpp   kw.py    Documents  Linux  Pictures  Templates  Weekdays
kw.c   KW.java  Desktop  Downloads  Music  Public    Videos

kodingwindow@kw:~$ rm -rf Linux/
kodingwindow@kw:~$ ls
a.out  kw.cpp   kw.py    Documents  Music     Public     Videos
kw.c   KW.java  Desktop  Downloads  Pictures  Templates  Weekdays
kodingwindow@kw:~$ 
Advertisement