The most basic of Linux (including installing a Linux system in a virtual machine)

Source: Internet
Author: User
Tags clear screen

Here is a CentOS 6.5 64bit example (learn to use this, Kali is interested in his own research (this system is for play penetration))
One----"Configuring VMware Workstation
Custom--Select compatible version--Select installation method (choose Install later)--select system type (Linux-centos 64-bit)--Set the name and installation location of the virtual machine
--Set the number of CPUs and number of threads--Set the memory size of the virtual machine--Set the network type (bridging network)--Set the IO model--Set the disk type--set the disk interface--set the disk space size--Modify the virtual machine's disk name (not recommended)

Two----"Mounting discs
Cd/dvd-->use ISO IMAGE FILE (which is your system's CD-ROM)

Three----, start it.
The history of computer development
1. Batch processing computer
2. Multi-tasking system-multics
3. UNIX--->unix
4. BSD (UNIX transformation)
5. System V (UNIX transformation)
6. cp/m (PC)
7. DOS (Disk Operating System)
8. Apple System
9. Apple2 Desktop + mouse
10. Windows
11. FreeBSD OpenBSD
12. Sun OS (BSD)
13, Minics
14, Linucs-->linux
15, vmx-+->windowsnt —-->windowsxp
|->winwows Server 2000/2003/2008/2012


Stalman
GNU (recursive abbreviation: GUN not Unix) ———— freedom
GPL (General license): any agreement that complies with the GPL means that the program is free for everyone to download, install, use, change
Linux is following this protocol, so there's a lot of people who love it.

Linux distributions: Linux kernels are compiled on a common device, and the compiled system is packaged and distributed out
Redhat

Fees, maintenance fees, etc... So there's another CentOS
Centos
Compile the source code program published by Redhat and publish it for free

Debian-->ubuntu (Server,desktop)

Linux systems interact with users
GUI: Graphical user interface
GNOME:C Development
kde:c++ Development
Xface: Lightweight and lightweight, suitable for embedded systems
CLI: command-line interface
BASH: Default
Csh
Ksh
Sh


Linux system root directory/
Linux for Path representation
Relative path: Relative to the current position
Absolute path: Booting down from the root directory

Prompt for Linux
Format: [Current user name @ name of directory where host name] user identity prompt

Location:/Indicates the root directory
~ In your home directory
DirName indicates the directory name of the directory in which it resides

User identity prompt: $ #
#: Represents an administrator user
$: Normal User

User home directory:
Normal User home directory: Directory with the same username and/or user name
Root User home directory:/root


Linux command structure (format)
command [options] parameter
Command: is actually the name of a file in a Linux system.
Option: is used to correct the execution of the command.
There are two types of options:
Short options: Use-to guide, can be merged. With letters.
Long options: Use--to guide. With the word
Parameters: The effective object of the command.


About Terminal
Virtual Terminal: In the Linux system saw the black screen is the virtual terminal, a total of 6 virtual terminal ctrl+alt+f1~6
Physical Terminal: Multiple users connected to the same computer through physical cables
Pseudo Terminal: The terminal that connects the server remotely through the network, called as the terminal.

Check terminal type and terminal number
# TTY

/dev/pts/0~n Pseudo Terminal
/dev/tty1~6 Virtual Terminal

Linux Command classification
Built-in commands
External command

Type command
Role: the command to check for instructions is a built-in command or an external command.
Typeface:builtin--> built-in
/path/to/file--> external Commands


Linux Commands:
1. Clear: Clear Screen
2. mkdir (Make directory): Create a directory at the specified location, and if you do not specify a path, create it in the current location
Format: mkdir [OPTIONS]/path/to/dir
Options:
-P: Create a parent path before creating a subdirectory if the parent path does not exist
-V (vervose): Show Details


3. LS (list): Displays all files and directories included in the specified directory
Common options for LS
-A: Show All files (including hidden files)
-D: Show only the directory itself
-L: Displays detailed property information for the file (type of file, permissions, creator, size ...) )
The first position of the
D: Catalogue
-: General Documents
L: Connection file (shortcut to Windows)
-H: Displays the size of the file in an easy-to-read manner

4. PWD (Print working ddiectory): Displays the current location

    5, CD (change directory): Changing directory
        common usage
         Cd/path/to/dir switch to the specified directory
        CD:   Return to the top-level directory at the current location
        CD-  return to the last directory
         CD/  return to the root directory
        CD ~  return to the current user's home directory
& nbsp;       cd    return to the current user's home directory
        
Example
    1, switch to/tmp directory
        #cd/tmp
    2, create a new directory under/home, the name of the directory is your own name all spell
        #mkdir/home/ Zhansan
    3, create a new directory in/TMP, the name of the directory is your own name all spell
        #mkdir/ Tmp/zhansan
        #mkdir Zhangsan



which command:
Role: View the location of the file in the system that corresponds to the specified external command


The composition of man
1, User Commands users command use Help
2. System Calls Call Use Help
3, C library Functions function Libraries use Help
4, Devices and special files device and special file use Help
5. Files Formats and conventions file format and file contents Help information
6, Games et.   Al. Game Help
7, Miscellanea other Help
8. System Administration tools and deamons administration commands use Help

Command passwd 1
/etc/shadow 5


Man 1 passwd View Help for passwd commands
Man 5 passwd View Help for paswd command configuration file (/etc/shadow)


Related Operations for man
Enter: Line down
Space: down one screen
Ctrl+d: Down half screen
K: Up one line
B: up one screen
Ctrl+u: Up half screen
Q: Exit Help
/keywords: Retrieves the specified keyword from the current position
N: Forward to continue retrieving the specified keyword
N: Reverse continues to retrieve the specified keyword


Hostname
Format: hostname [NAME]
Function: Display or view the name of the current host
Option: None
NOTE: hostname only temporarily modifies the host name, and once the system is restarted, the modification is automatically invalidated.

Example: Displaying the current host name
# hostname
Example: Modifying a host name is called
# hostname ZXHK


Computer Time issues (important)
    hardware time: Oscillator circuit + button battery
    software time: When the computer starts, The current time is automatically read from the hardware time as the system time.
              After the computer starts, it will run a simulated oscillation circuit using the software itself. , use this circuit to maintain your own time.
       

Date
    format 1:date Month Day hour minutes. Seconds
    format 2:date [OPTION] ... [+format]
    function: View or set the software time of the current system
   
   
Common format formats
    %d: Display in format Day/month/year
   %F: In format year-month-day display
   %Y: Show year
    %H: Display hours, (00-23)
   %M: Display minutes, (00-59)
   %s: Display seconds,
   % T: Show Hours: minutes: seconds, Effect equals%h:%m:%s
   %w: Display day of the week, 0 = Sunday
   %s: The time elapsed from the date of the computer
    
   
Example: Viewing the system time
    # Date
Example: Modifying the system time to 2016.6.1.12:30:45
    # Date 060112302016.45
Example: Displays the system time, requires a format of 2015-05-09-12:31:45
    # mkdir ' Date + %f-%h:%m:%s ' (' inverted quotation marks are executed inside the command)

Hwclock
Function: Display or set hardware time
Format: hwclock [options]
Options:
-W: Synchronize hardware time settings with software time
-S: Modify software time as hardware time

Common Tips
1. Curly braces unfold

Requirements: Three folders a b C under the home, and at the same time the CV leaves a folder under TMP 1 2 3 4 5 6
# mkdir/home/{a,b,c}/tmp/{1,2,3,4,5,6}

2. Quotation marks
Single quotes: Weak references, and the contents of quotes are output as-is
Double quotes: Strong references, variables in quotation marks are replaced
Anti-quote: Put in an inverted quote command

Example:
1. Define the variable name
#name =ZXHK

2. Use the variable to output the result his name is ZXHK
# echo "His name is $name"
(Variables in Linux use $ to boot)

Example: Create a folder, the name is the current system time, the format is YY-MM-DD
# mkdir ' Date +%f '


Some basic commands
Touch
Action: Create an empty file
Format: Touch/path/to/filename

Example: Create three files under Home a.txt B.doc QQ
# TOUCH/HOME/{A.TXT,B.DOC,QQ}


RM
    role: Delete files and directories
    format: RM [options]/path/to/file
    options:
       -F: Force Delete, no more asking
       - R: Recursive delete, often used to delete directories
   
   
about file colors
    Blue: Contents
     Black: General file
    Green: executable
    light blue: Soft connection


Linux Configuration IP Address
1. NIC Configuration file location
# Cd/etc/sysconfig/network-scripts/ifcfg-eth0
2. Edit the NIC configuration file
# Nano Ifcfg-eth0
There are two lines in the modified section
ONBOOT=YES Specifies whether the network adapter starts automatically
NM_CONTROLLED=NO Specifies whether the NIC is managed by NetworkManager

Add two lines
Ipaddr=172.16.1.xxx specifying the network card IP address
netmask=255.255.0.0 subnet mask for the specified network card

3. Save and exit
Ctrl+x ===> y
Enter

4. Restart the network service for the modified IP address to take effect
# Service Network Restart

5. View the IP address of the current host
# ifconfig Eth0

Note : The NIC configuration file is often used and error-prone. I'll give you another summary:

Sometimes the connection is not Xshell you may be wrong when you set the network type (bridging network) not selected bridging

Maybe you can not match well, please solve it yourself ... I solved it myself, too. 0.0

Author by: Xiaoxiang rain wrong

The most basic of Linux (including installing a Linux system in a virtual machine)

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.