5 Linux Directory Commands Useful for Beginners

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

  1. How to make a directory
  2. How to list directories
  3. How to delete directory
  4. How to use rm command
  5. 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.
ls -ld command
$ tree
This command shows all the Parent and child directories.
The directory ramu has venkat directory.
tree command

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
 
rm -ir command

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

Related posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.