Linux Notes---Common directives

Source: Internet
Author: User

(not regularly updated in ... )

1. Switch between normal user and root

Su Root

2. Set a new root user password

sudo passwd root

Then enter the new root user password

3. Common compression commands

Format Introduction

*.z Compress Program Compressed files

*.gz gzip Program Compressed files ( most widely used )

*.BZ2 BZIP2 Program Compressed files

*.tar the TAR program to package data that has not been compressed

*.tar.gz tar program packaged files, which are compressed by gzip

*.TAR.BZ2 tar program packaged files, which are compressed by bzip2

Compress command

gzip [-cdtv#] File name

-C: Output compressed data to the screen, which can be processed by data flow redirection

-D: decompressed parameters

-T: can be used to verify the consistency of a compressed file to see if the file is error-free

-V: can show the source file/compressed file compression ratio and other information

-#: Compression level, 1 fastest but the worst compression ratio, 9 slowest but compression ratio best default is-6

Read GZIP-Compressed files

Zcat "File name"

bzip2 [-cdkzv#] File name

Parameters:

-C: Output the data generated during the compression process to the screen;

-D: decompressed parameters

-K: retains the source file without deleting the original file;

-Z: Compressed parameters

-V: can show the source file/compressed file compression ratio and other information

-#: Same as gzip, all in the calculation of compression ratio parameters,-9 best,-1 fastest.

Read BZIP2 Compressed files

Bzcat "File name"

4. Common Packaging commands

Tar

Compression: Tar-jcv-f [filename.tar.bz2] The name of the file or directory to be compressed

Query: tar-jtv-f [filename.tar.bz2]

Decompression: tar-jxv-f [filename.tar.bz2]-C to extract the directory

Linux Notes---Common directives

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.