New answers tagged

1

/dev/log is (or is a symbolic link to) an AF_LOCAL datagram socket, which applications are expected to send datagrams to, not read stream data from with cat. It is a convention of C libraries, and their library functions such as the syslog() function, and not a part of Linux itself. It's readers will be a dæmon such as syslog-read, one of the syslog ...


0

It's described in man syslogd: /dev/log The Unix domain socket to from where local syslog messages are read. You can see yourself that it's used by syslogd using logger command for example: $ strace -f logger a 2>&1 | grep /dev/log connect(3, {sa_family=AF_UNIX, sun_path="/dev/log"}, 110) = 0 Or lsof (if available): $ sudo lsof /dev/...


0

If another process is updating the log file and you want to avoid interfering with it, your best bet may be keeping a second file. The second file (let's call it the "archive file") will hold the last n logged lines. To do this as cleanly as possible, first move the existing log file to a temporary location. Then combine it with the previously saved ...


0

Could work! screen sh -c './some-script 2>&1 | tee mylog.log'


2

Perhaps the best approach is one suggested by Lorenzo Beretta for Void Linux on 2019-10-10: make the applications in question dynamically link to Laurent Bercot's utmps library in place of the musl C library, using LD_PRELOAD. Further reading Laurent Bercot (2017). utmps — a secure utmp implementation. skarnet.org.


8

The "get" version is — or rather was — since September 2017, unsurprisingly: systemd-analyze get-log-level But these subcommands were moved from systemd-analyze to systemctl in November 2019, having been combined in January 2018 into a single subcommand: systemctl log-level Further reading https://github.com/systemd/systemd/commit/...


3

I managed to find the busctl command that provides systemd's log level. Example Current level $ sudo busctl get-property org.freedesktop.systemd1 \ /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LogLevel s "info" Override level $ sudo systemd-analyze set-log-level debug $ sudo busctl get-property org.freedesktop.systemd1 \ /org/...


1

GG, look in /etc/logrotate.d there may be a logrotate file doing the work and then you can manipulate the number of days and file size to rotate and many other things. File name probably called xsession or similar. Let us know what you find in /etc/logrotate.d Added after Edit If you find nothing you could create a new logrotate You can add a file ...


1

Was having this issue after trying the exact same thing. As novice mentions in the comments, there is an -o flag which should output to file, however I found this didn't work under linux despite being in the man page. Ultimately what I needed was for iperf to continue running after ssh session interruption. In the end I used the following command. nohup ...


1

One more while read loop... while read -r line; do printf '%s and %s\n' "$line" "$line" done < data Or while read -r line <&3; do read -r line1 printf '%s and %s\n' "$line" "$line1" done 3< data < data or bash4+ mapfile mapfile -t array < data for i in "${!array[@]}"; do printf '%s and %s\n' "${array[$i]}" "${array[$i]}" ...


0

In openSUSE systems (and some others) there is an lssci command that shows the disks with some short description, like this: > lsscsi [0:0:0:0] disk ATA WDC WD20EZRZ-00Z 0A80 /dev/sda [1:0:0:0] disk ATA WDC WD20EZRZ-00Z 0A80 /dev/sdb [2:0:0:0] cd/dvd HL-DT-ST BD-RE BH10LS30 1.01 /dev/sr0 [3:0:0:0] disk ATA ...


3

Don't use shell while read loops to process text. Here it's easiest with awk: awk 'NR > 1 {print prev, "and", $0}; {prev = $0}' < datafile Or with sed: sed 'x; 1d; G; s/\n/ and /' < datafile


1

How far would { read line; while read line1; do echo $line and $line1; line=$line1; done; } < file3 Data1 and Data2 Data2 and Data3 Data3 and Data4 get you?


1

You can no longer access those lines in mate-terminal. Increasing the number of scrollback lines doesn't help either: The terminal doesn't remember all the lines and reveals only the configured amount; it remembers only the configured amount. That being said, if the given terminal tab is still open, there's still some chance that the data wasn't actually ...


Top 50 recent answers are included