Search for a pattern at the beginning of a line using grep

$ps -e “kworker$” error: unknown sort specifier Usage: ps [options] Try ‘ps –help ‘ or ‘ps –help ‘ for additional help text. For more details see ps(1). $ps -ef | grep “^daemon” daemon 639 1 0 May04 ? 00:00:00 /usr/sbin/atd -f $ps -ef | grep “^rtkit” rtkit 1245 1 0 May04 ? 00:00:00 /usr/lib/rtkit/rtkit-daemon $ps …

How does && and || operators combination Work ?

commandline session $ 4.2.29 10 510—> [ -f wordmatc.c ] || echo hello hello $ 4.2.29 11 511—> [ -f wordmatc.c ] || cat baty && echo hello cat: baty: No such file or directory $ 4.2.29 12 512—> [ -f wordmatc.c ] && echo hello || echo kitten kitten $ 4.2.29 13 513—> [ …

How does bracket expression and negation [^ ] work with grep ?

commandline session $ 4.2.20 19 519—> grep ‘[^b ]sort’ worked Heapsort Quicksort Timsort $ 4.2.20 20 520—> cat worked Bubble sort Selection sort Insertion sort Shell sort Comb sort Merge sort Heapsort Quicksort Counting sort Bucket sort Radix sort Distribution sort Timsort $ 4.2.20 21 521—>

[x]args build and execute +

$ls robinsons.iso robinsons.iso $ls | grep robinsons.iso | xargs rm $ls robinsons.iso ls: cannot access robinsons.iso: No such file or directory $ xargs – build and execute command lines from standard input This manual page documents the GNU version of xargs. xargs reads items from the standard input, delimited by blanks (which can be protected …