![]() ![]() Grep -R reads files under specified directories recursively. If groups | grep -qE '(^| )stargroup9( |$)' then … Examples: groups | grep -qE '(^| )stargroup9( |$)' & do_something In a script you may want to check if you're a member without printing any output from grep. If you are in this group but not in stargroup9, the pattern with \b will mislead you (and the same applies to grep -w). The problem is group names can contain - but this character (as far as \b is concerned) separates words. You may encounter an advice with a pattern like \bstargroup9\b, where \b anchors at word boundary (or grep -w stargroup9 which is eqivalent). I used -E because the pattern is more readable this way. As a basic regular expression (without -E) the pattern should look like this: \(^\| \)stargroup9\( \|$\) (and it should be single-quoted). a group named stargroup98765 is not a match. Where (^| ) matches the beginning of the line or a space character, ( | $) matches a space character or the end of the line so e.g. ![]() This is way better: groups | grep -E '(^| )stargroup9( |$)' This is a straightforward, although not the best solution: groups | grep "stargroup9" Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.To make grep process its stdin you should invoke it without file (or directory) names as operands. This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. entry_SYSCALL_64_after_hwframe+0x44/0xa9 This shows much more information than the first option described above. This command produces a report and a list of all processes in D state and a full kernel stack trace to /var/log/messages. # ps -eo ppid,pid,user,stat,pcpu,comm,wchan:32 | grep " D" ![]() Processes that are in uninterruptible sleep can be determined via the fourth column which would then show a D. This includes also processes which are interruptible. This prints a list of all processes where in the last column either a '-' is displayed when the process is running or the name of the kernel function in which the process is sleeping if the process is currently sleeping. ps -eo ppid,pid,user,stat,pcpu,comm,wchan:32 There are two ways to find more about the processes in D state.ġ. Restarting the NFS server would resolve this particular issue. In the example above, the NFS server had failed while the client still had an active mount to it. Make sure your firmware and kernel disk drivers are updated. If performance becomes an issue, you may need to check the health of your disks. It is normal to see processes in a "D" state when the server performs I/O intensive operations. You can only clear them by rebooting the server or waiting for the I/O to respond. As the name implies, they are uninterruptible. You cannot kill "D" state processes, even with SIGKILL or kill -9. The vmstat and ps will not agree on the number of processes in a "D" state, so don't be too concerned. The vmstat command also shows the current processes that are "blocked" or waiting on I/O. The ps command shows a "D" on processes in an uninterruptible sleep state. Processes in a "D" or uninterruptible sleep state are usually waiting on I/O. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |