当前位置:首页 > 虚拟机 > 正文

虚拟机创建目录命令(虚拟机新建目录命令)

How does ubuntu create multiple folders at once through mkdir
Running environment: ubuntu10.04VMware10
The first step is to open the virtual machine and open the hyperterminal
Step two, create an empty folder and enter #mkdirtest under the home folder. Step three, check the home folder and find that there is an additional test folder. You can also #cdtest to enter the test folder, #ls inside No content
1. Command format:
mkdir[option] directory...
2. Command function:
The mkdir command can be used to create a folder or directory named with DirName (specified file name) at the specified location. The user who creates a folder or directory must have write permissions on the parent folder of the folder being created. Moreover, the created folder (directory) cannot have the same name as the file name in its parent directory (that is, the parent folder), that is, there cannot be a file with the same name in the same directory (case-sensitive).
3. Command parameters:
-m, --mode=mode, set permissions (similar to chmod), instead of rwxrwxrwx minus umask
-p, --parents can be a path name. At this time, if some directories in the path do not exist yet, after adding this option, the system will automatically create those directories that do not yet exist, that is, multiple directories can be created at one time;
-v, --verbose each time Display information every time you create a new directory
--help displays this help information and exits
--version outputs version information and exits
Create directory tree
#mkdir- vpscf/{lib/,bin/,doc/{info,product},logs/{info,product},service/deploy/{info,product}}
mkdir: Directory "scf" has been created
mkdir: The directory "scf/lib" has been created
mkdir: The directory "scf/bin" has been created
mkdir: The directory "scf/doc" has been created
mkdir: The directory "scf" has been created /doc/info”
mkdir: The directory “scf/doc/product” has been created
mkdir: The directory “scf/logs” has been created
mkdir: The directory “scf/logs/info” has been created ”
mkdir: The directory “scf/logs/product” has been created
mkdir: The directory “scf/service” has been created
mkdir: The directory “scf/service/deploy” has been created
mkdir: The directory "scf/service/deploy/info" has been created
mkdir: The directory "scf/service/deploy/product" has been created
#treescf/
scf/
|--bin
|--doc
||--info
|`--product
|--lib
|--logs
||--info
|`--product
`--service
`--deploy
|--info
`--product

12directories,0files

In a virtual machine, how to use commands to create a new file in the current directory?
Hello, the poster,
Just use the touch command.
For example, I want to create three new files in the current directory, and the file names are a, b, and c. Then:
touchabc
-----------------
If you want to create a new directory or folder in the previous directory, use the mkdir command ,
For example, create three new folders in the current directory, and the folder names are dir1dir2dir3, then:
mkdirdir1dir2dir3
--------------- ---
mkdir also has a more commonly used parameter, which is -p. Its function is to create a multi-level directory, even if a certain level directory does not exist, it will be automatically created for us.
Example , the current directory is empty, I want to create directory a under the current directory, then create directory b under directory a, and then create directory c under directory b. If it is troublesome to create one by one, it is extremely simple to use the -p parameter: < br/>mkdir-pa/b/c
I hope the above answer will be helpful to the author, please feel free to ask questions

How to create new files and folders with Linux virtual machine commands

First, let’s talk about the touch command to create files. touch can be used to create binary files, and the usage is very simple. Usage: touch + file name, there must be a space between touch and file name. In the picture, we first use the command shared before to check how many files there are under the / directory and the names of the files.

Enter the Linux system and enter the terminal, enter the command "cd/", and then press the Enter key to go to the root directory. In the root directory, enter "sudomkdir folder name" and press Enter. After entering the administrator password and pressing Enter, the folder is created successfully.

Create a folder mkdir-p folder name p Make sure the directory name exists, if it does not exist, create one.

linuxc create directory command linuxc create directory

How to solve the problem of insufficient permissions to create a directory in linux?

In Linux systems, creating a directory requires write permission on the directory. If you are prompted with insufficient permissions when creating a directory, you can try the following solutions:

1. Use the sudo command: sudo is a command in Linux that can temporarily increase the permissions of the current user. Use the sudo command on the command line, and then execute the command to create the directory.

2. Change the user or group to which the directory belongs: Use the chown command to modify the user or group to which the directory belongs, and add the current user to the group, and then execute the command to create the directory again.

3. Modify directory permissions: Use the chmod command to modify the directory permissions so that the current user has write permissions. For example, setting the permissions of the folder to 777 gives all users read, write, and execute permissions.

The above are three possible solutions. It should be noted that when increasing permissions or modifying folder attributes, please first ensure that you have sufficient operational knowledge and risk awareness, and carefully consider whether to do so. If you are unsure, please consult the system administrator or seek other help. Professional help.

Create a directory (new) in the home directory of the current user (root user) in Linux?

1. First check the current path, enter pwd and press Enter.

2. If the current directory is not the root user directory, you need to enter the root user directory, enter: cd/root, and press Enter to enter the root user directory.

3. To create a new directory, enter the command: mkdirnew and press Enter to successfully create a new directory.

4. To view all files in the current directory, enter the command: ll and press Enter. You can see that the new directory already exists. Extended information: mkdir command: used to create a directory with a specified name. The creating user is required to have permissions in the current directory, and the specified directory name cannot be an existing directory in the current directory. Command format: mkdir command parameters: -m--mode=mode, when creating a directory, set the permissions of the directory at the same time; -p--parents If the upper-level directory created has not been created yet, the upper-level directory will be created together; -v --verbose displays information each time a new directory is created; -h--help help information.

How to create a directory in a Linux virtual machine?

The method of creating a directory in Linux is as follows:

If it is in the graphical interface, it can be created in the following way:

1. Open the file manager (such as dolphin or thunar), then right-click a blank space and select the New-Folder command.

2. Enter the folder name in the pop-up dialog box, and then click the "OK" button.

If it is a command line interface, please create it in the following way:

1. Use the cd command to locate the location where you want to create the directory.

2. Use mkdir directory Create a directory by name.

How to create a directory in Linux?

The method of creating a directory in Linux is as follows:

If it is in the graphical interface, it can be created in the following way:

1. Open the file manager (such as dolphin or thunar), then right-click a blank space and select the New-Folder command.

2. Enter the folder name in the pop-up dialog box, and then click the "OK" button.

If it is a command line interface, please create it in the following way:

1. Use the cd command to locate the location where you want to create the directory.

2. Use mkdir directory Create a directory by name.

How to create a directory in the home directory in Linux?

The steps are as follows.

1. Log in to the Linux system and open the terminal (the shortcut keys for each distribution may be different).

2. Enter the "pwd" command in the terminal and find that it should be in the home directory now. If it is not the home directory, enter the command "cd/username/home", where username is your username.

3. Enter the command "" and a file called "" is successfully created.