2nd Day of Linux Learning

Source: Internet
Author: User
Tags clear screen echo command temporary file storage

CentOS File System

/

/ boot boot, kernel

/ usr system software resource storage location

/ tmp temporary file storage location

/ etc configuration file storage location

/Dev devices to put the hardware device/DEV/SDA

/DEV/SDA1Mount/ boot Ext4

/dev/sda2Mount/EXT4

/dev/sda3swapswap

/DEV/SDA4 Extended partition

/dev/sda5Mount/testdirext4

/ Home places users other than the root user

/rootRoot user's home directory

/ var places frequently changing content, such as log files

/lib Basic shared library files


View the current user's commands

WhoAmI View currently logged in account

Who View all logged-in users

TTY View your current terminal number

Who am I view current login user, terminal number, system time, login IP


CentOS6.8 Installing the VMware tool process:

DF View the path of the disc mount

cd/media/vmware\ tools/ Enter the disc

CP vmwaretools-10.0.6-3595377.tar.gz/testdir/ Copy the compressed package from the CD to the system directory

Cd/testdir entering the system directory

Tar vmwaretools-10.0.6-3595377.tar.gz Extract Files

CD vmware-tools-distrib/ into the directory generated after decompression

/testdir/vmware-tools-distrib/vmware-install.real.pl D executes the script in the form of an absolute path

The script. Pl is written by the Perl language


gedit/etc/gdm/custom.conf Open file, set automatic login

[Daemon] New plus 2 lines

Automaticloginenable=true

Automaticlogin=root


Gedit/etc/sysconfig/network Modifying host names

Hostname=centosx


X-shell How to exit a linked Linux system

ExitLogout ctrl+d

Ctrl+l Clear Screen


The Administrator account is not determined by the name, but by the UID.

For example: root can not be an administrator account, ordinary users can also become Administrator account

Id-u username View account UID


Root User:

A special administrative account is also known as a super user

Root is close to complete system control

Almost limitless capacity for system damage.

Do not log on as root unless necessary

Ordinary (non-privileged) users:

Limited access

The ability to inflict damage is relatively limited


User interaction with the host, the device must be used

Physical Terminal: Direct access to the local display and keyboard devices

/dev/console

Virtual Terminal: A terminal, device file path:/dev/tty#, which is attached to a physical terminal and implemented in a virtual software way.

Terminal also called physical console.

CTRL+ALT+F1, switch to Tty1 in init 5 mode for the graphics terminal

CHVT (change virtual terminal) # Switch to a terminal only on native operation

ctrl+alt+f2-6, switch to character interface character terminal

SHIFT+PGUP/PGDN up/down page in the character terminal

Graphics Terminal: A virtual terminal, attached to the physical terminal on the virtual implementation of software-based terminal, but additional to provide desktop environment;

Analog Terminal: Open command line in GUI and remote Open interface based on SSH protocol or Telnet protocol, device file:/dev/pts/# [0,∞]


To view the commands for the current terminal

W Detailed view of all terminal information

TTY View device path for current terminal


Shell: The user interface of a Linux system that provides user interaction with the kernel

The shell is also known as the Linux command interpreter (interpreter)

The shell is an interface of a high-level programming language. It receives the command entered by the user and feeds it into the kernel to execute.

echo $SHELL View current SHELL

Cat/etc/shells viewing the system-supported shell

/bin/sh-/bin/bash

/bin/bash

/sbin/nologin

/bin/dash

/bin/tcsh

/bin/csh

The shell type used by the system account is Nologin type

The GNU Bourne-again Shell (bash) is one of the most important tool software in the GNU program and is currently the Linux standard Shell, compatible with SH


PS1 variable: Defines a command-line prompt

echo $PS 1 format: [\[email protected]\h \w]\$

#表示管理员账号

$ indicates a regular user account


Command type

Type: To see if the command is internal or external command

# type COMMAND

Built-in command kernel

Brought by the shell, and provided by a command, the Enable command enables or disables internal commands

Enable [option] [COMMAND]

- N Disables internal commands and enables the command directly with the command without the-n

External commands are installed by the gun as file

The executable program file is available under a file system path of the current system;

Which,whereis to view external command locations

Command execution order:

See if the built-in commands are first

And go to the hash cache to find

Finally, go to the $PATH environment variable to find

Hash command: Displays the commands in the cache

Hash–r Clear All Caches

hash-d commond Clear Specified command


COMMAND [OPTIONS ...] [ARGUMENTS ...]

Options: One or some of the features used to enable or disable commands;

Short options:-C, for example:-L,-H

Long options:--word, for example:--all,--human-readable

Parameters: The object of the command, such as file name, user name, etc.

Attention:

1, multi-options, and multi-parameter and command separated by using white space characters

2. Cancel and End command execution: ctrl+c,ctrl+d

3. Multiple commands can be used; separate symbols

4, a command can be divided into multiple lines


Two types of clocks for Linux:

System clock: Run by the Linux kernel through the CPU's operating frequency;

Date: Displays the system time

Date [MMDDHHMM[[CC]YY]][.SS] modifies system time

Hardware clock: Motherboard time

Hwclock,clock: Display Hardware clock

-S,--hctosys to calibrate the system clock, whichever is the hardware clock

-W,--SYSTOHC to calibrate the hardware clock, whichever is the system clock


Cal Displays the calendar, which displays the current month calendar by default

Cal 06 2017 displays June 2017 calendar

Nano Text Editor


Screen command: You must be logged on to the same host with the same user to use

Screen Pack Installation:

DF View disc hangs in path

Rpm-i/disc path/packages/screen<tab key completion command > Install Screen Pack

Open the new screen:

# screen–s [SESSION]//session for tag (optionally set), opposite to link your tag

Join session:

# screen–x [SESSION]

Exit and close screen:

# exit

Peel the current screen:

Eg:screen Yes terminal will be occupied by this program

Ctrl+a,d (release and press) to release the console, and the program is still running, even if the console is disconnected this Yes program can also run

Restore a screen

Screen-r [SESSION] resumed yes this program interface

Show all screens that are already open:

Screen-ls


echo command

Function: Display characters

Syntax: Echo [-nee][string]

Description: Echo will send the input string to standard output. The output string is separated by a white space character, and a newline number is added at the end

-N does not wrap characters at the end of the line

-E If the following character appears in the string, it is handled in particular, not as a general text output:

\a issued a warning;echo-e "\a"

\b Backspace echo-e "Abdc\bxx"

\c finally not add the line break symbol;

\ n Wraps and the cursor moves to the beginning of the line;

\ r The cursor moves to the beginning of the line but does not wrap; ECHO-E "Abdc\rxx"

\ t Insert tab;

\ \ insert \ character;

\0nnn Insert nnn (octal) represents the ASCII character echo-e "\0101"

Echo-e "\033[43;31mred color\033[0m" 30-37 foreground color 40-47 background color

\XHH Insert the ASCII character represented by the HH (hexadecimal)

echo "$VAR _name": variable will be replaced, double quote table weak Reference command is not recognized, variable recognition

Echo ' $VAR _name ': variables are not replaced, strong references are not recognized

Echo ' echo $UID ': Command substitution command variable What do you recognize?

"is equivalent to $ ()


2nd Day of Linux Learning

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.