Commonly used linxu operation commands

Source: Internet
Author: User
Common linxu commands-general Linux technology-Linux technology and application information. For more information, see the following. Extract

Most Linux distributions contain two tools: zip and unzip.

These two tools can be used to create a compressed file compatible with WinZip, And the WinZip compressed file can be unzipped on Linux.

The following are common commands:

* Zip documents *

Create a compressed file named documents.zip that contains all the files in the current directory.

* Zip-r documents *

Compress all files in the specified directory and Its subdirectories.

* Zip-R *

Compress all files in the working directory and Its subdirectories.

* Zip-R archive *-x *. doc

Compress all files and subdirectories in the working directory, but exclude files ending with. doc.

/////////////////////////////////////

? : % S #/usr/bin # g

?? You can replace all the paths/usr/bin in the file with/bin. You can also run the following command:

?? : % S/usr/bin/g

?? Here, "" is an escape character, indicating that the "/" character after it is a meaningful character, not a separator.

View virtual memory size

Ps-p -O vsz

Extract Program

Tar? Zxvf my_tar_file

/////////////////////////////////////

Chmod a + x my_file

This command turns "my_file" into executable by everyone. Check whether it is feasible:

Chmod u + x filename

Ls? L my_file

Please modify the extension name (such as. .exe or. bat) of the file under linuxand unix, and the file cannot be changed to run. The "executable access mode" is required for File Execution, rather than "file attributes" in DOS ".

//////////////////////////////////////// ////

The following command will find the file with the extension "htm" and followed by any character:

Locate *. htm?

The following command lists all files in the current directory whose names start with a, B, or any uppercase letter:

Ls [abA-Z] *

The following command lists all objects whose names start with a and end with n in the current directory:

Ls a * n

///////////////////////////////////

Rm-fr // delete an object

Df report file system space remaining

///////////////////////////////////////

Who view current users

//////////////////////////////////////// //

Ps-aux

Ps view Process

-E: displays all processes.

-F full format.

-H does not display the title.

-L long format.

-W width output.

A displays all processes on the terminal, including those of other users.

R only displays running processes.

X shows the process without any control terminal.

U, a, x

///////////////////////////////////////

-Operate the daemon of each user and the execution schedule.

Author Matthew Dillon.

Some parameter descriptions

Crontab file [-u user]-replace the current crontab with the specified file.

Crontab-[-u user]-replace the current crontab with the standard input.

Crontab-1 [user]-list the current crontab of the user.

Crontab-e [user]-edit the current crontab of the user.

Crontab-r [user]-delete the current crontab of the user.

Crontab-c dir-specifies the crontab directory.

Crontab file format: m h d m d cmd.

M: minute (0-59 ).

H: hour (0-23 ).

D: Day (1-31 ).

M: Month (1-12 ).

D: days in a week (0 ~ 6, 0 is Sunday ).

The program to be run by cmd is sent to sh for execution. The shell contains only three environment variables: USER, HOME, and SHELL.

The following is an example file:

# MIN HOUR DAY MONTH DAYOFWEEK COMMAND

# Every morning

1 06 *** date

# Every two hours

0 */2 * date

# Every two hours from PM to AM.

0 23-7/2, 8 **** date

# Am on the 4th day of each month and from Monday to Wednesday of each week

0 11 4 * mon-wed date

# A.m. of July

0 4 1 jan * date

Example

Lark: ~> The crontab-1 lists the current crontab of the user.

# MIN HOUR DAY MONTH DAYOFWEEK COMMAND

10 6 **** date

0 */2 * date

0 23-7/2, 8 **** date

Lark: ~>
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.