First knowledge of Linux system---Ubuntu

Source: Internet
Author: User
Tags control characters parent directory touch command

Ubuntu Operating System

I. Linux system composition
The Linux kernel software program is used to implement core operations such as CPU and memory allocation process scheduling device drivers, which are oriented to hardware-based
The peripheral program is user-oriented, including analysis of user instruction interpreter Network Service program graphical desktop program and other application software programs

Two. Linux Kernel project
Linus Torvalds, the main University of Helsinki, Finland
October 1991, release of Linux version 0.02 (first public edition)
March 1994, Linux version 1.0 released
The logo of the Linux kernel-Penguin Tux, from the Finnish Mascot official website: http://www.kernel.org
Change diagram between the stable version of the Linux kernel and the development version
Note: 1) The development version is originally a stable version of the copy, and then constantly fix the error, continue to add new features
2) The development version tends to stabilize and will be upgraded to a stable version

Three. Peripheral programs for Linux systems
Most of the peripheral programs that make up the Linux system come from open source software from the GNU Project or other organizations
GNU (GNU is not Unix): launched and created by Richard Stallman in 1984; Designed to develop a complete Unix-like operating system; Official website: http://www.gnu.org

Four. GPL and LGPL agreement
GPL (general public lisence Universal Common license)
Core content: 1. The software must be published in the form of source code, allowing any copy delivery to be modified using and re-sending the new software version
2. If any part of the GPL software is used in the published software project, it will also comply with the GPL, and the source code development allows other users to copy, transfer and modify the use
3. Do not provide any form of liability guarantee and commitment to any user of free software
4. Does not exclude the commercial packaging and distribution of free software, nor does it restrict the packaging and distribution of other non-free software on the basis of free software.
Open source software: The most important feature of OpenSource software (opensource software open sources software) is the open source code

Five. Linux system version
Linux Distribution Composition
Unix-like operating system based on Linux kernel
Linux kernel + various free software = Full operating system
The name and version of the release is determined by the issuing vendor
Red Hat series, published by Red Hat, Debian series, released by the Debian community; Ubuntu series, released by Ubuntu community

Six. Ubuntu Linux Overview
Ubuntu was founded by Mark Shuttleworth (Mark Cervos), and Ubuntu was developed based on Debiangnu/linux's unstable branch, with its first version released on October 20, 2004

Seven. File system types that are used by default in Linux
Linux System file system mainly includes EXT4 (fourth generation file extension system for storing files and directory data partition, when Ubuntu default file system used
1): EXT4, 4th Generation Extended (Extended) file system
partitions that store file and directory data
A typical journaled file system
The default file system used in Ubuntu system
2): Swap, swap file system
To establish a swap partition for a Linux system
3): Other file system types supported by Linux
FAT16, FAT32, NTFS
XFS, JFS

Eight. Linux drives, partitions and other devices are represented as files
A hard disk device in a Linux system that represents the Ide/scsi interface using HDX/SDX, where x is a B-C and an ordinal partition based on the hard disk device file name, after which the number sequence is added (e.g. hda1 hda2)

The hard disk is listed as/DEV/SDD6. /dev/for hard disk directory HD (IDE interface hard disk) SD (SCSI or SATA interface hard disk) d (HDD serial a B c D) 6 (second logical partition) full read: The second logical partition of the fourth SCSI hard disk

Note: The number of primary partitions on the hard disk is only 4, so the serial number of the primary and extended partitions is limited to 1~4, and the sequence number of the logical partitions will always start at 5

Nine. System user Interface
1): Graphical interface: Composed of a series of Windows-based applications Provides better ease of operation and visual experience Desktop suite environment for the
Ubuntu system graphical Interface: GNOME (GNU Network Object Model Environment), KDE (Kool desktop environment) XFCE (XForms Common Environment) uses GNOME
2): The Linux system with the command line interface
Character interface has been widely used in the enterprise Server domain for its excellent features such as high efficiency, stability and reliability. Most of the management of the server, maintenance by remote login.
6 virtual terminals are turned on by default, represented as Tty1, Tty2 、...、 tty6
3): Switch between graphical interface and command line interface
Use CTRL+ALT+FN key combination, switch from GUI to nth virtual terminal of command line interface, Fn represents F1, F2 、...、 F6 function key; Use the ALT+F7 key combination to return from the character console to the open graphical desktop environment
Press ALT+FN to convert between 6 virtual terminals
turn on the pseudo terminal shortcut key to Ctrl+alt+t ( Pseudo terminal provided by the Qnome-terminal program needs to run on the graphical interface)

10. Directory structure
The directory and file data in the Ubuntu system are organized into a tree directory structure, where all partitions, directories, files, etc. all have an identical location starting point-the root directory (denoted by "/")

1): Common subdirectories
Directory descriptions
/ Boot system kernel holds directory boot file and kernel
/bin bin is binary (binary) abbreviation for ordinary user command
/dev Device interface
/etc application
/home directory for normal user
/root Administrator root host directory
/sbin administrator commands
/usr Other user applications
/var frequently changing files (log mailbox directory, etc.)
2): Command prompt
User name
hostname
for analog terminal Current user's working directory: "~" On behalf of the user's host directory
Current user type: "$" character indicates that the current logon is a normal user, "#" character means the current logon is the Administrator user
Command prompt, enter a string as a variety of action commands; press ENTER Key to end the command input and execute

11. View System Information Command
Command description
Uname-r View system kernel
At/proc/cpuinfo View CPU
Cat/proc/meminfo View Memory
Hostname View Host name
ifconfig view IP
sudo passwd root modify root password
su root switch Administrator
Shutdown-h now/poweroff shutdown
Shutdown -R now/reboot Restart
Shutdown-r + minute delay restart
Ctrl+c/shutdown-c Cancel

12. Command
Usually only represents the name of the instruction or program that implements a certain kind of function, is a special program running in Linux system, and acts as a "translator" between the user and the kernel; When a user logs on to a Linux system, a shell program is automatically loaded; bash is the default shell program used in Ubuntu systems. ; files located in/bin/bash
Classification
Internal command: Some special instructions inside the Shell interpreter program (such as Bash), also known as built-in (built-in) directives, do not require re-reading of the file from the hard disk, so it is highly efficient
External command: Refers to a Linux system to complete a specific function of the script file or binary program, each external command corresponds to a file in the system, is a command outside the Shell interpreter program.
The default storage directory/bin/sbin.
Ubuntu command Line
Syntax: command word "Options" "Parameters"
Command word: The command name, which is the most critical part of the entire command; the only one that determines a command
(Note: The processing of English characters is case-sensitive in the Ubuntu Linux command environment.)
Options: Adjust the specific functions of the command, decide how to execute the command, different command word use different options, multiple options are separated by a space, if you do not use the option, the default function of the command word
Short format options: typically use "-" (half-width minus sign) symbol guidance before the option (multiple single-word check items can be combined together) (simple structure, fast input)
Long format options: usually use "--" (two-half-width minus sign) symbol guidance before the option (meaning clear, easy to remember)
Parameters: Command arguments are objects that command word processing, and typically command parameters can be file names, directory (path) names, or user names.
Press ENTER to indicate that the command input ends and is submitted to the system for execution; You can edit the character contents of the command line before pressing the ENTER key
Experience: In the actual use of the Ubuntu command line process, the "options" and "parameters" are often confused, and even the order is allowed to reverse, but generally do not affect the execution of the command effect

13. Get Command Help
Use the help command: The helps command is a built-in directive in the Linux shell that is used to view the helper information for each shell internal command
Use the-HELP command: Help information for most of the external commands of Ubuntu
Use the Man Manual (Manual page): Is the most common form of online Help for Linux systems, most of the external software at the time of installation for the execution of programs, configuration files provide a detailed Help manual page. Shortcut key Q exit/Find
Man ls | Col-b > Lshelp.txt Save the Help manual for the LS command as a text file Ishelp.txt
Note: The col command program is used to filter some special control characters in text
| The pipeline takes the screen output of the preceding command as the action object of the subsequent command

REDIRECT output after the previous command executes successfully, its screen output will be saved to the file specified behind the >, instead of being output directly to the screen.

14. Basic operation of directories and files
PWD command: View current working directory (print working directory)
CD command: Switch working directory (change directory) host directory is the default working directory after Ubuntu user logs on to the system


Absolute path: Use absolute paths at root/as a starting point to represent a directory very accurately, commonly used to indicate a directory (file) location in Linux that is relatively stable (infrequently changed)
relative path: Starting with the current working directory, beginning with no/symbol, Quick and easy to use

ls command list: Displays content in a directory, including subdirectories and file-related property information
syntax: LS [options] [File or directory ...]
Common options:
ls to display directory names and file information in a short format
ll display a list of files and directories in long format
Ls-a displays all subdirectories and file information
Ls–a except. (current directory): All subdirectories and file information outside of the (parent directory)
Ls–ld displays the contents of the directory itself instead of the content in the directory
LS-LH displays the directory or file size in a more humane (human) manner, with the default size in KB
LS- LR Displays all content in the specified directory and its subdirectories in a recursive (recursive) manner
can be combined with a wildcard when using the LS command? to improve the efficiency of command authoring, where? You can match an unknown character in the file name, and the asterisk can match any number of characters in the file name
ls--color in character mode to distinguish different files in color
Alias command: Simplifies commonly used, longer commands by alias mechanism
Syntax: Alias Command alias = command
Example: alias Myls = ' Ls–alh ' (alias is myls)
Note: "Myls" is equivalent to executing the "ls-alh" command
du command: Statistics directory and file space usage
Syntax: du [Options] [File or directory ...]

15. Creating Directories and files
Syntax: mkdir [options] directory location and name ...
Mkdir command to create a new directory (make directory)
Mkdir–p creating nested Multilayer catalogs at once
Touch command to create an empty file
In command Create key link file (link)
Soft links (Symbolic Links) apply to files and directories, and must be explicitly specified with the-s option when the original file is deleted and the soft link is invalidated
Hard links can only be used for files, hard links and original files must be in a file system (Linux partition), deleted original files are still available
1): Copy delete move directory and files: Rebuild a copy of the file or directory (source) to be copied and save as a new file or directory
Syntax: CP [Options] ... source file or directory ... Destination file or directory

注意:复制多个文件或目录时,目标位置必须是目录,且目标目录必须已存在

2): Delete the specified file or directory
Syntax: RM [option] To delete the file or directory ...
Common options:-F: Force delete directly
-I: Remind users to confirm when deleting files or directories
-R: Used when deleting a directory, indicating recursive deletion of the entire directory tree

16. Find Files and directories
1): The search scope is determined by the environment variable PATH: Echo $PATH (commands to view user environment variables)
Which command to find the directory where the command file that the user executes is stored
Syntax: which command | program name (default when finding the first target no longer continues); WHICH-A Command | program name (if you want to find it in all search paths)

Note: When you use which to find internal commands, the corresponding program is not found
2): Use recursive method, according to the target name, type, size and other different attributes for fine-grained search
Syntax: Find [Look in] [find criteria expression]

Note: Use wildcard characters? * It is best to extend the file name with double quotation marks when you need to use more than one lookup condition, each expression can be represented by the logical operator "-a" "-O" respectively, and (or).

First knowledge of Linux system---Ubuntu

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.