2017-10-8linux File command

Source: Internet
Author: User
Tags file permissions

File system commands

-rw-r-xr--2 root root 21654 LC

File Type (10): first character if yes-: normal file (f) d: Directory file B: Block device file (block) C: Character device file (Charater) L: Symbolic Link file (symbolic link files) P: Command pipe file (pipe) A: socket Woo file (Aocket)

File permissions (9): Each 3-bit group, each group: rwx (Read, write, execute)

Number of hard connection files

Owner of the file

Array of files (group)

File size (size): units are bytes

Timestamp (timestamp) Last modified time {Each file has 3 timestamps: Access time Atime (access) reads the contents of the file once, and this time updates the time of the last modification of the modified time Mtime (modify) file content State Change Time CTime (change) file Inode node last modified time}


File system:

Rootfs: Root file system

FHS (Filesystem Hierarchy): Hierarchical standard of file systems

/boot: System startup-related files. such as kernels, INITRD, and Grub (bootloader)

/dev: Device File block device: Random access device, data block

Character device: Linear device, by character

Device number: Main device number (major) and secondary device number (minor)

/etc: Configuration file

Home directory for users, the home directory of each user is usually the default of/home/username

/root: Administrator's home directory

/lib: library file static library: Windows. libLinux. A

Dynamic Library: Windows.DLL Linux. So (Shared object)

/lib/modules Kernel module files

/media: mount point directory, Mount Mobile device

/MNT: mount point directory, mount additional temporary file system

/OPT: Optional directory Early installation directory for installing third-party software

/proc: Pseudo file system kernel mapping file

/sys: Pseudo file system, property mapping file related to hardware device

/tmp: Temp file system

/var: a variable file

/bin: Executable file

/sbin: Managing Commands

/usr:shared, Read-only read-only file

/usr/bin/use/sbin: is a directory to have a certain function after the system starts

/usr/local: Directory of third-party software installations

/usr/local/bin/usr/local/sbin


File name naming rules:

1, length cannot exceed 255 characters

2, cannot use/when file name

3. Strictly case-sensitive


Directory Management:

# Tree View directory tree

1:mkdir: Creating an empty Directory

-P:

-v:verbose More information

① Creating/mnt/test/x/m,y

mkdir-pv/mnt/test/x/m/mnt/test/y

Mkdir-pv/mnt/test/{x/m,y}

Command line expansion

② Create/mnt/test/a_b, A_c, D_b, D_c

MKDIR-PV/MNT/TEST/{A,D}_{B,C}

2: Delete Directory

RmDir (remove directory) can only delete empty directories

Rm


File creation and deletion

Touch: Create an empty file but touch the main purpose is to modify the timestamp, you can use the Stat command to view the file status

RM: Delete command

RM-RF: You can delete all

An alias command plus \ is its original command, such as \ls \RM


Copying and moving files

CP: (copy) is the copy directory by default CP SRC DEST

-I interactive-f force-R recursive-p saves the source file's owner, timestamp-a retains all the original properties of the file, archive replication, often used for backup

CP file1 file2 file3 a file to a file, multiple files to a directory, cannot achieve 1-to-many

Mv:move moving files mv SRC DEST

Install: Copy files and create file attributes

-D direcotry ... : Creating a Directory


This article is from the "11254884" blog, please be sure to keep this source http://11264884.blog.51cto.com/11254884/1970808

2017-10-8linux File Command

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.