First week computer Linux basics and simple commands

Source: Internet
Author: User
Tags printable characters temporary file storage

Von Neumann computing Architecture: arithmetic, controller, memory, input.
The smallest unit of a computer is bit bits
8bits=1byte (bytes)
1024bytes=1kb
1024kb=1mb
1024mb=1gb
1024GB=1TB, wait.
Each of the 1024 units rises by 1 counts. and the hard disk manufacturers are 1000 binary, so the actual size of the 1T hard disk is 1000/1024*1000=976GB.
x8664 means that the computer can process 64-bit integer operations at the same time and is compatible with the X86_32 architecture.
Linux Philosophy thought:
1. Everything is a document. (including hardware)
2. Small single-purpose procedures.
3. Connect the programs to accomplish complex tasks together.
4. Avoid confusing user interfaces.
5. The configuration data is stored in the text.
Linux operating system: Linux kernel (kernel) + GNU tool.
The Shell is the user interface of a Linux system that provides user interaction with the kernel
One of the interfaces. It receives the command entered by the user and feeds it into the kernel to execute
The shell is also known as the LINUX command interpreter (interpreter)

Format of commands under Linux: command [options] [arguments]
Command: Commands
Options: Option to enable a feature of the command to change the function of the command
Argument: parameters, changing the command action object
Linux commands a lot, remember not clear when, with the man command query.
There are two types of commands that can be executed in the shell
Internal command: Comes with a shell and is provided in a command form
Help Internal Commands list
Enabled CMD enables internal commands
Enable–n cmd Disable internal commands
Enable–n View all the disabled internal commands
External command: A corresponding executable program file under the file system path
View path: Which--a | --skip--S alias; Whereis
Order of command execution: aliases > Internal commands > External commands (hash>path) between each command with ";" Separated. To preach down the command's data with the pipe symbol "| Passed
Command:echo, cat, date, clock, Cal, Halt,poweroff,reboot, shutdown, Init, WhoAmI, who, W, screens, LS, touch, history, WHA Tis, which, help, man, LS, pwd, CD, STAT, CP, MV, RM, tree, mkdir, file, rename, ln

LINUX文件系统结构!

? /boot: Boot file directory, kernel file (vmlinuz), boot loader (bootloader, grub) are stored in this directory
? /bin: A basic command for all users, a program that is not associated to a separate partition, and that is used by OS startup
? /sbin: The basic command of the management class, which cannot be associated to a separate partition, the program that is used by OS startup
? /lib: Basic shared library files that the program relies on at startup and kernel module files (/lib/modules)
? /LIB64: storage location for secondary shared library files dedicated to x86_64 systems
? /etc: Configuration file directory
? /home/username: Normal User home directory
? /root: Administrator's home directory
? /media: Portable mobile device mount point
? /MNT: Temporary file system mount point
? /dev: Device files and special file storage locations
B:block device, random access
C:character device, linear access
? /OPT: Where to install third-party applications
? /SRV: Data used by services running on the system
? /tmp: Temporary file storage location
? /usr:universal GKFX, read-only data
Bin: An application that ensures that the system has full functionality
Sbin
Lib:32 bit use
LIB64: Only 64-bit systems exist
Include:c header file for the program (header files)
Share: structured independent data such as Doc, man, etc.
Local: Installation location for third-party applications
Bin, Sbin, Lib, lib64, etc, share
? /var:variable Data files
Cache: The application caches the data directory
LIB: Application state information data
Local: Dedicated to storing variable data for applications under/usr/local;
Lock: Lock file
LOG: Logs directory and files
OPT: Dedicated to storing variable data for applications under/OPT;
Run: Process-related data in progress, typically used to store process PID files
Spool: Application Data Pool
TMP: Save temporary data generated between system two reboots
? /proc: A virtual file system for outputting kernel-related process information
? /sys: For outputting information about hardware devices on the current system virtual file system
? /selinux:security Enhanced Linux,selinux The storage location of information such as the relevant security policy
Components of an application on Linux
? Binaries:/bin,/sbin,/usr/bin,/usr/sbin,/usr/local/bin,/usr/local/sbin
? Library files:/lib,/lib64,/usr/lib,/usr/lib64,/usr/local/lib,/usr/local/lib64
? Configuration files:/etc,/etc/directory,/usr/local/etc
? Help files:/usr/share/man,/usr/share/doc,/usr/local/share/man,/usr/local/share/doc
Types of files under Linux
? -: Normal file
? D: Catalog file
? B: Block device
? C: Character device
? L: Symbolic Link file
? P: Piping File pipe
? S: Socket file socket
File wildcard characters
? * Match 0 or more characters
? ? Match any single character
? ~ Current User Home Directory
? ~mage User Mage Home directory
? ~+ Current Working Directory
? ~-Previous working directory
? [0-9] Matching number range
? [A-Z]: Letters
? [A-Z]: Letters
? [Wang] matches any one of the characters in the list
? [^wang] matches characters other than all characters in the list
? Pre-defined character class: Man 7 glob
[:d Igit:]: Any number, equivalent to 0-9
[: Lower:]: Any lowercase letter

[: Alnum:]: Any number or letter
[: Blank:]: horizontal white space character
[: Space:]: Horizontal or vertical whitespace characters
[:p UNCT:]: Punctuation
[:p rint:]: Printable characters
[: Cntrl:]: Control (nonprinting) character
[: Graph:]: Graphic character
[: Xdigit:]: hexadecimal character
Inode,block,bitmap
Index node
? The Inode (index node) table contains a list of all file system files
? A node (an index node) is a table item that contains information about the file (metadata), including:
File type, permissions, Uid,gid
Number of links (pointing to the number of path names for this file name)
The size of the file and the different timestamps
Data block pointer to file on disk
Additional data about the file
Directory
? File reference one is inode number
? A person is referring to a file by file name
? A directory is a mapping between a file name and an inode number in a directory

Hard Links
? Creating a hard link adds additional record entries to reference the file
? Corresponds to a physical file on the same file system
? Each directory references the same inode number
? Increase number of links at creation time
? When deleting files:
Link for RM command decrement count
File to exist, with at least one link number
When the number of links is zero, the file is deleted
? Cannot span drives or partitions
? Grammar:
ln filename [linkname]
Symbolic (or soft) links
? A symbolic link points to another file
? LS-L displays the name of the link and the referenced file
? The content of a symbolic link is the name of the file it references
? The directory can be
? Can span partitions
? A path to another file whose size is the length of the path string to which the target file is not incremented or decreased.
reference count;
? Grammar:
ln-s filename [linkname]

First week computer Linux basics and simple commands

Related Article

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.