Linux instruction Learning

Source: Internet
Author: User
Tags clear screen

Bash command
Basic commands
File Operations Command
Text command
System common Commands
Software source (software warehouse)
VI directive
Ubuntu Directory
Executable file
File type (typically the first character of a file listed with the LS command)
Ubuntu permissions
Three types of identities
Ubuntu Package operation
Ubuntu installs Ubuntu Desktop Program (for server-only Linux, i.e. no graphical interface, only command-line Linux)
Virtual machines
Basic knowledge
Network connection mode

Bash Command basic commands
    • LS Displays the file in the current directory
    • Ls-al show files in the current directory in more detail (including hidden files)
    • PWD Displays the current directory
    • CD into the corresponding directory
      • Cd.. Return to previous directory
      • CD/Return root directory
      • CD ~ Enter the current user root directory
    • TAB key Auto-complete
    • Su root log in as root
    • sudo passwd setting a new password to the root user
    • Reboot restart
      • Shutdown-r now restart
    • Poweroff shut down the machine
      • Shutdown-h now shutdown
      • Halt shut down the machine
      • Init 0 shutdown
    • Ifconfig IP Address Information
    • Clear Clear Screen
    • SSH Remote Connection Host
    • WHOAMI View Current User
    • PS View Current Process
      • PS-AF View all the processes
    • Kill kills the process
    • Manual of the man Instruction name Inquiry instruction (more detailed than help)
File Operations Command
    • mkdir Creating a Directory
    • Rm-r-F directory name or rmdir directory name, delete the directory (the former can be deleted sub-files and directories, the latter can only delete the empty directory)
      • RM Delete File
    • Cat Output text content
    • CP file name another file name copy file
    • Touch file name to create a file
    • MV FileName Path Move file
      • MV FileName Modify file name with another filename
    • echo content >> filename input to specified file
Text command
    • >> Redirect (append)
      • > Redirect (overwrite)
    • More Query by page
      • Man ls | More the Help content of the LS instruction is queried by page (d can be paged during query.) where "|" is a pipe operation that outputs the previous instruction output as the input to the more commands later)
      • The more document name indicates that the document is viewed by page
    • Man ls | HEAD-10 display the first 10 lines of the LS instruction Help content
    • Man ls | TAIL-10 display the following 10 lines of the LS instruction Help content
    • Nano Simple text Editor (Ctrl+o write to disk ctrl+x exit)
System common Commands
    • Ping IP to see if the network is connected
    • Hostname Host Name
    • sudo reboot reboot system
    • Find/List files for the entire system
    • | Pipeline command
      • Find ~ | grep. txt lists the file (where grep is filtered) with a. txt suffix in the current user's home directory
    • UNAME-A Display System-related information
    • File xxx.so (file to view a dynamic-link library similar to the. dll format in Win)
    • gzip file names compress specified files
    • Gunzip file name to extract the specified files
    • sudo mount Mount
    • sudo umount lifting the Mount
    • Instruction help Help information for query instructions
Software source (software warehouse)

apt:advanced Packaging Tool
Can use 163 of the software source (sources.list163 cloud disk saved)

VI directive
    • : Wq Save and exit
    • ESC enters normal mode (default mode)
    • A enter edit mode
Ubuntu Directory
    • /root directory
Executable file
    • /bin binary file
    • /sbin binary file
    • /boot Boot
    • /etc Configuration Directory
    • /MNT Mount Mount Directory
    • /Home Master Directory
    • /dev Device
    • /USR Unix system resource
File type (typically the first character of a file listed with the LS command)
    • D:directory
    • -: Indicates file (files)
    • L:link (equivalent to Windows shortcuts)
    • C: Represents a character file
    • B:block block files (for example, hard drives, optical drives, etc. are all part of a block file)
Ubuntu privileges three types of identities
    1. File owner –user u
    2. The group where the owner is located –group G
    3. Other Identities –other O
      Rwx:read Write Execute (where execute is capable of executing the file; If the folder is accessible to the folder)
      The first kind of expression:
      User Group Other
      RWX rwx rwx
      r–--(if any permission is not written-)
      The second means: (binary representation)
      User Group Other
      000 000 000
      111 111 111
      011 011 011 (i.e.: chmod 333 file name)

    • chmod changing permissions

      • chmod o+w file name allows other to have write permission
      • chmod o+x file name allows other to have execute permissions
      • chmod o-w file name to remove other write permissions
      • chmod ugo+rw file name or chmod a+rwx let user, group, other have read and write permission (A is all)
Ubuntu Package operation
    • sudo apt-get install XXX installation software
    • sudo apt-cache search xxx Find a software
    • sudo apt-get remove xxx uninstall software (not completely removed)
    • sudo apt-get purge xxx completely remove a software
    • sudo apt-get update updates
    • sudo apt-get upgrade upgrade
    • sudo dpkg-l | grep XXX Queries Whether there are specified packages
Ubuntu installs Ubuntu Desktop Program (for server-only Linux, i.e. no graphical interface, only command-line Linux)
    1. sudo apt-cache search Desktop
    2. sudo apt-get install ubuntu-desktop installing Ubuntu Desktop Program
Basic knowledge of virtual machines
    • Alt+ctrl Switch Mouse (for virtual machine and host)
    • Host: Homestay
    • VirtualBox: Virtual Machine
    • Client: Clients (for example: Ubuntu system installed on virtual machines)
Network connection mode

1. Bridging
The client is equivalent to a real host. You can access the Internet, set up IP, and access each other. If the environment does not have a network, the hosts cannot connect.
2.NAT: Network Address Translation
The client and host form a network, the client can access the Internet, and the host does DNS and NAT. IP is also assigned by the host. Clients cannot access other hosts on the network. In the absence of a network environment, the host and client network can still be connected. However, the client cannot modify the IP.
3.Only Host: Very similar to NAT, except that the client cannot access the Internet.
(NAT mode is generally used by default)

Linux instruction 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.