Linux: How to Make a Directory Command

Linux: How to Make a Directory Command

To create a new directory in Linux, you can use the mkdir command.

The mkdir command allows you to create a new directory with a specified name.

For example, to create a new directory called mydir, you can use the following command:

$ mkdir mydir
So‮ecru‬:www.lautturi.com

This will create a new directory with the name mydir in the current directory.

You can also use the -p option to create a directory and any necessary parent directories in a single command.

For example, to create a new directory called mydir with parent directories dir1 and dir2, you can use the following command:

$ mkdir -p dir1/dir2/mydir

This will create the directories dir1, dir2, and mydir, if they do not already exist.

You can also use the -m option to specify the permissions for the new directory.

For example, to create a new directory called mydir with read, write, and execute permissions for the owner and read and execute permissions for everyone else, you can use the following command:

$ mkdir -m 755 mydir

This will create the mydir directory with the specified permissions.

Note that you will need the appropriate permissions to create a new directory. If you do not have the necessary permissions, you may receive an error message.

You can also use the chmod command to change the permissions of an existing directory. For more information on changing file permissions, you can refer to the documentation for the chmod command.

Created Time:2017-10-30 10:17:45  Author:lautturi