Sticky Header using shell less command
Asked Answered
N

1

6

I have a text table that I am displaying using less -S -R.

enter image description here

I would like that 3rd and 4th line of the output (the last 2 blue lines) to be a sticky header, so that it would work similar to the header here. Is it possible to do this with less?

enter image description here


Without using less, it's just a table of text (with special characters for the colours). You can copy this text into a my_file.txt file and run cat my_file.txt | less -S -R if you would like to test it out

2022-02-25T15:15:17.963Z
CCXT v1.74.16
publicAPI          | privateAPI         | CORS               | spot               | margin             | swap               | future             | option             | addMargin          | cancelAllOrders    | cancelOrder        | cancelOrders       | createDepositAddress | createLimitOrder   | createMarketOrder  | createOrder        | createReduceOnlyOrder | deposit            | editOrder          | fetchAccounts      | fetchBalance       | fetchBidsAsks      | fetchBorrowRate    | fetchBorrowRateHistories | fetchBorrowRateHistory | fetchBorrowRates   | fetchBorrowRatesPerSymbol | fetchCanceledOrders | fetchClosedOrder   | fetchClosedOrders  | fetchCurrencies    | fetchDeposit       | fetchDepositAddress | fetchDepositAddresses | fetchDepositAddressesByNetwork | fetchDeposits      | fetchFundingFee    | fetchFundingFees   | fetchFundingHistory | fetchFundingRate   | fetchFundingRateHistories | fetchFundingRateHistory | fetchFundingRates  | fetchIndexOHLCV    | fetchIsolatedPositions | fetchL2OrderBook   | fetchL3OrderBook   | fetchLedger        | fetchLedgerEntry   | fetchLeverage      | fetchLeverageTiers | fetchMarkOHLCV     | fetchMarketLeverageTiers | fetchMarkets       | fetchMyBuys        | fetchMySells       | fetchMyTrades      | fetchOHLCV         | fetchOpenOrder     | fetchOpenOrders    | fetchOrder         | fetchOrderBook     | fetchOrderBooks    | fetchOrderTrades   | fetchOrders        | fetchOrdersByStatus | fetchPosition      | fetchPositions     | fetchPositionsRisk | fetchPremiumIndexOHLCV | fetchStatus        | fetchTicker        | fetchTickers       | fetchTime          | fetchTrades        | fetchTradingFee    | fetchTradingFees   | fetchTradingLimits | fetchTransactions  | fetchTransfer      | fetchTransfers     | fetchWithdrawAddressesByNetwork | fetchWithdrawal    | fetchWithdrawalWhitelist | fetchWithdrawals   | loadLeverageBrackets | loadMarkets        | reduceMargin       | setLeverage        | setMarginMode      | setPositionMode    | signIn             | transfer           | withdraw          
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[32maax[39m                | [32maax[39m                | [91maax[39m                | [32maax[39m                | [22m[2m[31maax[39m[22m                | [32maax[39m                | [22m[2m[31maax[39m[22m                | [22m[2m[31maax[39m[22m                | [91maax[39m                | [32maax[39m                | [32maax[39m                | [91maax[39m                | [91maax[39m                  | [32maax[39m                | [32maax[39m                | [32maax[39m                | [22m[2m[31maax[39m[22m                   | [91maax[39m                | [32maax[39m                | [91maax[39m                | [32maax[39m                | [91maax[39m                | [22m[2m[31maax[39m[22m                | [22m[2m[31maax[39m[22m                      | [22m[2m[31maax[39m[22m                    | [22m[2m[31maax[39m[22m                | [22m[2m[31maax[39m[22m                       | [32maax[39m                 | [91maax[39m                | [32maax[39m                | [32maax[39m                | [91maax[39m                | [32maax[39m                 | [91maax[39m                   | [91maax[39m                            | [32maax[39m                | [91maax[39m                | [91maax[39m                | [32maax[39m                 | [32maax[39m                | [91maax[39m                       | [32maax[39m                     | [22m[2m[31maax[39m[22m                | [32maax[39m                | [91maax[39m                    | [32maax[39m                | [91maax[39m                | [91maax[39m                | [91maax[39m                | [91maax[39m                | [91maax[39m                | [32maax[39m                | [91maax[39m                      | [32maax[39m                | [91maax[39m                | [91maax[39m                | [32maax[39m                | [32maax[39m                | [91maax[39m                | [32maax[39m                | [32maax[39m                | [32maax[39m                | [91maax[39m                | [91maax[39m                | [32maax[39m                | [91maax[39m                 | [91maax[39m                | [91maax[39m                | [22m[2m[31maax[39m[22m                | [32maax[39m                    | [32maax[39m                | [33maax[39m                | [32maax[39m                | [32maax[39m                | [32maax[39m                | [22m[2m[31maax[39m[22m                | [22m[2m[31maax[39m[22m                | [91maax[39m                | [91maax[39m                | [91maax[39m                | [91maax[39m                | [91maax[39m                             | [91maax[39m                | [91maax[39m                      | [32maax[39m                | [91maax[39m                  | [32maax[39m                | [91maax[39m                | [32maax[39m                | [22m[2m[31maax[39m[22m                | [91maax[39m                | [91maax[39m                | [91maax[39m                | [91maax[39m               
[32mascendex[39m           | [32mascendex[39m           | [91mascendex[39m           | [32mascendex[39m           | [91mascendex[39m           | [32mascendex[39m           | [22m[2m[31mascendex[39m[22m           | [22m[2m[31mascendex[39m[22m           | [32mascendex[39m           | [32mascendex[39m           | [32mascendex[39m           | [91mascendex[39m           | [91mascendex[39m             | [32mascendex[39m           | [32mascendex[39m           | [32mascendex[39m           | [32mascendex[39m              | [91mascendex[39m           | [33mascendex[39m           | [32mascendex[39m           | [32mascendex[39m           | [91mascendex[39m           | [91mascendex[39m           | [91mascendex[39m                 | [91mascendex[39m               | [91mascendex[39m           | [91mascendex[39m                  | [91mascendex[39m            | [91mascendex[39m           | [32mascendex[39m           | [32mascendex[39m           | [91mascendex[39m           | [32mascendex[39m            | [91mascendex[39m              | [91mascendex[39m                       | [32mascendex[39m           | [91mascendex[39m           | [91mascendex[39m           | [22m[2m[31mascendex[39m[22m            | [22m[2m[31mascendex[39m[22m           | [91mascendex[39m                  | [22m[2m[31mascendex[39m[22m                | [32mascendex[39m           | [22m[2m[31mascendex[39m[22m           | [22m[2m[31mascendex[39m[22m               | [32mascendex[39m           | [91mascendex[39m           | [91mascendex[39m           | [91mascendex[39m           | [22m[2m[31mascendex[39m[22m           | [32mascendex[39m           | [22m[2m[31mascendex[39m[22m           | [33mascendex[39m                 | [32mascendex[39m           | [91mascendex[39m           | [91mascendex[39m           | [91mascendex[39m           | [32mascendex[39m           | [91mascendex[39m           | [32mascendex[39m           | [32mascendex[39m           | [32mascendex[39m           | [91mascendex[39m           | [91mascendex[39m           | [22m[2m[31mascendex[39m[22m           | [91mascendex[39m            | [22m[2m[31mascendex[39m[22m           | [32mascendex[39m           | [22m[2m[31mascendex[39m[22m           | [22m[2m[31mascendex[39m[22m               | [33mascendex[39m           | [32mascendex[39m           | [32mascendex[39m           | [91mascendex[39m           | [32mascendex[39m           | [91mascendex[39m           | [91mascendex[39m           | [91mascendex[39m           | [32mascendex[39m           | [91mascendex[39m           | [91mascendex[39m           | [91mascendex[39m                        | [91mascendex[39m           | [91mascendex[39m                 | [32mascendex[39m           | [91mascendex[39m             | [32mascendex[39m           | [32mascendex[39m           | [32mascendex[39m           | [32mascendex[39m           | [22m[2m[31mascendex[39m[22m           | [91mascendex[39m           | [91mascendex[39m           | [91mascendex[39m          
[32mbinance[39m            | [32mbinance[39m            | [91mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [91mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [91mbinance[39m            | [91mbinance[39m              | [32mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [32mbinance[39m               | [91mbinance[39m            | [33mbinance[39m            | [91mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [95mbinance[39m                  | [32mbinance[39m                | [22m[2m[31mbinance[39m[22m            | [22m[2m[31mbinance[39m[22m                   | [91mbinance[39m             | [91mbinance[39m            | [33mbinance[39m            | [32mbinance[39m            | [91mbinance[39m            | [32mbinance[39m             | [91mbinance[39m               | [91mbinance[39m                        | [32mbinance[39m            | [91mbinance[39m            | [32mbinance[39m            | [32mbinance[39m             | [32mbinance[39m            | [91mbinance[39m                   | [32mbinance[39m                 | [32mbinance[39m            | [32mbinance[39m            | [91mbinance[39m                | [32mbinance[39m            | [91mbinance[39m            | [91mbinance[39m            | [91mbinance[39m            | [91mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [33mbinance[39m                  | [32mbinance[39m            | [91mbinance[39m            | [91mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [91mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [91mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [91mbinance[39m             | [91mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [22m[2m[31mbinance[39m[22m                | [32mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [91mbinance[39m            | [22m[2m[31mbinance[39m[22m            | [91mbinance[39m            | [32mbinance[39m            | [91mbinance[39m                         | [22m[2m[31mbinance[39m[22m            | [22m[2m[31mbinance[39m[22m                  | [32mbinance[39m            | [32mbinance[39m              | [32mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [32mbinance[39m            | [22m[2m[31mbinance[39m[22m            | [32mbinance[39m            | [32mbinance[39m           
[32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [91mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [91mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [91mbinancecoinm[39m       | [91mbinancecoinm[39m         | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m          | [91mbinancecoinm[39m       | [33mbinancecoinm[39m       | [91mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [95mbinancecoinm[39m             | [32mbinancecoinm[39m           | [22m[2m[31mbinancecoinm[39m[22m       | [22m[2m[31mbinancecoinm[39m[22m              | [91mbinancecoinm[39m        | [91mbinancecoinm[39m       | [33mbinancecoinm[39m       | [32mbinancecoinm[39m       | [91mbinancecoinm[39m       | [32mbinancecoinm[39m        | [91mbinancecoinm[39m          | [91mbinancecoinm[39m                   | [32mbinancecoinm[39m       | [91mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m        | [32mbinancecoinm[39m       | [91mbinancecoinm[39m              | [32mbinancecoinm[39m            | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [91mbinancecoinm[39m           | [32mbinancecoinm[39m       | [91mbinancecoinm[39m       | [91mbinancecoinm[39m       | [91mbinancecoinm[39m       | [91mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [33mbinancecoinm[39m             | [32mbinancecoinm[39m       | [91mbinancecoinm[39m       | [91mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [91mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [91mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [91mbinancecoinm[39m        | [91mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [22m[2m[31mbinancecoinm[39m[22m           | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [91mbinancecoinm[39m       | [22m[2m[31mbinancecoinm[39m[22m       | [91mbinancecoinm[39m       | [32mbinancecoinm[39m       | [91mbinancecoinm[39m                    | [22m[2m[31mbinancecoinm[39m[22m       | [22m[2m[31mbinancecoinm[39m[22m             | [32mbinancecoinm[39m       | [32mbinancecoinm[39m         | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m       | [22m[2m[31mbinancecoinm[39m[22m       | [32mbinancecoinm[39m       | [32mbinancecoinm[39m      
[32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [91mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [91mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [91mbinanceusdm[39m        | [91mbinanceusdm[39m          | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m           | [91mbinanceusdm[39m        | [33mbinanceusdm[39m        | [91mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [95mbinanceusdm[39m              | [32mbinanceusdm[39m            | [22m[2m[31mbinanceusdm[39m[22m        | [22m[2m[31mbinanceusdm[39m[22m               | [91mbinanceusdm[39m         | [91mbinanceusdm[39m        | [33mbinanceusdm[39m        | [32mbinanceusdm[39m        | [91mbinanceusdm[39m        | [32mbinanceusdm[39m         | [91mbinanceusdm[39m           | [91mbinanceusdm[39m                    | [32mbinanceusdm[39m        | [91mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m         | [32mbinanceusdm[39m        | [91mbinanceusdm[39m               | [32mbinanceusdm[39m             | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [91mbinanceusdm[39m            | [32mbinanceusdm[39m        | [91mbinanceusdm[39m        | [91mbinanceusdm[39m        | [91mbinanceusdm[39m        | [91mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [33mbinanceusdm[39m              | [32mbinanceusdm[39m        | [91mbinanceusdm[39m        | [91mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [91mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [91mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [91mbinanceusdm[39m         | [91mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [22m[2m[31mbinanceusdm[39m[22m            | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [91mbinanceusdm[39m        | [22m[2m[31mbinanceusdm[39m[22m        | [91mbinanceusdm[39m        | [32mbinanceusdm[39m        | [91mbinanceusdm[39m                     | [22m[2m[31mbinanceusdm[39m[22m        | [22m[2m[31mbinanceusdm[39m[22m              | [32mbinanceusdm[39m        | [32mbinanceusdm[39m          | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m        | [22m[2m[31mbinanceusdm[39m[22m        | [32mbinanceusdm[39m        | [32mbinanceusdm[39m       
[32mbitmart[39m            | [32mbitmart[39m            | [91mbitmart[39m            | [32mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [32mbitmart[39m            | [32mbitmart[39m            | [32mbitmart[39m            | [91mbitmart[39m              | [32mbitmart[39m            | [32mbitmart[39m            | [32mbitmart[39m            | [91mbitmart[39m               | [91mbitmart[39m            | [33mbitmart[39m            | [91mbitmart[39m            | [32mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m                  | [91mbitmart[39m                | [91mbitmart[39m            | [91mbitmart[39m                   | [32mbitmart[39m             | [91mbitmart[39m            | [32mbitmart[39m            | [32mbitmart[39m            | [91mbitmart[39m            | [32mbitmart[39m             | [91mbitmart[39m               | [91mbitmart[39m                        | [32mbitmart[39m            | [32mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m             | [91mbitmart[39m            | [91mbitmart[39m                   | [91mbitmart[39m                 | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m                | [32mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m                  | [32mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [32mbitmart[39m            | [32mbitmart[39m            | [91mbitmart[39m            | [32mbitmart[39m            | [32mbitmart[39m            | [32mbitmart[39m            | [91mbitmart[39m            | [32mbitmart[39m            | [32mbitmart[39m            | [91mbitmart[39m             | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m                | [32mbitmart[39m            | [32mbitmart[39m            | [32mbitmart[39m            | [32mbitmart[39m            | [32mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m                         | [91mbitmart[39m            | [91mbitmart[39m                  | [32mbitmart[39m            | [91mbitmart[39m              | [32mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [91mbitmart[39m            | [32mbitmart[39m           
[32mbitvavo[39m            | [32mbitvavo[39m            | [91mbitvavo[39m            | [32mbitvavo[39m            | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m            | [32mbitvavo[39m            | [32mbitvavo[39m            | [91mbitvavo[39m            | [91mbitvavo[39m              | [32mbitvavo[39m            | [32mbitvavo[39m            | [32mbitvavo[39m            | [22m[2m[31mbitvavo[39m[22m               | [91mbitvavo[39m            | [32mbitvavo[39m            | [91mbitvavo[39m            | [32mbitvavo[39m            | [91mbitvavo[39m            | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m                  | [22m[2m[31mbitvavo[39m[22m                | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m                   | [91mbitvavo[39m             | [91mbitvavo[39m            | [91mbitvavo[39m            | [32mbitvavo[39m            | [91mbitvavo[39m            | [32mbitvavo[39m             | [91mbitvavo[39m               | [91mbitvavo[39m                        | [32mbitvavo[39m            | [91mbitvavo[39m            | [91mbitvavo[39m            | [22m[2m[31mbitvavo[39m[22m             | [22m[2m[31mbitvavo[39m[22m            | [91mbitvavo[39m                   | [22m[2m[31mbitvavo[39m[22m                 | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m                | [32mbitvavo[39m            | [91mbitvavo[39m            | [91mbitvavo[39m            | [91mbitvavo[39m            | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m            | [91mbitvavo[39m                  | [32mbitvavo[39m            | [91mbitvavo[39m            | [91mbitvavo[39m            | [32mbitvavo[39m            | [32mbitvavo[39m            | [91mbitvavo[39m            | [32mbitvavo[39m            | [32mbitvavo[39m            | [32mbitvavo[39m            | [91mbitvavo[39m            | [91mbitvavo[39m            | [32mbitvavo[39m            | [91mbitvavo[39m             | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m                | [33mbitvavo[39m            | [32mbitvavo[39m            | [32mbitvavo[39m            | [32mbitvavo[39m            | [32mbitvavo[39m            | [91mbitvavo[39m            | [91mbitvavo[39m            | [91mbitvavo[39m            | [91mbitvavo[39m            | [91mbitvavo[39m            | [91mbitvavo[39m            | [91mbitvavo[39m                         | [91mbitvavo[39m            | [91mbitvavo[39m                  | [32mbitvavo[39m            | [91mbitvavo[39m              | [32mbitvavo[39m            | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m            | [22m[2m[31mbitvavo[39m[22m            | [91mbitvavo[39m            | [91mbitvavo[39m            | [32mbitvavo[39m           


Needlecraft answered 25/2, 2022 at 15:22 Comment(0)
M
10

A --header option was recently added in less 600 (released on 2022-01-07) for that:

--header=N[,M]
   Sets  the  number  of  header lines and columns displayed on the
   screen.  The value may be of the form "N,M" where N  and  M  are
   integers, to set the header lines to N and the header columns to
   M, or it may be a single integer "N" which sets the header lines
   to  N  and  the  header columns to zero.  When N is nonzero, the
   first N lines at the top of the screen  are  replaced  with  the
   first  N  lines of the file, regardless of what part of the file
   are being viewed.  When M is nonzero, the  characters  displayed
   at  the  beginning  of  each  line are replaced with the first M
   characters of the line, even if the rest of the line is scrolled
   horizontally.   If  either N or M is zero, less stops displaying
   header lines or columns, respectively.  (Note  that  it  may  be
   necessary  to change the setting of the -j option to ensure that
   the target line is not obscured by the header line(s).)

So less --header 4 would do it for your sample with that newer version of less.

Misericord answered 1/3, 2022 at 12:14 Comment(9)
Worth noting that this is a pre-release version, so it isn't yet widely available.Mirella
@chepner, my bad, --header was added in 600 already, not 602.Misericord
As far as I can tell, though, 590 is the latest release version (and depending on your OS or distribution, an even older version is the standard, requiring a manual installation).Mirella
(I could be greatly underestimating how soon 600 will be distributed, though. My extremely limited sampling included macOS 11, and macOS isn't exactly known for its blistering pace of upgrading packages; and an inexplicably old Debian installation.)Mirella
@chepner, yes, I don't expect it to be installed anywhere at this point, so you'd likely need to compile it by hand at this point. This answer is probably going to be useful to more people in a few months/years time.Misericord
How do you upgrade less manually?Needlecraft
macOS 11.7 Big Sur comes with less version 487 (2016, POSIX regular expressions) not supporting the --header option. Upgraded via brew install less which as of 2022-10-14 gave me version 608 (2022, PCRE2 regular expressions). With this version of less --header worked just fine. Great feature!Donatelli
The download page provides the source code and the tar.gz contains an INSTALL file describing how to build and install less on your system.Palladium
To install a new version of less, I wrote a quick HOW TO on a similar question here: unix.stackexchange.com/a/739599/78577Autograph

© 2022 - 2024 — McMap. All rights reserved.