![]() You may also use the -p option with a single directory. This is what the above command created: :~/tuts$ mkdir -p dir1/dir2/dir3/dir4 This is particularly helpful when you want to create a directory structure or if you want to make sure that the directory path exists. If the parent directory doesn’t exist, it will create it for you. You can use the option -p to create a nested directory structure. You may also create nested directories which is described in the next section. You may also create several new directories with a single command: mkdir new_dir_1 new_dir_2 new_dir_3Īll the new directories are created at the same level. :~/tuts$ mkdir new_dir/another_new_dirĢ directories, 0 files Create multiple directories You may also specify the path to where you want to create the new directory. ![]() :~/tuts$ lsĭrwxrwxr-x 2 abhishek abhishek 4096 May 14 16:15 new_dir This will create a new directory named new_dir in the present directory. To make a new directory, use mkdir command without any option: mkdir new_dir Here’s the syntax: mkdir directory_name_or_path The mkdir command is one of the rare few Linux commands that doesn’t have tons of options. In this beginner series, you’ll learn to use the mkdir command. The mkdir allows you to make new directories (folders in common term) in Linux. One of the essential Linux commands is mkdir.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |