Mkdir : Mkdir means make directory, This command is used to create a new directory in current logged user.
a)Create a new directory:
Syntax:$mkdir <directoryname>
Ex:
$mkdir abc
Here if we are checking the created directory using ls command then the directory represented in blue colour and files are in white colour.
We can also create any number of files and directories in current directory.
cd : This command is used to change directory from one dir to other.
b)Change a directory:
Syntax:$cd <directoryname>
Ex:
$cd xyz
In directory we can create file or directory
cd .. : This command is used to come out from current directory.
c)Come out from current directory.
Syntax:$cd ..
Ex:
$cd ..
cd / : This command is used to changes to root directory.
d)Changes root directory.
Syntax:$cd /
Ex:
$cd /
Here we see after cd command dir change to xyz.
Note: use space after cd command when we come out from current directory.
e)Creating multiple directories.
Syntax:$mkdir <directoryname>
Ex:
$mkdir d1 d2 d3
Rm : This command is used for remove directory.
f)Removing directories.
i)$rmdir : This command is used to remove directory but directory must be empty.
Syntax:$rmdir<directoryname>
Ex:
$rmdir xyz
Here, we check dir and files in the current directory by using ls command,Changing dir from current dir to xyz and check weather xyz dir is empty or not by using ls. xyz is not a empty directory.So,if we try to remove this directory it is showing message "Directory not empty".but when we are Then we are deleting a empty directory,we can delete it easily.
ii)Recursively deletes entire directory structure.
Syntax:$rm -r <directoryname
Ex:
$rm -r xyz
iii)Recursively deletes entire directory structure with confirmation.
Syntax:$rm -ri <directoryname>
Ex:
$rm -ri d2
Here press y for yes and n for no.
iv)Recursively deletes entire directory structure forcibly.
Syntax:$rm -rf <directoryname>
Ex:
$rm -rf d3
a)Create a new directory:
Syntax:$mkdir <directoryname>
Ex:
$mkdir abc
Here if we are checking the created directory using ls command then the directory represented in blue colour and files are in white colour.
cd : This command is used to change directory from one dir to other.
b)Change a directory:
Syntax:$cd <directoryname>
Ex:
$cd xyz
In directory we can create file or directory
cd .. : This command is used to come out from current directory.
c)Come out from current directory.
Syntax:$cd ..
Ex:
$cd ..
cd / : This command is used to changes to root directory.
d)Changes root directory.
Syntax:$cd /
Ex:
$cd /
Here we see after cd command dir change to xyz.
Note: use space after cd command when we come out from current directory.
e)Creating multiple directories.
Syntax:$mkdir <directoryname>
Ex:
$mkdir d1 d2 d3
Rm : This command is used for remove directory.
f)Removing directories.
i)$rmdir : This command is used to remove directory but directory must be empty.
Syntax:$rmdir<directoryname>
Ex:
$rmdir xyz
Here, we check dir and files in the current directory by using ls command,Changing dir from current dir to xyz and check weather xyz dir is empty or not by using ls. xyz is not a empty directory.So,if we try to remove this directory it is showing message "Directory not empty".but when we are Then we are deleting a empty directory,we can delete it easily.
ii)Recursively deletes entire directory structure.
Syntax:$rm -r <directoryname
Ex:
$rm -r xyz
Syntax:$rm -ri <directoryname>
Ex:
$rm -ri d2
Here press y for yes and n for no.
iv)Recursively deletes entire directory structure forcibly.
Syntax:$rm -rf <directoryname>
Ex:
$rm -rf d3
No comments:
Post a Comment