Linux commands to create files and directories

Here are the Linux commands to create and use files and directories:

cd–Change to another current working directory

pwd–Print the name of the current working directory

mkdir–Create a directory

chmod–Change the permission on a file or directory

ls–List the contents of a directory

The following instructions explain how to create directories within your home directory, move among the directories and set appropriate file permissions:

1) First, go to your home directory by simply typing cd. To check that you are in the home directory, type pwd.

2) Create a new directory called test in your home directory:

$ mkdir test

3) Check the permissions of the directory by typing:

$ ls -ld test

4) To change permissions, use the chmod command:

$ chmod 700 test

This will change the permissions of the directory to give you complete acess and everyone else no access at all.

5) Make the test directory your current directory as follows:

$ cd test

Subscribe / Share

Article by Admin

Authors bio is coming up shortly. Admin tagged this post with: , , , , , , , , , Read 528 articles by Admin
It's very calm over here, why not leave a comment?

Leave a Reply

You must be logged in to post a comment.