Basic Unix commands-2
6. ls command
Syntax ls [options]
Description:
-a shows all file including hidden files
-d If an argument is a directory it only lists its name not
its contents
-p displays a slash(/) in front of all directories
-r reverses the order of how the files are displayed
7. Echo command
It prints the given input string to standard output.(It is same as printf("")
in c programming language).
syntax: eco 'string'
8. mkdir command
This command is used to create a new repository
Syntax: mkdir [options] [directory name]
All options can be used as per requirements
directory name is the mane of the folder which you want to create
-m set permission mode (as in chmode)
-p No error if existing, make parent directories as needed.
-v Print a message for each created directory
directory name is the mane of the folder which you want to create
-m set permission mode (as in chmode)
-p No error if existing, make parent directories as needed.
-v Print a message for each created directory
9. rmdir command
Description:
It is used to delete a directory and its subdirectories.
it only removes empty directory.
it only removes empty directory.
Syntax:
rmdir [options] [directory name]
10. rm command
It is used to remove the file from the directory.
Note: the rmdir is to delete folder where as rm is to delete files
Syntax: rm [options] [file name]
Description:
- Deleted file can't be recovered.
- rm can't delete the directory.
- All files can be deleted at once just by using * (asterisk). i.e., rm *
-f ignore non-existent files, and never prompt before
removing.
-i Asks for confirmation before every removal
Comments