Linux Learning methods:
Your program to be executed on the server (Linux), the server does not have a desktop system, learning Linux is learning commands.
I. INTRODUCTION of Linux
1, Finnish university students, named Linux, because of personal interest, wrote a Unix-like operating system kernel.
2, Linux is an open-source operating system, currently in the server system widely used, mainly because of its free and open source.
3, for users, is through remote access to control the Linux system.
4, the server side will not install the desktop system, but the command line access to the operating system. The Linux system has many desktop systems, which will occupy the server resources after installation.
Second, the Linux login
Root user, super Administrator, generally do not log in with the superuser, so as not to accidentally cause damage to the server. The user name and password are used in the practice phase: root.
Third, the Linux file system
1. root directory/, equivalent to "Computer" (Partition: C:d: E: ...) in Windows. )
2, the operating system to partition the installation
(1) The partition that must be mounted:
/root directory
Swap virtual memory, swap partitions. Generally set to twice times the memory, but not more than 2G. No access, automatic system control.
(2) Optional Mount partition
/boot Save system boot file, generally will not be modified by a separate partition (around 1G)
Home directory for normal users
/var store dynamic files, logs, databases, etc. at any time to modify, delete, new and other files
Iv. Common Linux Commands
1. CD Switch directory
(1) CD/switch to root directory
(2) Cd/home switch to/home
(3) Cd/root switch to/root
(4) CD ~ Switch to the user's home directory (home)
(5) CD. Returns the upper-level directory, for example: CD. /.. /.. /
2. PWD View current directory path
3. LS List directory
(1)-L Detailed information
First Letter:-Indicates file
D indicates directory
L represents a soft connection file (shortcut in Windows)
Rwxrwxrwx refers to the permissions of the file, the first three bits: User rights, the middle three bits: group permissions, and the last three bits: other people permissions. If you do not have this permission, use '-' to indicate.
(2)-a displays all files, including "." Hidden files at the beginning
(3)-D lists the directory itself, not the list of directories in the column directory
(4)-H humanized display, convert byte size to XXGB,XXMB,XXKB
(5)-I display file ID number
4. mkdir Create Directory
(1) mkdir directory name
(2)-P Create a multilayer directory, for example: Mkdir-p aa/bb/cc/dd/ee
5. RmDir Delete Empty directory
(1) RmDir directory name
6. RM Delete files or directories
(1)-R Delete Directory
(2)-RF without confirmation, delete directly. Use with caution! Delete Files remember to back up!!!
7. CP Copy Copy
(1) CP file target directory
CP File Destination File
(2)-R full copy
(3)-P maintains file attributes, such as last modified time. The modification time is changed to the current time of the system when copying.
8. Move or rename the MV move
(1) MV source file target file
9. Touch Create File
(1) Touch file path
(2) Default permissions for creating files (421)
Example:-rw-rw-r--
r-read-4-100 (binary)
w-write-2-010 (binary)
x-excute-1-001 (binary)
U-user owner
G-group Group
O-other other people
File permissions: rwx read, Write, execute. r--Read only, can be deleted to see the permissions of the directory;
Directory permissions: R-List Permissions
W Create delete file or directory
x whether to enter the directory
10. Cat display text file contents
(1) Cat file
(2)-N Display line number
11, TAC reverse display text file content, contrary to cat command
12, more paging view files
(1) More files
(2) blank page, carriage return line down; CTRL + C or Q cancel
13, less paging display, you can page forward
(1) Less files
(2) PageUp up the page; the space page down;/keywords: search for keywords, press "n" to jump to the next matching keyword; Q exits.
14. Head view the first few lines of the file, head-10 file
15, tail View the file at the end of a few lines, tail-10 file
How to produce 5-10 lines of text files? | Pipeline
Cat passwd |head-n 5 |tail-n 10
To be continued .....
"Java" Java Learning Path -01-linux Foundation (i)