:: Re: [DNG] Viewing file content (was…
Forside
Slet denne besked
Besvar denne besked
Skribent: Peter Duffy
Dato:  
Til: dng
Emne: Re: [DNG] Viewing file content (was Re: system administration of non-systemd distros and releases)
Personally, if I want to look at a file without editing it, if it's
small, I'll use view - which gives me the vi interface with the file in
read-only mode. It means I get the same interface and facilities that I
use when actually editing files, and it's easy to remember and (usually)
automatic. If I'm examining logs, I normally use less: handles big files
well, and (to coin a phrase) has more functionality than "more". It also
has the brilliant ctrl-f feature to show updates to the log in real-time
(like "tail -f" but with the advantage that the "tailing" mode can be
entered and exited without losing access to the file).

On Fri, 2021-11-26 at 18:40 +0900, Olaf Meeuwissen via Dng wrote:
> Hi,
>
> Steve Litt writes:
>
> > What could possibly be easier than vim /var/log/messages, or
> > vi /var/log/messages, or emacs /var/log/messages, or
> > nano /var/log/messages? And notice with the old way, you have a choice,
> > rather than having to look at log output with the vendor's proprietary
> > tool.
>
> Maybe I'm peculiar but I always find it absolutely, totally jaw-dropping
> when people use text *editors* to *look* at file content. Makes my toes
> curl up and blood curdle.
>
> Why on earth would you want to edit your system logs anyway?
>
> On De{bi,vu}an derivatives, I'd use `pager`. On any other Unix-based
> OS, I'd use `more` or `less`, preferably.
>
> # On my own machines `lv` makes a fine `pager` for me. On the fly
> # decompression and handling of many different encodings. So for me,
> # it's just
> #
> # pager /var/log/syslog.2.gz
> #
> # without any `zmore` or `zcat` piping. There is still no zpager :-/
> # but with `lv` I don't really need one.
>
> Hope this helps,
> --
> Olaf Meeuwissen, LPIC-2            FSF Associate Member since 2004-01-27
>  GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
>  Support Free Software                        https://my.fsf.org/donate
>  Join the Free Software Foundation              https://my.fsf.org/join
> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng