Write a shell script to get current date, time, user name and current working directory.



Write a shell script to get current date, time, user name and current working directory...

Answer / Amit Kumar Giri

Here's a simple shell script that displays the current date, time, username, and current working directory: `#!/bin/bashndatenecho $USERncd - P | awk '{print $NF}'`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Shell Script Interview Questions

Determine the output of the following command: name=shubham && echo ‘my name is $name’.

1 Answers  


write a shell script to identify the given string is palindrome or not?

17 Answers   CTS, HP, IBM, InfoEst, Wipro,


What is the difference between a shell variable that is exported and the one that is not exported?

6 Answers  


How to change our default shell?

5 Answers  


Is bash a shell script?

1 Answers  


How do I edit a .sh file?

1 Answers  


How to get script name inside a script?

1 Answers  


What is the default ubuntu terminal?

1 Answers  


What can you do with powershell?

1 Answers  


I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?

1 Answers  


c program to check whether all the directories in the path exists has read and write permission

1 Answers  


What are the four fundamental components of every file system on linux?

1 Answers  


Categories