We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
'Uniq' command #3
'Uniq' command #3
Sort by
recency
|
69 Discussions
|
Please Login in order to post a comment
uniq -c -i | cut -c7-
Sed 's/^ *//' is to remove leading whitespaces.
tr '[:upper:]' '[:lower:]' | uniq -ic | awk '{print 2}'
uniq -c -i
: This command counts the number of occurrences of each unique line in the input, ignoring case for comparisons. The-c
option tells the uniq command to prefix each line with its count, and the-i
option tells it to ignore case when comparing lines.sed 's/^\s*//'
: This command is a sed script that removes any leading whitespace from each line of input. Thes/^\s*//
command tellssed
to find any whitespace at the beginning of each line^
, and then delete it//
along with any other whitespace that follows.