Linux task processing and log viewing common commands

Source: Internet
Author: User

Task Processing Commands:

(1) Ctrl + Z hangs up the process and puts it in the background
(2) Jobs shows the currently paused process
(3) BG%N enables the nth task to run in the background (with a space before%)
(4) FG%N to enable nth tasks to run in the foreground
The default BG,FG indicates the last process action without%n!

Log View commands

(1) Use of tail
Tail-f App.log
command format;
tail[necessary parameters [select parameters] [file]2. Command function:
Used to display the content at the end of the specified file, and is processed as input when the file is not specified. Common view log files.
Command parameters:
-F Loop Read
-Q does not display processing information
-V displays detailed processing information
Number of-c< > bytes displayed
-n< lines > Display rows
–pid=pid is shared with-F, which means that the process ends after the id,pid dies.
-q,–quiet,–silent never outputs the header of a file name
The-s,–sleep-interval=s is combined with-F, which indicates the sleep s seconds at each repetition interval

(2) Watch
Watch-d-N 1 Cat App.log
Command format:
watch[parameters [command]
Command function:
The output of the command can be output to a standard output device, which is used for periodic execution of commands/timed execution commands
Command parameters:
-N or –interval watch defaults to run the program every 2 seconds, you can use-N or-interval to specify the time interval.
-D or –differences use the-D or –differences option Watch to highlight the changed area. The-d=cumulative option highlights the changes that have been made (regardless of the recent change).
The-T or-no-title will turn off the watch command at the top of the interval, command, output of the current time.
-h,–help Viewing Help Documents
Usually the first one is enough.

Linux task processing and log viewing common commands

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.