maybe history | awk '$2 ~ /ssh/ {$1=""; print $0}' | sort -u On 16 September 2013 21:14, James B. Byrne <byrnejb@xxxxxxxxxxxxx> wrote: > > On Mon Sep 16 16:34:31 UTC 2013, zGreenfelder zgreenfelder at gmail.comwrote: > >On Mon, Sep 16, 2013 at 12:27 PM, > > James B. Byrne <byrnejb at harte-lyne.ca>wrote: > >> I am obviously missing something basic here but can someone explain > >> to me what is wrong with the first statement, which returns nothing? > >> > >> $ history | grep ^su > >> $ history | grep su > >> 2997 su -l > >> 3024 su -l > >> 3050 su -l > >> 3054 su -l > > > there are numbers at the start of the line? > > Duh! Thanks. I could not see the forest for the trees I guess. I ended up > with the following as I wanted a visual scan of all variants not just the > most > recent: > > history | cut -f1-3 -d " " --complement | grep ^su > > This is in the bash shell on CentOS-6.4. > > > -- > *** E-Mail is NOT a SECURE channel *** > James B. Byrne mailto:ByrneJB@xxxxxxxxxxxxx > Harte & Lyne Limited http://www.harte-lyne.ca > 9 Brockley Drive vox: +1 905 561 1241 > Hamilton, Ontario fax: +1 905 561 0757 > Canada L8E 3C3 > > _______________________________________________ > CentOS mailing list > CentOS@xxxxxxxxxx > http://lists.centos.org/mailman/listinfo/centos > _______________________________________________ CentOS mailing list CentOS@xxxxxxxxxx http://lists.centos.org/mailman/listinfo/centos