Wygląda ok, zakładając że o to chodzi wykładowcy (*). Można też wymienić wprost akceptowane ciągi znaków...
who | grep -v 'student\(5\|6\|12\)'
lub
who | grep -v -E 'student(5|6|12)'
-E, --extended-regexp
Interpret PATTERNS as extended regular expressions (EREs, see below).
Basic vs Extended Regular Expressions
In basic regular expressions the meta-characters ?, +, {, |, (, and ) lose their special meaning; instead use the backslashed versions \?, \+, \{, \|, \(, and \).
*) Czy jeśli zalogowany będzie również inny użytkownik, np. root to ma zostać wyświetlony?