The OS package includes a variety of functions to implement many of the functions of the operating system. This bag is very complicated. Some of the commands for the OS package are for file management. We list the most common ones here:
MkDir creates a new directory, path is a string that represents the path to the new directory. Equivalent to the $mkdir command
RmDir (path) deletes the empty directory, path is a string that represents the path of the directory you want to delete. Equivalent to the $rmdir command
Listdir (path) returns all files in the directory. Equivalent to the $ls command.
Remove path deletes the file that the path points to.
Rename (src, DST) renames the file, SRC and DST are two paths, each representing the path before and after renaming.
chmod (path, mode) changes the permissions of the file that the path points to. Equivalent to the $chmod command.
Chown (path, UID, GID) changes the owner and owning group of the file that the path points to. Equivalent to the $chown command.
Stat (path) looks For additional information about the file that the path points to, equivalent to the $ls-l command.
Symlink (SRC, DST) creates a soft link for the file DST, src for the path of the soft link file. Equivalent to the $ln-s command.
GETCWD () queries the current working path (CWD, working directory), equivalent to the $PWD command.
2. Shutil Bag
Copy (SRC, DST) copies files from Src to DST. Equivalent to the $CP command.
Move (SRC, DST) moves files from Src to DST. Equivalent to the $MV command.
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service