1

Is it possible to make nano wrap on $ on very long lines?

I regularly have to check log file and then copy and paste the contents into an email for example (I want to use mouse select - Ctrl U does work but it is cumbersome especially with lots of lines) but all I can copy and paste is what is visible on the screen which means that often the most important parts of lines in the exim log, for example, are left behind.

I have commented out the line "set nowrap" and uncommented set fill -8 in /etc/nanorc to no avail. I also tried starting nano with

nano -Ws$ file.log

and also

nano -r60 file.log

but it makes no difference and the lines with $ still take up more than I can see and therefore copy. Can it be made to wrap on the $? If not, is there another easier way of working with log files from the command line?

Thanks

1 Answer 1

0

nano -wS$ file.log

should od the trick (works here, just tried). Be careful with the case of the parameters

4
  • Tried that but I get an error nano: invalid option -- '$'
    – bhttoan
    Jan 14, 2014 at 14:39
  • Did you try eventually separate? "nano -wS -$ file.log" or the long version? "nano -wS --softwrap"
    – fede.evol
    Jan 14, 2014 at 15:07
  • All give the same error invalid option with $ for first two and --softwrap for second one
    – bhttoan
    Jan 14, 2014 at 15:16
  • Looks like it could be a version matter: it seems some pre 2.2.0 didn't have this working out. Check your nano version or if possible upgrade it to a post 2.2.0. For now for logs I'd suggest you to use simply "more file.log" or "less file.log" which both wraps on the terminal size by default.
    – fede.evol
    Jan 15, 2014 at 5:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .