I. Directory/file related operations:
1. Create a directory :
mkdir Options Directory
Parameters:
-p recursively Create a directory
For example:
Create the Uzz directory in the root directory [[Email protected] /]# mkdir uzz[[email protected] /]# ls /12 bin data1 home lost+found Opt sbin sys uzz123 boot dev lib media proc selinux tmp varabc data etc lib64 mnt root srv usr xxl[[email protected] /] #在uzz目录下创建xk目录, and then create the WLGC directory under the XK directory [[email protected] uzz]# mkdir -p xk/wlgc[[email protected] uzz]# lsxk[[email protected] uzz]# ls xkwlgc[[email protected] uzz]# : Relative and absolute paths in Linux: Absolute paths are defined from the root/ The starting path, such as /etc/sysconfig/Network-scripts/ifcfg-eth0 the relative path does not start at the root, starting with the current path, that is.
2. List the directories:
The LS directory is listed in the directory
Tree directory name View directory trees
Example: List content in the mnt folder [[email protected] uzz]# Ls/mntcdrom[[email protected] uzz]# recursively lists Uzz directory tree [[email protected] uzz]# Tree/uzz /UZZ└──XK└──WLGC2 directories, 0 files[[email protected] uzz]# add: Use the tree command to install the tree first, install the method: Yum Install Tree–y installation is complete There is garbled, execution: lang=en can be solved
3. Switch directories
CD Directory Name
Example: Switch to the Uzz directory
[Email protected]/]# Cd/uzz [[email protected] uzz]#
4. View current directory
Pwd
[Email protected] uzz]# Pwd/uzz [[email protected] uzz]#
5. Delete a folder
RM parameter File/folder
-F Force Delete
-R Delete Folder
Example: Force Delete 12 Folder
[[Email protected] ~]# ls /12 bin data1 home lost+found opt sbin sys uzz123 boot dev lib media proc selinux tmp varabc data etc lib64 mnt root srv usr xxl[[email protected] ~]# rm -fr /12[[email protected] ~]# ls /123 boot dev lib media proc selinux tmp varabc data etc lib64 mnt root srv usr xxlbin data1 home lost+found opt sbin sys uzz[[email protected] ~]#
This article is from the "Technical Achievement Dream" blog, please be sure to keep this source http://xuxiaoliang.blog.51cto.com/10882951/1921145
Linux common file Management commands (1)