The third day of Linux classroom essays

Source: Internet
Author: User

Linux File Types

use ls-lh to see the type of a file,

- representative is normal file D for directory directory blue

Block device Files character b c stands for character device

Bare Equipment represents no file system or bypasses the file system.

Linux System Directory

are hung in the root directory /

Executable file

Ls/bin General user command file

Ls sbin Management using command files

Inode and directory entries

file data is stored in blocks, it is clear that there must be a place to store the file meta-information, such as the creator of the file, the date the file was created, the length of the file, and so on. This area of stored file meta information is called inode(index node)

The Inode contains the following content

File length

The user owner of the file

The group owner of the file

Permissions for files

Timestamp of the file

number of file links, including how many files point to this inode

Location of the file data block

The file name is not saved in the Inode , but is saved in the catalog item. The filename associates the name of the file with the corresponding inode .

use the ls-i command to list /root directory files, both filenames and inode numbers

Stat

use the Stat command to view information about a file, such as inode, permissions, time attributes, file size, owner, number of links, and file type

Command syntax

Stat Options File directory

viewing file information using the LS command

See the inode for the Root/install.log file

Ls-l/root/install.log

File and directory Operations management

Pwd

PWD Display working directory path

Cd Change Working directory path

Touch

Touch: Create an empty file, change the file time

Mkdir: Creating a directory

Rmdir Delete Empty directory

Cp copy files and directories

Mv files and directories renaming, moving files and directory paths

use the MV command to change the name of files and directories and to move the paths of files and directories

Rm Delete a file or directory

use the RM command to delete files or directories on your system

file Query Type

You can query the file type of a specified file by using a file command, and you can know whether a document is a binary executable or a shell script file, or other format.

Like what

file/boot/*

Df-h command View disk partition space and scale -H automatically selects the units of storage space.

Df-i Command View index number and scale

Du Viewing the space usage of directories and subdirectories

Du-s only look at the space usage of the directory itself

Du-a Viewing the space consumption of all subdirectories and files in the directory

Du-h

The third day of Linux classroom essays

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.