Catalog File Management Tools

Source: Internet
Author: User

Directory Management Mkdir,rmdir,tree

mkdir Creating a file directory

-P: Create parent directory path on Demand

-V: Display procedure

-M: given permission to create a directory

RmDir Deleting a file directory

-V:

-P: Delete the specified directory if the parent directory is empty

For example:

/tmp/{x,y,z} =/tmp/x/tmp/y/tmp/z

/tmp/{x/y, m/{m,n}} =/tmp/x/y/tmp/m/m/tmp/m/n

/tmp/{x,y}/z =/tmp/x/z/tmp/y/z


~]# MKDIR-PV Rootfs/{bin,sbin,lib,lib64,tmp,usr/{,local}/{bin,sbin},var/{log/httpd,spool}}

Rootfs

├──bin

├──lib

├──lib64

├──sbin

├──tmp

├──usr

│├──bin

│├──local

││├──bin

││└──sbin

│└──sbin

└──var

├──log

│└──httpd

└──spool

tree structure display file list

-L Level: Maximum number of directory layers displayed in a tree structure, level=num

-p:pattern:list only those files that match the Wild-card pattern, based on the glob mechanism;

-D: Show only directories

File View Cat,tac,more,less,head,tail

More

Less

Head View the first n rows of the file

-N #:

-#:

Tail viewing files after n rows

-N #:

-#:

-F: View the end of the file after the content does not exit, blocked on the file, append new content, will continue to display. may be used to catch logs

Stat display file meta data (metadata), inode stored in file system

Block Size (data): Blocks

File time stamp

Atime:access Tim, the last time the file was visited;

Mtime:modify time, the date when the file was last modified (data);

Ctime:change time, when the file was last modified (metadata);

Touch

-T STAMP:[[CC]YY]MMDDHHMM[.SS]

-A: Modify Atime only

-M: Modify Mtime only

-C: Do not create file//touch a nonexistent directory or file is created automatically

ForExample:

Touch $ (date +%f-%h-%m-%s)//Create a Date folder in the current user directory

File management tools CP,MV,RM

CP Copy file source file, target file

Single source copy CP [OPTION] ...  [-T] SOURCE DEST

Multi-source replication cp [OPTION] ...  SOURCE ... DIRECTORY

CP [OPTION] ...-t DIRECTORY SOURCE ...

-I: Interactive replication, reminding users to confirm when overwriting files of the same file name

-F: Force overwrite files with the same name

-R: Or-R recursive runes directory and content

-p:no dereference, copy the link file itself instead of the default copy link file that points to the contents of the source file

-a:archive, archive replication //Only administrators can retain the owner and owner group attributes

MV Move file source file directory is the same as the destination file, rename it, otherwise move

-I: Interactive

-F: Mandatory

RM//Please do not perform "RM-RF/" or "RM-RF/*"

-I: Interactive

-F: Mandatory

-r:-r removing directories and content recursively


This article is from the "Miabon" blog, make sure to keep this source http://9733489.blog.51cto.com/9723489/1748169

Catalog File Management Tools

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.