How to see current date, time, username, and current directory using shell script in Unix?
How to see current date, time, username, and current directory using shell script ?
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Aviance School is one of the largest web solutions platform in India for developers to learn and share their programming knowledge and build their careers.
Current Date:
Username:
Current direcotry:
Output:
Current Date:
Wed Dec 27 17:53:27 UTC 2017
Username:
root
Current direcotry:
/home
#!/bin/bash
echo "Current Date:"
date
echo "Username:"
whoami
echo "Current direcotry:"
pwd
Output:
Current Date:
Wed Dec 27 17:53:27 UTC 2017
Username:
root
Current direcotry:
/home