alias getTime1='date -d @1490170832 +"%F %H:%M:%S"'
alias getTime2='date -d @$1'
donaldlin@ ~ $ getTime1
2017-03-22 16:20:32
donaldlin@ ~ $ getTime2 1490170832
date: the argument ‘1490170832’ lacks a leading '+'; when using an option to specify date(s), any non-option argument must be a format string beginning with '+' Try 'date --help' for more information.
I have tried "date -d @\$1","date -d @'$1'","date -d ${@$1}" and so on, but it still not work.
update:
alias
es can't take parameters. You need to create a function instead
Thanks @chepner and @l0b0