We’re rewarding the question askers & reputations are being recalculated! Read more.

Hot answers tagged

2

Perl solution: perl -F'/\|/' -ne '$id = $F[0] if $F[3] =~ /- 44$/; print if $F[0] eq $id && $F[3] =~ /Logged In|Processed Bill/; ' -- file.txt -n reads the input line by line -F splits each input line on the given regex into the @F array if $F[3], i.e. the fourth column, matches - 44, the first column is stored ...


2

To enable OpenLDAP debugs, you would want to add the following to your slapd.conf loglevel <level> (eg: stats) If you do not use slapd.conf, you may then pass that option to the slapd service. In debian/ubuntu, you would find some /etc/default/slapd file, you may update its SLAPD_OPTIONS: $ grep SLAPD_OPTIONS /etc/default/slapd SLAPD_OPTIONS="-s 256"...


2

You can use hardcopy -h command to save the contents of the current scroll buffer to a file. As described in man screen: hardcopy [-h] [file] Writes out the currently displayed image to the file file, or, if no filename is specified, to hardcopy.n in the default directory, where n is the number of the current window. This either appends or ...


2

One way to do it is to use copy mode to copy the entire scrollback history, then dump it into a file. (There is likely a better way.) With default keybindings, this would be something like: Ctrl-A to send screen a command [ to enter copy mode g to go to the top Space bar to mark the beginning of the scrollback buffer (where you are) as the start of the ...


2

ls’s -u option can be used to list files with their last access time (instead of the default last modification time): ls -lu Since you’re trying to examine large amounts of files, the recursive option could be useful: ls -luR You can also list all files accessed in the last two days using find: find . -atime -2 and multiple specifiers can be combined ...


1

It looks like a known bug on nouveau driver (if i remember well, this is the opensource driver for NVidia graphic cards). Source: https://bugs.freedesktop.org/show_bug.cgi?id=99900 To fix this you can: Use logrotate or a cron job to flush logs passed a given size. or Tweak your syslog configuration to avoid logging this. or Totally disable syslog (...


1

It takes some careful shell quoting, but you could use the scriptable editor ed for this: printf '%s\n' "/foo/ka" "??" "'a,.w "'!less' q | ed -s file This sends four commands to ed: /foo/ka -- searches (from the beginning of the file) for the pattern foo; at that first match, set a mark named a. ?? -- repeat the search, but going backwards, wrapping ...


1

/var/log is a directory and cannot be opened by cat. Perhaps you actually wanted to open one of the files inside /var/log/?


1

These commands are, indeed, part of the sysstat package. It's intended for performance monitoring; and specifically, sar is the system activity report: a Unix System V-derived system monitor command used to report on various system loads, including CPU activity, memory/paging, interrupts, device load, network and swap space utilization. Sar uses /proc ...


1

You could do something stateful like /first-pattern/ {print; p = 0} /second-pattern/ {p = 1} p Ex. $ awk '/^criteria/ {print; p = 0} /(Old|New) run:/ {p = 1} p' file.log criteria (NO-NO) data/speed/profile_1 Old run: exit speed=22.5 Old run: ramp speed=15.2 New run: exit speed=28.2 New run: ramp speed=19.3 criteria (NO-NO) ...


1

Ok, your logrotate is failing because of missing log files. When you use logrotate -d you are getting verbose debug output but logrotate does not do anything. If you first do logrotate -v logrotate-message -f instead the force option, combined with verbose output will show you the operation of -f flag, which per man logrotate will create missing log files ...


Only top voted, non community-wiki answers of a minimum length are eligible