First acquaintance with linux system---ubuntu

ubuntu operating system

1. Linux system composition The
Linux kernel software program is used to implement core operations such as CPU and memory allocation process scheduling device drivers, mainly hardware-oriented
peripheral programs, and user-oriented programs, including interpreter network service programs that analyze user instructions, graphics desktop programs, etc. Various application software programs
First acquaintance with linux system---ubuntu

2.
The main author of the Linux kernel project: Linus Torvalds of the University of Helsinki, Finland.
In October 1991, Linux version 0.02 (the first public version) was released.
In March 1994, Linux version 1.0 released
the logo of the Linux kernel - Penguin Tux, taken from The official website of Finland's mascot: http://www.kernel.org
Changes between the stable version and the development version of the Linux kernel
Note: 1) The development version is initially a copy of the stable version, and then constantly corrects errors and continues to add new ones Function
2) After the development version becomes stable, it will be upgraded to the stable version

3. Peripheral programs
of the Linux system Most of the peripheral programs of the Linux system come from the GNU project or the open source software
GNU (GNU is Not Unix) of other organizations: initiated and created by Richard Stallman in 1984; it aims to develop a complete system similar to Unix operating system; official website: http://www.gnu.org
First acquaintance with linux system---ubuntuFirst acquaintance with linux system---ubuntu
4. GPL and LGPL agreement
GPL (General Public Lisence General Public License)
core content: 1. The software must be released in the form of source code, allowing arbitrary copying Transfer, modify, use and redistribute a new software version
2. If any part of the GPL software is used in the published software project, it must also comply with the GPL agreement, and allow other users to copy, transfer, modify and use the source code arbitrarily
. 3. Not free software Any user provides any form of responsibility guarantee and commitment
4. It does not exclude the commercial packaging and distribution of free software, nor does it limit the packaging and distribution of other non-free software on the basis of free software
. One of the most important features of open source software) is open source code

V. Linux system version The
Linux distribution version constitutes
a Unix-like operating system based on the Linux kernel
Linux kernel + various free software =
The name and version of the complete operating system distribution are determined by the distribution manufacturer
Red Hat series, released by Red Hat; Debian series, published by the Debian community; Ubuntu series, published by the Ubuntu community

Six. Ubuntu linux overview
Ubuntu was founded by Mark Shuttleworth (Mark. Shecherworth), Ubuntu is based on the debianGNU/linux unstable branch, and its first version was released on October 20, 2004

Seven. The type of file system used by default in Linux The
Linux system file system mainly includes EXT4 (the fourth generation file extension system is used to store file and directory data partitions, the default file system used by Ubuntu
1): EXT4, the fourth generation extension (Extended)
The partition where the file system stores files and directory data.
A typical journaled file system
. The default file system used in Ubuntu system
2): SWAP, the swap file
system creates a swap partition for the Linux system
3): Other file system types supported by Linux
FAT16, FAT32, NTFS
XFS, JFS

8. In Linux, hard disks, partitions and other devices are represented as files
in the Linux system using the form of hdx /sdx to represent hard disk devices with IDE/SCSI interfaces, where X is abc and other alphabetical serial numbers. The partition is based on the file name of the hard disk device. After partitioning, add the number serial number (such as hda1 hda2).
First acquaintance with linux system---ubuntu
The hard disk is listed as /dev/sdd6. /dev/ is the hard disk directory hd (IDE interface hard disk) sd (scsi or sata interface hard disk) d (hard disk serial number abcd ) 6 (No. Two logical partitions) complete reading method: the second logical partition of the fourth scsi hard disk

Note: The number of primary partitions in the hard disk is only 4, so the serial numbers of primary partitions and extended partitions are limited to 1 to 4, while the serial numbers of logical partitions will always start from 5.
First acquaintance with linux system---ubuntu
IX. System User Interface
1): Graphical interface: It consists of a series of windowed applications;
a desktop suite environment that provides better operational convenience and visual experience of the Ubuntu system graphical interface: GNOME (GNU Network Object Model Environment); KDE (Kool Desktop Environment); Xfce (XForms Common Environment) ) GNOME
2 is used by default: The Linux system of the command line interface
character interface has been widely used in the field of enterprise servers with excellent features such as high efficiency, stability and reliability. Most of the management and maintenance of the server are carried out by remote login.
By default, 6 virtual terminals are enabled, which are respectively represented as tty1, tty2, ..., tty6
3): To switch between the graphical interface and the command line interface,
use the Ctrl+Alt+Fn key combination to switch from the graphical interface to the nth virtual terminal of the command line interface. Fn stands for F1, F2, ..., F6 function keys; use the Alt+F7 key combination to return from the character console to the opened graphical desktop environment.
Press the Alt+Fn key combination to switch between 6 virtual terminals to
open the pseudo terminal. The shortcut key is ctrl+Alt +t (pseudo-terminal is provided by the qnome-terminal program and needs to run on a graphical interface)

10. Directory structure
The directory and file data in the Ubuntu system is organized into a tree-like directory structure, and all partitions, directories, files, etc. have the same location starting point - the root directory (represented by "/")
First acquaintance with linux system---ubuntu
1): Common Subdirectories
Directory Description
/boot System kernel storage directory boot files and kernel
/bin bin is the abbreviation of binary (binary) Commands used by ordinary users
/dev device interface
/etc Application
/home Home directory of ordinary users
/root Administrator root Home directory
/sbin Commands used by administrators
/usr Other user applications
/var Frequently changed files (log mailbox directory, etc.)
2): Command prompt of the simulated terminal
Username
hostname
Current user's working directory: "~" Represents the user's home directory
Current user type: The "$" character indicates that the current login is an ordinary user; the "#" character indicates that the administrator user is currently logged in.
After the command prompt, enter various operation commands in the form of strings; press Enter Enter and execute the key to end the command.
First acquaintance with linux system---ubuntu
Eleven . View system information Command
command description
uname -r View system kernel
at /proc/cpuinfo View CPU
cat /proc/meminfo View memory
hostname View hostname
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 instruction or program name that realizes a certain type of function; it is a special program running in the Linux system; it acts as a "translator" between the user and the kernel; when the user logs in to the Linux system, it is automatically loaded A shell program; Bash is the default shell program in Ubuntu; the file is located in the /bin/bash
category
Internal commands: some special instructions integrated into the shell interpreter program (such as bash), also known as built-in (built-in) ) The internal command of the command does not need to re-read the file from the hard disk, so the execution efficiency is high.
External command: refers to the script file or binary program in the Linux system that can complete a specific function. Each external command corresponds to a file in the system, which is A command that is outside the shell interpreter program.
The default storage directory is /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 to determine a command
(Note: in the Ubuntu Linux command environment , the processing of English characters is case-sensitive)
option: adjust the specific function of the command to determine how the command is executed; the options used by different command words will be different; multiple options are separated by spaces; if no option is used , the default function of executing the command word
Short format option: generally use "-" (half-width minus sign) symbol before the option to guide (multiple single-character options can be used together) (simple structure, fast input)
long format option : Generally use the "--" (two half-width minus sign) symbol before the option to guide (clear meaning, easy to remember)
Parameter: command parameter is the object of command word processing, usually command parameter can be file name, directory (path)name or username, etc.
Press the Enter key to indicate the end of the command input and submit it to the system for execution; before pressing the Enter key, you can edit the character content in the command line
Experience: In the process of actually using the Ubuntu command line, the appellations of "options" and "parameters" are often confused , even the front and back order is allowed to be reversed, but generally it will not affect the execution effect of the command

First acquaintance with linux system---ubuntu First acquaintance with linux system---ubuntu

13. Use the help command to get command help
: the help command is a built-in command in the linux shell. Its purpose is to view the help information of each shell's internal commands.
Use the --help command:
use the man manual for the help information of most external commands in Ubuntu ( manual page): It is the most commonly used online help form in the Linux system. Most of the external software provides detailed manual pages for executing programs and configuration files during installation. Shortcut q to exit/find
man ls | col -b > lshelp.txt Save the help manual of the ls command as a text file ishelp.txt
Note: The col command program is used to filter some special control characters in the text
| The pipe will put the previous command The screen output result of the command is used as the operation object of the following command

After the command in front of the redirected output is successfully executed, its screen output will be saved to the file specified after the > sign, instead of being output directly to the screen.

14. Basic operations of directories and files
pwd command: view the current working directory (print working directory)
cd command: change working directory (change directory) The host directory is the default working directory after Ubuntu users log in to the system

First acquaintance with linux system---ubuntu
Absolute path: Starting from the root directory/, using an absolute path can represent a directory very accurately. It is often used to indicate the location of a directory (file) with a relatively stable (infrequently changed) directory structure in Linux.
Relative path: starting from the current working directory, Do not use the / symbol at the beginning, it is quick and simple to use
First acquaintance with linux system---ubuntu
ls command list (list): display the contents of the directory, including subdirectories and file-related attribute information
Syntax: ls [option] [file or directory…]
Common options:
ls display in short format Directory names and file information
ll Display file and directory listing in long format
ls -a Display information about all (all) subdirectories and files
ls -A Information about all subdirectories and files except . (current directory) .. (parent directory)
ls -ld Display the properties of the directory itself, not the contents of the directory
ls -lh Display the directory or file size in a more human-friendly way, the default size unit is kb
ls -lr Recursive ) to display all the contents of the specified directory and its subdirectories
when using the ls command can you combine wildcards? In order to improve the efficiency of command writing, which? Can match an unknown character in the file name, and the asterisk can match any number of characters in the file name
ls --color Differentiate different files by color in the character pattern
alias command: Simplify commonly used, relatively long through the alias mechanism Command
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: Count the space occupancy of directories and files (disk usage)
Syntax: du [options] [file or directory… ]
First acquaintance with linux system---ubuntu

Fifteen. Create directories and files
syntax: mkdir [options] directory location and name...
Mkdir command to create a new directory (make directory)
mkdir -p one-time creation of nested multi-level directories
Touch command to create an empty file
in command to create a key link (link) File
soft links (symbolic links) are applicable to files and directories, and must be specified in conjunction with the -s option. Soft links will fail after deleting the original file.
Hard links can only be used for files, and hard links and original files must be in the A file system (linux partition), which is still available after deleting the original file
1): Copy delete Move directories and files: Rebuild a copy of the file or directory (source) that needs to be copied, and save it 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 [options] The file or directory to be deleted...
Common options: -f: Force deletion directly
-i: Remind the user to confirm when deleting a file or directory
-r: Use when deleting a directory, means recursively delete the entire directory tree

16. Find files and directories
1): The search scope is determined by the environment variable PATH: echo $PATH (command to view user environment variables)
Which command finds the directory where the command file executed by the user is stored
Syntax: which command|program name (default When the first target is found, do not continue to search); which -a command|program name (if you want to find in all search paths)
First acquaintance with linux system---ubuntu
Note: When using which to find an internal command, the corresponding program will not be found
2): use Recursive way, according to the name, type, size and other properties of the target to perform fine search
Syntax: find [find range] [find condition expression]
First acquaintance with linux system---ubuntu
Note: use wildcards? * It is better to expand the file name with double quotation marks. When multiple search conditions need to be used at the same time, logical operators "-a" and "-o" can be used between each expression to indicate and (and) or (or)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325153265&siteId=291194637