Iii. Linux/unix operation commands Accumulate "gzip, jar, tar, find, crontab"

Source: Internet
Author: User
Tags gz file

under the use of Linux/unix, often using the text interface to set up the system or operating system, the author himself in the process of work is also in constant contact with this command, so for This special brewing, preparation, began the writing of this article. This paper mainly records some of their usual linux/unix under the operation of commands, record and collation, one can deepen the image, two can record sharing. I hope you crossing, for inappropriate or ambiguous places, give the specified and explain, in order to learn and improve together.
"Reproduced use, please specify the source: http://blog.csdn.net/mahoking "

009Linux gzip Command


1 command format
gzip [options] [file or directory] format gzip [option] [File/dir]
2 command functions
Gzip is a widely used compression program, after which the file is compressed, and its name is followed by a ". gz" extension.
3 Common examples
Example 01

Command: Gzip–d testFile.tar.gz
Input:
[Email protected] root]# gzip–d testFile.tar.gz
Description
Unzip the file.tar.gz to File.tar.
-D or--decompress or----uncompress unpack the compressed file.
Example 02
Command: Gzip–r Testfile.tar
Input:
[Email protected] root]# gzip–r Testfile.tar
[[email protected] root]# ls
[Email protected] root]#
Description
Compress a tar backup file with a. tar.gz file name extension.
-R or--recursive recursively handles all files and subdirectories under the specified directory.


010Linux jar Command


1 command format
jar [Options] [Files] format jar [option] [file]
2 command functions
Jar command, unzip the zip, war file.
3 Common examples
Example 01

Command: JAR–XVF testfile.zip
Input:
[Email protected] root]# JAR–XVF testfile.zip
Description
Unzip the Testfile.zip and show the decompression process.
-X expands the specified file or all files of the jar package;
-V displays process information;
-f Specifies a compressed file (JAR) filename, which is usually required.


011Linux tar command


1 command format
tar [options] [File/directory] format tar [option] [File/dir]
2 command functions
The Userdel command unlocks the file directory for backup.
3 Common examples
Example 01

Command: TAR–XVF Testfile.tar
Input:
[Email protected] root]# TAR–XVF Testfile.tar
Description
Unzip the Testfile.tar. zip file
-X unlocks the parameter directives of the compressed file;
The file is displayed during the-v compression process;
-F Use file name, please note, after F to immediately answer the file name, do not add parameters!

012Linux Find command


1 command format
Find [Start directory] Find conditional actions
2 command functions
The Find command is used to find the files we need.
3 Common examples
Example 01
Command: Find. –name "*.txt"-print
Input:
[[email protected] root]# find. –name "*.txt"-print
Description
Find all the ' *.txt ' files in the current directory and subdirectories and print the display.
-name ' string ' Find file name matches all files of the given string, wildcard characters * 、?、 [] in the string.

013Linux crontab Command


1 command format
Userdel [options] [user]  format userdel [option] [user]
2 Command Features
 crontab command to submit, edit, list, or remove cron jobs. The author himself, in the work contact, uses this command to set up a timed task.
3 Common Examples
Command basic format

* * * * * Command
Time-of-Day week command
1th column represents minutes 1~59 per minute with * or */1 means
2nd column represents hours 1~ 23 (0 means 0 points)
The 3rd column represents the date 1~31
The 4th column represents the month 1~12
5th column identification Number week 0~6 (0 means Sunday)
6th column to run the command
example:
0 23 * * 6/ USR/LOCAL/ETC/RC.D/LIGHTTPD Restart
The above example shows the restart of Apache every Saturday at 11:00am.
* 23-7/1 * * */usr/local/etc/rc.d/lighttpd restart
11 o'clock to 7 a.m., restart Apache every hour.
Example  crontab–e
  command:
Input:
[[email protected] root]#  crontab–e
[[email protected] root]#  
0 * * 6/usr/local/etc/rc.d/lighttpd restart

Description
crontab-e[user]-Edit user's current crontab.
Example 02
Command: Crontab–l
Input:
[Email protected] root]# crontab–l
[Email protected] root]#
0 * * 6/USR/LOCAL/ETC/RC.D/LIGHTTPD restart

Description
crontab-1[user]-lists the user's current crontab.

Iii. Linux/unix operation commands Accumulate "gzip, jar, tar, find, crontab"

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.