Linux/mac/shell Common Commands

Source: Internet
Author: User

Common commands

· LS View the files in the current directory

· CD into a directory

· CD-Jump back to previous directory

· CD ~ Enter the current user's personal directory

· PWD Output Current path

· mkdir new Folder

· Touch New File

· Find File

· ln establishes a link

· Du view directory size

· DU-SH * with units display directory information

· DF View disk Size

· Df-h with unit display disk information

· Cal Display Calendar

· Date Displays the current day, time

File Transfer class

· MV Move File/rename

· CP [File Name] [Destination] Copy file

· Cp-r [File Name] [Destination] recursive copy (primarily for folders)

· SCP remote Copy, except for the need to add 1219.www.qixoo.qixoo.com/[email protected] in front of the directory of the remote address: In addition to the form of address information, command usage is consistent with copy

· FTP Starts the FTP service.

Compression and decompression

· Tar

Packaging compression

-C ' archive file

'-X ' unzip the file

'-V ' shows the compression/decompression process

'-j ' bzip2 compressed files

'-Z ' gzip compressed files

'-F ' use file name

TAR-CVF only packaged, not compressed

TAR-ZCVF packaged and compressed with gzip

TAR-JCVF packaged and compressed with bzip2

To decompress, simply change the C in the above command to X.

System Command Class

· WHOAMI Show current Operation user

· Hostname Display host name

· Uname Display System Information

· Top dynamic display currently consumes the most resources process information

· PS Display instantaneous process status PS aux

· Kill kills the process (qkxue.net/top/ps after viewing the process ID, kill [ID])

· Netstat Displaying network status information

· which [command] to see the path

· Export [var]= "XXX" assigns values to system variables

· alias [Short]=[long] for command setting aliases

Text Manipulation Classes

This is an important section, which will be followed by articles that describe these concepts, only as a directory.

· Cat View File Contents

· Head View File header contents

· Tail viewing the contents of a file trailer

· More/less page display of file contents

· Grep finds a string in a text file

| Pipeline

> >> Redirection

Package Management (Ubuntu)

This article mainly introduces the Ubuntu package management concept, most Mac users use brew, the principle is similar, specific commands refer to the Help document.

sudo apt-get update updates software source information

sudo apt-get upgrade update installed packages

sudo apt-get dist-upgrade upgrade system (Discreet!!! )

sudo apt-get install software

sudo apt-get-f Install repair installation

sudo apt-get remove software

sudo apt-get remove--purge remove software and configuration files

sudo apt-get autoremove Auto-delete (non-deleted dependencies)

sudo apt-get clean && sudo apt-get autoclean cleanup of useless packages

Rights Management

· chmod changing permissions

· Chown user and user groups for changing files

Linux/mac/shell Common Commands

Related Article

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.