Note "Bird's Linux Private cuisine" 7 Linux Archives and directory management

Source: Internet
Author: User
Tags create directory

Cd

    • cd XXX Replacement Directory
    • cd~ Back home Directory
    • Cd-back to previous directory

Pwd

    • PWD Current directory path
    • Pwd-p Non-link path

Mkdir

    • mkdir XXX Create Directory
    • Mkdir-p Xxx/xxx Creating a multi-tiered catalog

RmDir

    • rmdir xxx Delete Empty directory

Ls

    • LS list file
    • Ls-a list contains ".." and "." All the files
    • Ls-a list does not contain ".." and "." All the files
    • Ls-l Listing Details
    • LS-LH list capacity size (non-byte)
    • Ls-ls size Sorting
    • Ls-lt Time Sorting
    • LS-LR Reverse List
    • Ls-l--fulltime Full Time information

Cp

    • CP src DST Copy file
    • CP src1 SRC2 Dstdir Copying files to the directory
    • cp-r src DST Recursive replication
    • cp-f src DST forced replication
    • Cp-i src DST prompt replication
    • cp-a/-pdr src DST copy file all properties
    • cp-d srclink Dstlink copying linked files

Rm

    • RM XXX Delete Files
    • rm-f xxx Forced removal
    • rm-r XXX Recursive Delete
    • rm-i XXX Tips Delete

Mv

    • MV SRC DST Move file
    • MV Src1 Src2 Dstdir moving files to the directory
    • Mv-f SRC DST forced move
    • Mv-i src DST prompt move

Cat

    • Cat xxx Viewing files
    • cat-n XXX Display line number
    • cat-t XXX Show tab

Tac

    • TAC XXX Reverse View file

nl

    • NL XXX Display line number view file

More

    • more XXX viewing files

Less

    • less xxx viewing files

Head

    • Head XXX Print first page
    • head-n XXX Print Top 10 lines

Tail

    • Tail XXX Print last page
    • tail-n XXX Print last 10 lines
    • tail-f XXX Continuous monitoring file tail

Od

    • od-t x XXX 16 binary View file
    • od-c XXX ASCII character display

Touch

    • touch-a XXX Create File/Modify access time only atime (access times)
    • touch-c XXX Only modifies state modification time ctime (status times)
    • touch-m XXX Create File/modify only modified time mtime (modification times)
    • Touch XXX Create files/modify Mtime and Atime
    • touch-d "2 days ago" xxx Create files/modify files Mtime and atime,ctime for current time
    • Touch-t 0712310159 XXX Create File/modify file Mtime and Atime (YYMMDDHHMM), CTime for current time

Umask

    • Umask Default Creation permissions (lost permission values)
    • Umask 022 Modify default Create permission to Rwxr-xr-x

Lsattr

    • lsattr XXX List Hidden properties

Chattr

    • Chattr +s Add hidden properties each time the modification will automatically sync
    • Chattr-a minus hidden properties can only be added cannot be deleted cannot be modified by the root dedicated
    • Chattr =i Setting hidden properties cannot be added modify delete reference root private

File

    • File xxx View files basic types

which

    • which cmdxxx find command location

Find

    • Find. -mtime +n Find modified time n days ago File
    • Find. -ctime-n find files within n days of status time
    • Find. -atime n Find files for access time n days
    • Find. -user xxx Find files for XXX users
    • Find. -name xxx Find file with file name xxx
    • Find. -name xxx* Find file name at the beginning of xxx
    • Find. -size +2c Find files above 2byte
    • Find. -size-2k Find files below 2k
    • Find. -type s find files of type S

Whereis

    • Whereis xxx Find binary files, man files, source files (from/var/lib/mlocate)

Locate

    • Locate xxx Find files that contain xxx (from/var/lib/mlocate)
    • Locate *xxx find the end of XXX files (from/var/lib/mlocate)
    • Locate xxx* find files starting with xxx (from/var/lib/mlocate)

UpdateDB

    • Update/var/lib/mlocate

Note "Bird's Linux Private cuisine" 7 Linux Archives and directory management

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.