Skip to main content
deleted 1 character in body
Source Link
Kusalananda
  • 356.1k
  • 42
  • 737
  • 1.1k

The less utility will try to open the file(s) listed as operands on the command line. There is no file called /header on your system. What you tried to do whatwas to give the interactive command for searching for the string header, but this can't be done that way from the command line.

Any interactive less command can be given as an initial command for less to execute by prefixing it with + on the command line. So you could have done

wget --help | less '+/header' 

See man less | less '+/ \+ ' for more info about that.

This happens to be equivalent to the other way of specifying a search pattern on the command line, -p pattern, but is more generic as adding an initial + applies to all interactive commands, while -p is specifically for specifying a search term.

wget --help | less -p 'header' 

The less utility will try to open the file(s) listed as operands on the command line. There is no file called /header on your system. What you tried to do what to give the interactive command for searching for the string header, but this can't be done that way from the command line.

Any interactive less command can be given as an initial command for less to execute by prefixing it with + on the command line. So you could have done

wget --help | less '+/header' 

See man less | less '+/ \+ ' for more info about that.

This happens to be equivalent to the other way of specifying a search pattern on the command line, -p pattern, but is more generic as adding an initial + applies to all interactive commands, while -p is specifically for specifying a search term.

wget --help | less -p 'header' 

The less utility will try to open the file(s) listed as operands on the command line. There is no file called /header on your system. What you tried to do was to give the interactive command for searching for the string header, but this can't be done that way from the command line.

Any interactive less command can be given as an initial command for less to execute by prefixing it with + on the command line. So you could have done

wget --help | less '+/header' 

See man less | less '+/ \+ ' for more info about that.

This happens to be equivalent to the other way of specifying a search pattern on the command line, -p pattern, but is more generic as adding an initial + applies to all interactive commands, while -p is specifically for specifying a search term.

wget --help | less -p 'header' 
deleted 51 characters in body
Source Link
Kusalananda
  • 356.1k
  • 42
  • 737
  • 1.1k

The less utility will try to open the file(s) listed as operands on the command line. There is no file called /header on your system. What you tried to do what to give the interactive command for searching for the string header, but this search command requires less tocan't be already showing the contents ofdone that way from the filecommand line.

TheAny interactive less tool hascommand can be given as an option,initial command for -pless, that takes a search pattern. This allows you to search directly fromexecute by prefixing it with + on the command line:. So you could have done

wget --help | less -p 'header''+/header' 

See man less | less '+/ \+ ' for more info about that.

This happens to be equivalent to the other way of specifying a search pattern on the command line, +/-p pattern:, but is more generic as adding an initial + applies to all interactive commands, while -p is specifically for specifying a search term.

wget --help | less '+/header'-p 'header' 

In general, any interactive command can be given as an initial command for less to execute by prefixing it with + on the command line. See man less | less '+/ \+ ' for more info about that.

The less utility will try to open the file(s) listed as operands on the command line. There is no file called /header on your system. What you tried to do what to give the interactive command for searching for the string header, but this search command requires less to be already showing the contents of the file.

The less tool has an option, -p, that takes a search pattern. This allows you to search directly from the command line:

wget --help | less -p 'header' 

This happens to be equivalent to the other way of specifying a search pattern on the command line, +/pattern:

wget --help | less '+/header' 

In general, any interactive command can be given as an initial command for less to execute by prefixing it with + on the command line. See man less | less '+/ \+ ' for more info about that.

The less utility will try to open the file(s) listed as operands on the command line. There is no file called /header on your system. What you tried to do what to give the interactive command for searching for the string header, but this can't be done that way from the command line.

Any interactive less command can be given as an initial command for less to execute by prefixing it with + on the command line. So you could have done

wget --help | less '+/header' 

See man less | less '+/ \+ ' for more info about that.

This happens to be equivalent to the other way of specifying a search pattern on the command line, -p pattern, but is more generic as adding an initial + applies to all interactive commands, while -p is specifically for specifying a search term.

wget --help | less -p 'header' 
Source Link
Kusalananda
  • 356.1k
  • 42
  • 737
  • 1.1k

The less utility will try to open the file(s) listed as operands on the command line. There is no file called /header on your system. What you tried to do what to give the interactive command for searching for the string header, but this search command requires less to be already showing the contents of the file.

The less tool has an option, -p, that takes a search pattern. This allows you to search directly from the command line:

wget --help | less -p 'header' 

This happens to be equivalent to the other way of specifying a search pattern on the command line, +/pattern:

wget --help | less '+/header' 

In general, any interactive command can be given as an initial command for less to execute by prefixing it with + on the command line. See man less | less '+/ \+ ' for more info about that.