Split the content of the file /proc/uptime using a space as the delimiter and take the fourth field, then use awk to print the number of days, hours, minutes and seconds.
cut -d ' ' -f4 /proc/uptime | awk '{print int($1/86400)"d"int($1/3600%"24")"h"int(($1/60)%"60")"m"int($1%"60")"s"}'