Code Sea Supplements: Common Linux commands (i)

Source: Internet
Author: User

First, Linux system installation

System installation can be divided into two categories: physical machine installed Linux, virtual machines (common virtual machine software has two kinds: VMware and VirtualBox) install Linux.

Installation process There are many tutorials on the internet, here is not to repeat.

Ii. Common Commands 

1. Files and directories

LS Lists directory contents

-l list File details L (list)

-a lists all files and directories in the current directory, including hidden files ("'.") Files that begin with, such as. bashrc)

-R is listed together with the contents of subdirectories

Which view the path of the specified command, for example: which LS (/usr/bin/ls)

mkdir creating the specified directory

-P creates a directory that, if no parent directory, is created together with the parent directory

CD Switch Directory

Touch if the file exists, update the access and modification time of each file to the current time; Create an empty file if it does not exist

Echo creates a file with content.

Cat views the contents of the file and outputs the content to the terminal by default

CP Copy files or directories

MV Move or rename

RM Delete File

-R Recursive Delete, can delete subdirectories and files

-F Force Delete

Find searches a file system for a file

WC statistics Text line number, word count, number of characters

-C (-bytes/-chars) shows only bytes number

-L (-lines) displays only the number of columns

-W (-words) displays only the number of words

Grep finds a string in a text file

RmDir Delete Empty Directory

-R with Rm-r

-F with Rm-f

Tree structure display directory (manual installation, ubuntu:apt-y install tree;centos:yum-y install tree)

PWD Displays the current directory

LN creates a linked file

-S Create soft connection

DF View Disk Usage

2. Shutdown/restart

Shutdown-t (number of seconds)    

-R shutdown Restart

-H shutdown does not restart

Now turn the machine off.

Halt shut down the machine

Reboot restart

3. Compress Package Management

Tar: Packaging compression

-C Archive File

-X Compressed file

-Z gzip Compressed file

-j bzip2 Compressed Files

-V shows the compression or decompression process V (view)

-F Use file name

RAR: compression: rar a-r Dir.rar dir

Decompression: Unrar x Dir.rar

Zip: Pack: zip-r dir.zip dir

Unpacking: Unzip Dir.zip

  

  

Code Sea Supplements: Common Linux commands (i)

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.