Here are useful beginner Linux directory commands. Why do I use the term beginner? These are such must-know commands. And, even an experienced Linux engineer if know these commands can do his job well.
Linux Directory Commands
- How to make a directory
- How to list directories
- How to delete directory
- How to use rm command
- How to use rm-rf command
How to make a directory
$ mkdir ramu This is the basic commnd to create a directory
How to list directories
$ ls -ld ramu It displays details of ramu directory. The first letter d denotes directory.
$ tree This command shows all the Parent and child directories. The directory ramu has venkat directory.
How to delete a directory
$ rmdir ramu When the directory is not empty, the rmdir will not work.
There is a command you can delete parent and sub-directory interactively using the rm -ir command.
$ rm -ir ramu
How to use rm -rf command
Using this you can remove all the directories and files without interaction. This is a dangerous command and you must avoid always it. It removes all the files permanently, so you may miss some crucial data.
$ rm -rf ramu
You must be logged in to post a comment.