Shell script Shallow in

Source: Internet
Author: User

The most common Linux commands and tools

Directory Next document: CD name

Return to the previous directory: CD.

To view and edit a text file:
? View files: More, tail
? Edit File: VI

such as scripting. SH

VI shell.sh

To view system network status:
? View System Status: Top
? View network Status: Netstat
? View Network configuration: ifconfig

System processes:
Search: Ps–ef | grep "string"

: Ps-fu "string"?

Kill: Kill-9 <PID>

File, directory operations:
Catalog: mkdir, CD, pwd?

If you create a name:mkdir/tmp/name under the TMP directory

Create, copy, delete, view: Vi,cp,rm,ls?

Copy: CP destination File Destination Cp/tmp/name.tar.gz/tmp/name

Permissions: Chmod,chown?

chmod 777 Name.tar.gz

Looking for: Find,grep?

The current directory finds files with the specified string? Grep–rn "string". ? ?

Locate the file with the specified string under the specified directory:? find/var-type f-mount |xargs fgrep-l "PHP"

Package Compression and unpacking:
? [[email protected] ~]# tar-cvf/tmp/etc.tar/etc <== only packaged, not compressed!? [[email protected] ~]# tar-zcvf/tmp/etc.tar.gz/etc <== packaged, compressed with gzip
? [[email protected] src]# Tar-xvf/tmp/etc.tar unpack the package without compression? [[email protected] src]# tar-zxvf/tmp/etc.tar.gz uncompressed

Such as: The contents of the/OPT directory compressed into the work number lisun.tar.gz

Tar-zcvf/tmp/lisun.tar.gz/opt

While[[]]

Do

Touch $name 1$name2.txt

Done

For (())

Do

Done

Pass parameters

Read name

Shell script Shallow in

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.