Linux commands to use

Source: Internet
Author: User

1.cd

1. Name: CD

2. Objects used: All Users

3. Command format: CD [DirName] (CD and directory separated by spaces)

4. Function: Switch the current directory to dirname.

The CD enters the user's home directory;

CD ~ Enter the user's home directory;

CD-Returns the directory where the directory was before it entered;

Cd.. Return to the parent directory (if the current directory is "/", then "/"; "..." after execution) The meaning of the parent directory);

Cd..  /.. Return to the top level two directory;

CD!$ Use the parameters of the previous command as CD parameters.

2.ls

1. Ls-a lists all files under the file, including "." The beginning of the hidden file (the Linux file hidden file is preceded by the., if present: Represents the existence of the parent directory).

2. Ls-l lists the details of the file, such as creator, creation time, file read-write permission list, and so on.

3. Ls-f add a character to the end of each file to indicate the type of the file. ' @ ' means symbolic link, ' | ' Represents the FIFOs, "/" for the directory, and "=" for the socket.

4. Ls-s prints the size of the file after each file. Size (sizes)

5. ls-t sort files by Time duration (time)

6. ls-a list except "." and ".." Other than the file.

7. Ls-r lists all subdirectories in the directory, equivalent to the "recursive" implementation in our programming

8. ls-l lists the link names of the files. Link (links)

9. ls-s sort files by size

3.rf1. command format:

RM [Options] File ...

2. Command function:

Delete one or more files or directories in a directory , and RM does not delete the directory if the-r option is not used. If you use RM to delete a file, you can usually still restore the file to its original state.

3. Command parameters:

-F,--force ignores nonexistent files and never gives hints.

-I,--interactive for interactive deletion

-R,-R,--recursive instructs RM to delete all directories and subdirectories listed in the parameters recursively.

-V,--verbose detailed display of the steps performed

--HELP Display this help message and exit

--version output version information and exit

4.sz/rz

SZ command send file to Local:

1 # sz filename

RZ command to upload files locally to the server:

1 # rz

After executing the command, select the file you want to upload in the pop-up box.

5. Jar

1, packaging

JAR-XVF project.war/project_a

-C Create War package

-V Show Process information

-f Specifies the JAR file name, usually this parameter is required

-M does not produce a manifest for all items (the Manifest) file, this parameter ignores the-m parameter

-0 This is the Arabic numeral, only packing does not compress the meaning


2, Unzip

JAR-XVF Project.war

Extract to current directory


Detailed jar command

Using the jar command without any, we can see the use of the Jar command as follows:

jar {ctxu}[vfm0m] [jar-file] [manifest-file] [-C directory] File name ...

where {CTXU} is a subcommand of the jar command, each time the jar command can contain only one of the CTXU, each of which represents:

-C Create a new JAR file package

-t lists the contents list of the JAR file package

-X expands the specified file or all files of the JAR package

-U update the existing jar package (add file to jar file package)


In particular, in the release of the parameters, c/x/t/u can only exist one! Cannot exist at the same time!

Because it is not possible to compress and decompress simultaneously.

-Z: Do you have the properties of gzip at the same time? i.e. do I need gzip compression?

-j: Do you have bzip2 properties at the same time? i.e. is it necessary to compress with bzip2?

-V: Files are displayed during compression! This is commonly used, but is not recommended for use in the background execution process!

-f Specifies the JAR file name, usually this parameter is required


Please note that after f you need to pick up the file name immediately! Don't add any more arguments!

For example, using "TAR-ZCVFP tfile sfile" is the wrong way to write

"TAR-ZCVPF tfile sfile" Just right!

-P: Use original file properties (attributes are not changed according to user)

-P: You can use absolute path to compress!

-N: Newer than next date (YYYY/MM/DD) will be packaged in the new file!

–exclude file: In the process of compression, do not package file!

-m Specifies the MANIFEST manifest file that needs to be included

-0 storage, no compression, so that the resulting JAR package will be larger than the size without the parameter, but faster

-M does not produce a manifest for all items (the Manifest) file, this parameter ignores the-m parameter

[jar-file] is a jar package that needs to be generated, viewed, updated, or unpacked, which is a subordinate parameter to the-f parameter

[manifest-file] is the manifest manifest file, which is a dependent parameter of the-m parameter

The [-C directory] represents the action that goes to the specified directory to execute the jar command. It is equivalent to using the CD command to go to the directory and then execute the JAR command without the-c parameter, which can only be used when creating and updating jar packages.

Filename... Specifies a list of files/directories that are files/directories to add to the JAR package. If a directory is specified, the jar command automatically packages all files and subdirectories in the directory when it is packaged.

Linux commands to use

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.