We help IT Professionals succeed at work.

cut command

brianjava
brianjava asked
on
[walkerb@m-net ~]$  date +"%m-%d-%y-%H-%M"

the above works and all....but I am experimenting using the cut command...to display only the the hour and minute....how to I adjust the top code?
Comment
Watch Question

Top Expert 2007

Commented:
date +"%m-%d-%y-%H-%M"|cut -d- -f4-5

Where -d sets the field delimiter and the -f specifies which fields to cut.
Top Expert 2007
Commented:
As you say, you are experimenting, so you wouldn't use cut like this for real, you would do

date +"%H-%M"

Author

Commented:
yes....I know....just trying to figure out the cut command more...thanks