Linux File System

Source: Internet
Author: User

Linux File System


Certificate --------------------------------------------------------------------------------------------------------------------------------------------------------
To access a disk file, you must use a system call to return an ID associated with the file,
This ID is the file descriptor.

The linux operating system provides an open system call. Any process must access a file.
File. The system returns a number and the file descriptor associated with the file.
(1) The user program submitted an opening application from the user space to the kernel.
(2) the operating system checks whether the request is valid in the kernel. If the request is valid and the file associated information (read/write location, in the disk location) is opened in the kernel, all stored in struct file) and added to the current process's PCB open file list array, corresponding to this array of small labels and file descriptors
(3) return the file descriptor to the non-user space. The user space then reads and writes the file through this number value.

Certificate ---------------------------------------------------------------------------------------------------------------------------------------------------------

By default, three files are opened for each process:

Printf/scanf:
File descriptor value 0 (standard input, keyboard)
1 (standard output, display)
2 (standard error output, display)
Corresponding macro
STDIN_FILENO
STDOUT_FILENO
STDERR_FILENO





How to view the file size in linux

Use the ls-lht command to display all files in the current directory. One column shows the file size.
To view the size of a folder, you can use du-sh *

What is * behind a linux file?

You should use the F option of the ls command to view the image. * indicates that the file is an executable file.
Supplement: run the which ll command to see what the Kana of ll is.

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.