Introduction to Linux Basics __linux

Source: Internet
Author: User
Tags parent directory

Introduction to Linux Basics


Linux Basic Operations

There are two ways to operate a Linux system, one is to use the mouse keyboard and other input devices directly on the graphical Interface X window operation, the other is through the input text command to operate on the console. The various Linux distributions follow the same principles, so the approach is very similar.


Shell

The shell is a special function of the program, but also between the user and the Linux kernel an interface between. Linux systems have a variety of shells, and a shell called Bash is commonly used in distributions. This shell not only performs simple commands, but also writes multiple commands, conditions, and parameters as program execution. Using a Linux system for program development usually requires some common shell commands to be mastered


Control Desk

Linux system is a multiple-user multitasking operating system. Any user who wants to use system resources must first apply to the system administrator for an account, and then enter the system as the account name, which is the sign-in name. Linux systems typically have multiple consoles that can be used by shell programs to manipulate computers when they enter the console.


Terminal

The terminal is the interface to access the shell program in X window.


Files and directories

A file system is an indexed format for storing data in a physical storage device, and files and directories are logical partitions of data. The file types of Linux systems can be grouped into 5 categories: Plain files, directory files, linked files, device files, and piping files.
Ordinary files are usually seen in most files, it is characterized by the file system does not contain the structure of information.
A directory file is a file that holds file paths and related information, and is the basic node of the file system. The catalog file renders the file system in a tree-shaped structure. In a Linux system, a directory file is usually referred to as a catalog.
A linked file is a link to another real file, a special file structure.
A device file is a file that holds computer device information and interfaces, a unique form of the Linux operating system, and all of the computer's devices are provided to the application in the form of a file.
A piping file is a file that is used for communication between applications.


File name and path name

The Linux system's file name consists of characters and numbers, where the characters can be uppercase or lowercase letters or other Unicode-encoded text and symbols. But cannot include "*", "?" and "[]" filename wildcard characters.
The Linux system's filename also has an extension similar to that of other operating systems, at the end of the filename "." The following content is the extension. For example, the C language source file extension is C, and the header file extension is H.
The Linux file system takes a linked tree directory structure, that is, only one root directory. The root directory may contain subordinate subdirectories or files, and subdirectories can contain more subordinate subdirectories or files. Such a layer extends down, forming an inverted tree, as shown in the picture.
Path names can be divided into absolute and relative paths, and absolute paths are all the node names passed from the root directory to the destination directory or file, such as the absolute path of the file m1.c is "/home/shizhe/workspace/m1.c". A relative path is the name of all the nodes that a directory or file passes through, such as the relative path of the file m1.c relative to "/home" is "shizhe/workspace/m1.c".


Working directory

The console or terminal always corresponds to a directory at some point, the directory that is the working directory. Executes a command or program on a console or terminal and operates on a file or subdirectory that does not have a specified path, and the console or terminal automatically joins the path to the current working directory before the file or subdirectory. For example, executing the LS command displays the name of the file and subdirectory under the working directory, unless you enter a specific path name after the LS command.
Working directory is available "." Indicates that the parent directory at the top of the working directory uses the ".." Said. The CD command is used to change the working directory.
The console or terminal replaces the "~" symbol with the absolute path to the user's starting directory, which is also considered an environment variable, and the Linux system automatically maintains the value of the "~" symbol.

File descriptor

The

        File descriptor is a small nonnegative integer that identifies the file that a particular process is currently visiting. When the kernel opens an existing file or creates a new file, it returns a file descriptor to the process so that the process can access the target file through the kernel.
By convention, when a new program is run, all shells open 3 file descriptors for it: standard input (0), standard output (1), and standard error (2). If nothing special is done like the simple command ls, then these 3 descriptions Fudulian to the terminal.

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.