Linux Administrator Introductory Explanation (the difference from win system)

Source: Internet
Author: User

Today we will take you to learn Linux, and then have a free day, and then the next is to talk about the operation of the Linux system.

We all know that win is a graphics-based operating system, in fact, more professional point, win is suitable for the client, and the Linux system is suitable for server.

The Linux system you enter is a black and white machine, yes! is black and white machine!!!

All of them are command lines.

What does the Linux system consist of?

Linux kernel + various peripheral software

CentOS, community Enterprise operating system

##############################################
File system: The rules for grouping data in a spatial arrangement


Traditional MBR Partitioning mode
–1~4 a primary partition
–0~3 Primary partition + one extended partition (n logical partitions)
Precautions
–MBR partition table can only record 4 primary partitions, number range 1-4
– When it is necessary to use more than 4 partitions, you need to set up an extended partition (
Primary partition number), the extended partition can have up to 1
– Extended partition as a container of intermediate properties, from which it is again divided
The partition space is a logical partition

################################################

Typical file system types
–EXT4, fourth generation extended file system, RHEL6 series default
–XFS, advanced log file system, RHEL7 series default
–swap, swap space (virtual memory)

####################################################
Directory structure

Root directory/: All data is stored in this directory (starting point of Linux system)

/dev: Store device files

/dev/abc/1.txt

######################################################

Partition representation

HD, indicating IDE device
SD, indicating SCSI device

/dev/sda5

###################################################

Ctrl+alt: Mouse out now real machine


After the installation of the RHEL7 system is completed, the initial setup is required for the first boot.


When prompted to view protocol information or create a user, enter 1 and return.

Next enter 2 and enter to indicate acceptance of the license agreement.

Input two times C means continue, press ENTER will enter the Welcome screen.

####################################################

Click "unlisted"---------> Login with "root" system

#####################################################
RHEL7 Basic Operation
Virtual Console Toggle (Ctrl + Alt + Fn key combination)
–tty1: Graphical Desktop
–TTY2~TTY6: Character Console
#####################################################
Right-click "Open in Terminal"

Meaning of the command-line prompt identification
–[Current user @ Host name Current Location]$


– If the current user is root, the last character is #
[[Email protected] Desktop]#

– Otherwise, the last character is $
[[Email protected] Desktop]$

####################################################

Instructions for viewing a text file: Cat

Viewing the system version
[[Email protected] Desktop]# cat/etc/redhat-release
Red Hat Enterprise Linux Server Release 7.2 (MAIPO)

[Email protected] Desktop]# hostname #查看当前主机名

#####################################################

Blue: Directory
Black: Text File
Red: Compress Package
Green: Programs that can be executed


View and switch directories
Pwd-print Working Directory
– Purpose: View current working directory

Cd-change Directory
– Purpose: Switch working directory
– Format: CD [Destination folder location]

Ls-list
– Format: ls [options] ... [directory or filename] ...

[Email protected] Desktop]# pwd #显示当前所在位置

[Email protected] Desktop]# cd/#切换路径

[Email protected]/]# pwd #显示当前所在位置
[[email protected]/]# ls

[[email protected]/]# ls/root #查看/root Directory contents

[Email protected]/]# Ls/boot

[Email protected]/]# Ls/root/boot

[Email protected]/]# Ls/dev

################################################
Output information hint: command not found
Reason:
1. Wrong order
2. The command is not installed

#################################################
Command-Complete format

Command Word option parameter

Cat-n/etc/passwd

#################################################
.. Represents the parent directory

[Email protected]/]# CD.

Absolute path with/start
Relative path with current reference (no/start path)

[Email protected]/]# Cd/etc/pki

[Email protected] pki]# pwd
[[email protected] pki]# ls

[Email protected] pki]# Cd/etc/pki/ca #绝对路径
[Email protected] ca]# pwd
[Email protected] ca]# CD.
[Email protected] pki]# CD CA #相对路径
[Email protected] ca]# pwd

[Email protected]/]# cat-n/etc/redhat-release
[Email protected]/]# cat-n/etc/passwd
##################################################

List kernel versions
[[Email protected] Desktop]# uname-r
3.10.0-327.el7.x86_64


###################################################

Temporarily set the IP address
[[Email protected] Desktop]# ifconfig

[Email protected] Desktop]# ifconfig eth0

[Email protected] Desktop]# ifconfig eth0 192.168.1.168

[Email protected] Desktop]# ifconfig eth0

#################################################
Ls-list
– Format: ls [options] ... [directory or filename] ...

Common Command Options
–-l: Display in long format (displays detailed properties of directory contents)


List CPU Processor information
[[Email protected] Desktop]# LSCPU
[[Email protected] Desktop]# cat/proc/cpuinfo
Check memory size, idle condition
[[Email protected] Desktop]# cat/proc/meminfo


[Email protected] Desktop]# ls-l/root

[Email protected] Desktop]# ls-l/boot
[[Email protected] Desktop]# ls-l/home
[Email protected] Desktop]# LS-L/tmp
[Email protected] Desktop]# ls-l/opt

###################################################

Shutdown: Poweroff
[Email protected] ~]# Poweroff

Restart: reboot
[email protected] ~]# reboot

#####################################################
Add:

Fill key: Tab

[[email protected] ~]# IFCO (tab)

[[Email protected] ~]# if (two tabs in a row)

# Cat/et (tab)/red (tab)-R (tab)

# Ls/et (tab)/sysco (tab)/NETW (tab)-(tab)/IFC (tab)-E (tab)

###################################################

View Text file contents

Cat: Small File
Less: Large files Press Q to exit

View text File part content

Head-3/etc/passwd #显示头多少行
Tail-4/etc/passwd #显示尾多少行

head-12/etc/passwd
Tail-6/etc/passwd

LESS/ETC/PASSWD #按键盘上下键, can be scrolled

Find from text file contents, line containing the specified string

grep ' string ' text file path

grep ' Root '/etc/passwd
grep ' bin '/etc/passwd
grep ' bash '/etc/passwd

grep ' Hahaxixi '/etc/passwd

####################################################
mkdir: Creating a Directory

Touch: Create a file

###################################################

CTRL + C: End a running program or instruction

###################################################

Linux Administrator Introductory Explanation (the difference from win system)

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.