Score:2

Arrow keys and | less

in flag

I'm new to Ubuntu and I was playing around in the terminal. Not sure what I stumbled into with two things:

I'm in /bin and when I type the command

dir | less

it displays the content in two alphabetical columns. I can use the up and down arrows to navigate. It makes sense. But when I press the right arrow it shows me only one column clearly not in alphabetical format, pressing the right key once more takes me to a blank terminal where I can "log file:"

  1. What's the purpose of the second screen with the single column?
  2. What is the third screen with "log file:" and how do you use it?
hr flag
Are you sure you didn't hit the `s` key? That would be the equivalent of invoking `less` with the `-o` option (*"Causes less to copy its input to the named file as it is being viewed."*)
Score:4
cn flag

There are not exactly second and third screen. When you press the right arrow less scrolls to the right and what you see probably is an ugly transformed part of the output of the dir command. When you press the right arrow once again, there is nothing more to show on the right so you see blank screen.

The following is a part of man less

ESC-) or RIGHTARROW - Scroll horizontally right N characters, default half the screen width (see the -# option). If a number N is specified, it becomes the default for future RIGHTARROW and LEFTARROW commands. While the text is scrolled, it acts as though the -S option (chop lines) were in effect.

ESC-( or LEFTARROW - Scroll horizontally left N characters, default half the screen width (see the -# option). If a number N is specified, it becomes the default for future RIGHTARROW and LEFTARROW commands.

ESC-} or ^RIGHTARROW - Scroll horizontally right to show the end of the longest displayed line.

ESC-{ or ^LEFTARROW - Scroll horizontally left back to the first column.

-# or --shift option - Specifies the default number of positions to scroll horizontally in the RIGHTARROW and LEFTARROW commands. If the number specified is zero, it sets the default number of positions to one half of the screen width. Alternately, the number may be specified as a fraction of the width of the screen, starting with a decimal point: .5 is half of the screen width, .3 is three tenths of the screen width, and so on. If the number is specified as a fraction, the actual number of scroll positions is recalculated if the terminal window is resized, so that the actual scroll remains at the specified fraction of the screen width.

The semicolon : at the bottom is the less command prompt, you can press h for help. As @steeldriver mentioned at the comments when you press s, the prompt log file: asks you for a name of a file where the input of the less command will be stored for later use - in the current case it is the output of dir.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.