I. File rename and move (MV) In Linux, renaming files is called moving (moving). The MV command can move files and directories to another location or rename them. 1.1 Using the MV RenameBelow/usr/local create an empty file as test, using the MV
RmDir is a commonly used command, the function of which is to delete an empty directory before a directory is deleted must be empty. (Note that the Rm-r dir command can be used instead of rmdir, but there is a lot of danger.) You must also have
The unlink () function deletes files, the mkdir () function creates directories, and the rmdir () function deletes directories.
Copy codeThe Code is as follows:
unlink () function instance
// Use the unlink function to delete an object
$
Explains how to use the PHP function rmdir. In PHP, there are many functions for programming, and their functions are also very powerful. Today we will introduce to you that PHP is a type of function embedded in HTML and server in PHP. There are
deleting files and directories in PHP is actually very simple as long as two functions one is unlink a rmdir function, if you want to implement delete directories and directories under the file we need to use the recursive operation. This article
The content originates from the people's post and Telecommunications press "Linux command Application big dictionary"tell 729 commands, 1935 examplesLearn about the Linux system's reference books, desk book, encountered the command or command not
1. Introduction
rmdir command usage: rmdir [options] ... Directory...Delete the directory if has no data.2. Option:--ignore-fail-on-non-emptyIgnore any errors caused by the directory still has data-P,--parents Remove DIRECTORY and its ancestors. e.
RmDir Delete Empty Directory
The code is as follows
Copy Code
?To delete a directory using the RmDir function$dirname = "Mydir"; Defining variablesRmDir ($dirname);?>
Delete directory successful reaction ture,
I. Absolute path and relative path
Absolute path
For example, the command to modify the NIC configuration fileVi/etc/sysconfig/network-scripts/ifcfg-ens33Over here/etc/sysconfig/network-scripts/ifcfg-ens33is the absolute path, the
in the The directory creation in Linux is to use mkdir, that has the command to create directories naturally have the command to delete directories, the command to delete directories is rmdir. Command format:rmdir [ options ] directoryParameter
Directory management class commands for Linux commands: mkdir, rmdir, tree, DirName, basenamemkdir command: Create a new directorySyntax: mkdir [OPTION]/path/to/somewhereCommon parameter options:-P: Create parent Directory-V: Show creation
1, the recursive method: the use of recursive one layer of deletion.
Copy Code code as follows:
Deletedir ($dir)
{
if (RmDir ($dir) ==false && is_dir ($dir)) {
if ($DP = Opendir ($dir)) {
while (($file=readdir ($DP))!= false)
#学习内容来自莫烦pythonmkdir Creating a foldermkdir (make directory) is the idea of creating a folder, which is simple to use.$ mkdir Folder2If you want to create a folder for Folder2 inside this directory is Ok.$ mkdir FOLDER2/F2In this way, the F2 folder
The unlink () function deletes files, the mkdir () function creates directories, and the rmdir () function deletes directories.Copy codeThe Code is as follows: unlink () function instance // Use the unlink function to delete an object$ Filename =
1,Mkdir
-M, -- mode = mode set file mode (as in chmod), not a = rwx-umask
-P, -- parents no error if existing, make parent directories as needed
Mkdir-P dir1/dir2 // IfDir1Does not exist, also createDir1
Mkdir-M 755/usr/dir3 // and setMode
2,
This address: http://blog.csdn.net/a_ran/article/details/25250583A special version of the RMDIR command was implemented when learning Linux system programming.Because rmdir can only delete empty folders, and I implement the function equivalent to RM-
Command format:rmdir [Options] Directory
Command function:use only to delete empty folders
Command parameters:- p Recursive Delete, when the subdirectory is deleted and its parent directory is empty- v displays detailed process information
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.