Linux common file Management commands (1)

Source: Internet
Author: User

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)

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.