How to create file and directory on CentOS and RHEL 6/7 step by step guide


How to create file and directory  on CentOS and RHEL 6/7  step by step guide

In this article we will learn how to create file and directory  on linux system which is very common task for a linux administrator.  

How to create file on CentOS and RHEL  linux system


To create a blank file of the linux system we need to execute the below command.

#touch  <filename>

Lets take an example we are going to create one blank file named test.so we need to execute the below command.

#touch  test

After execute the above command we can verify it using ls command.
How to create file and directory  on CentOS and RHEL 6/7  step by step guide
How to create file and directory  on CentOS and RHEL 6/7  step by step guide


We can create multiple files using the below command.

#touch <file1> <file2> <file3> <file4>

And  also we can create a file using vi editor.

How to create  directoy on linux system

To create directory on linux system we need to use mkdir coammnd.

#mkdir <dir name>
Suppose  we are going to create one  dir named testdir ,we need to execute the below command.

#mkdir testdir

How to create  directoy  within parent directory on linux system

To create a directory within parent dir on linux system we need to use mkdir coammnd along with –p flag.


That’s all. If this article is helpful please share it!!!!




SHARE

Admin

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment