Using Cut With Date Command

Cut Chop Dice

If you want to get the time without the other date info, use 'cut' command. You can cut fields to eliminate data you don't want displayed.

When you give the 'date' command it normally prints time and date. The output looks like this:

$ date
Sun May 15 13:15:36 BST 2011

If you only want to print the time, use 'cut' with -c.

$ date | cut -c 12-19

Here we pipe 'date' output to 'cut' and cut everything except columns 12 - 19.

We only get the time to display.

Try it on text strings.