Linux Common Commands 1

Source: Internet
Author: User

Linux

Virtual Machine Network type:
Bridged (bridging mode): Virtual machines and hosts in parallel using the network
NAT (network address translation mode): Host provides network to virtual machine by converting network address
Host-only (Local mode): The virtual machine can only access the host and cannot access the extranet

View the language environment
Local-a

Software Installation:
Apt-get-h: View APT's help information, which is apt's instructions for use
Apt-get Install package: Installing software
Apt-get Update: Updating source
Apt-get Upgrade: Update an installed package
Apt-get Remove Package: Remove the installation packages
Apt-cache Search Package: Fuzzy searching
/etc/apt/sources.list set up the source for the package

Common shortcut keys:
CTRL + C terminating task
Ctrl+d End Input
Ctrl+l Clear Screen
Ctrl+k Delete the current position to the end of the line
Ctrl+u Delete the current position to the beginning of the line
Ctrl+w Delete to previous space
Ctrl+y will be affixed to the part that is ctrl+k,ctrl+u,ctrl+w cleared.
CTRL + A moves the cursor to the front
Ctrl+e move the cursor to the last edge
Ctrl+r used commands for fuzzy search
TAB Auto-Complete
Common commands:

Man View Help information
Date used to display or set the system's dates and times
Date + "%y%m%d%h%m%s" format the display of dates
Date-s Setting the current date
Synchronize the time to the hardware clock after you reset the date hwclock-w

Cal Displays the current month calendar
Cal-y Show Current year calendar
Cal 2018 Displays the calendar for the specified year

Tzselect Setting the time zone

passwd Modify Current Account password
passwd Username Modify the specified account password (requires Administrator privileges)

Logout logoff
Reboot rebooting the system (requires Administrator privileges)
Shutdown shutdown (requires Administrator privileges)

Shutdown-r now restarts immediately
Shutdown-r +5 five minutes after restart
Shutdown-r 12:12 Restarts the computer at 12:12

Shutdown-h now immediately shuts down the machine
Shutdown-h +5 five minutes after shutdown
Shutdown-h +5 "The System will shutdown after 5 minutes" prompts the user to shut down after five minutes
Shutdown-h 12:00 will be shut down at 12:00
Shutdown-c Canceling the shutdown operation

~ Represents the home directory of the current user

CD Switch Directory
Cd.. Page UP
CD-Returns the directory before switching
PWD View current work path

LS View current directory file list
Ls-a to display hidden files in conjunction with
Ls-l viewing list file details
Ls-lh displaying file details in a humane way
LS-LHT display file list by modified time
Ls-r all subdirectories of current directory traverse through
Tree to display all subdirectories


Shebang
#!/usr/bin/env Python3

mkdir Creating a Directory
Mkdir-p creating a multi-level catalog

Touch Create file (modify file timestamp)

RM Delete File
Rm-i prompt Confirmation before deleting
Rm-r Deleting a directory

MV filename New file name #更改文件名字
MV folder name new folder name #更改文件夹名字
MV File name Directory #移动文件到指定目录

CP file 1 file 2 #复制文件 (replaced in file 2 with content in file 1)

Stat file name #查看文件详细信息

Cat file name #将文件内容输出到屏幕上
Cat-s file name #显示内容时将连续多个空行合并为一个
Cat-n file name #显示内容时显示行号
TAC file name #倒序输出文件内容到屏幕上

WC file name #统计指定文件中的行数, number of strings, number of bytes
Wc-c #统计字节数
Wc-l #统计行数
Wc-m #统计字符数
Wc-w #统计字符串数 (separated by spaces, newline characters)

Sort file name #将文本内容排序后显示到屏幕上
Sort-r #倒序显示

Uniq #显示内容时将连续多个重复行合并为一个
Uniq-u #显示内容时将所有重复行合并为一个
Uniq-c #显示内容时将连续多个重复行合并为一个并显示重复次数

Cut-d:-F 1 QW Displays the contents of the first column of the document (delimiter:)

Linux Common Commands 1

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.