简体   繁体   中英

After OutPut displayed in linux , how can i see from begining

This is my Output using system.out.println which i got in Linux Server . The problem is taht , i am not able to view the output from serial number 1 , as the below occupies the entire screen .

please tell me how can i scroll to top ??

341:allitems: tq_relation
342:allitems: tr_num
343:allitems: trader_id
344:allitems: tradetick
345:allitems: trading_state
346:allitems: treas_shrs
347:allitems: treas_stk
348:allitems: treasury_yield
349:allitems: trend
350:allitems: uask_quote
351:allitems: uask_quote_date
352:allitems: ubid_quote
353:allitems: ubid_quote_date
354:allitems: under_cusip
355:allitems: undersymbol
356:allitems: unique_symbol
357:allitems: unit_measure
358:allitems: unpriced
359:allitems: unsolicited
360:allitems: valoren
361:allitems: value_pr_shortinterest
362:allitems: value_shortinterest
363:allitems: vega
364:allitems: vl
365:allitems: vol
366:allitems: volatility12
367:allitems: vwap
368:allitems: wanted_off_bid_ind
369:allitems: wk52hi
370:allitems: wk52hidate
371:allitems: wk52hidate_t
372:allitems: wk52lo
373:allitems: wk52lodate
374:allitems: wk52lodate_t
375:allitems: wkinprog
376:allitems: xchg
377:allitems: xdate
378:allitems: xday
379:allitems: xmonth
380:allitems: xyear
381:allitems: yield

The Power of Linux is that you are able to redirect in and output of certain commands to other commands as using the output of program 1 as input for program 2. This can be archived by using:

program1|program2

and more specific you could use a pager like less or more. With the less command you are able to scroll back and forth and search specific patterns in the output. The more command displays the output page wise. The next page of the file is displayed by hitting the enter key. For your purpose all you have to to is using.

myprogram|less 

or

myprogram|more

whatever you prefer. The other approach is to redirect the output to a file. You can do this with the Redirection Operator > and

myprogramm > log.txt

will log the output log.txt.

There is even a third method using the script command. When you are typing

script log.txt

at least in bash this would open a subshell and every input and output that is will get logged to log.txt. You can close and afterwards access the logile by using exit . In the last two cases you can view the log.txt file with you favorite text editor or pager.

You can redirect the output of you program to a text file:

$ ./myprogram >output.txt

Then view the text file with any text editor you like.

You can also pipe the result to the more command:

$ ./myprogram | more

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM