Question

Explain the following unexpected result: $ whereis date date: /bin/date

. Explain the following unexpected result:

$ whereis date
date: /bin/date ...
$ echo $PATH
.:/usr/local/bin:/usr/bin:/bin
$ cat > date
echo "This is my own version of date."
$ ./date
Fri May 22 11:45:49 PDT 2009
0 0
Add a comment Improve this question Transcribed image text
Answer #1
I will annotate each statement for your information.

1.$ whereis date
date: /bin/date ...
2.$ echo $PATH
.:/usr/local/bin:/usr/bin:/bin
3.$ cat > date
echo "This is my own version of date."
4.$ ./date
Fri May 22 11:45:49 PDT 2009

Annotations for line:
1. "whereis date" tells us where the executable file "date" is located, according to the current $PATH value. The result tells us that the executable file "date" is found in /bin
2. echo $PATH
tells us what is the content of the $PATH environment parameter. Each path is separated by a colon ":".
3. "cat > date"
takes standard input (stdin) from the keyboard and put the keyed in content into a new file in the current directory called date. The input should be terminated by a control-d, which is not mentioned in the question.
The file "date" usually has a permission of 644 or 600 (depending on the computer implementation), which means that it is not executable.
4. ./date
attempts to execute the file ./date, but it is not executable (by default). Again, depending on the implementation of the system, it may return
"permission denied", or
possibly search for the next directory from the $PATH environment variable, which outputs the current date and time.
answered by: beebop
Add a comment
Know the answer?
Add Answer to:
Explain the following unexpected result: $ whereis date date: /bin/date
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Given the following output from df and/etc/dumpdate. Identify the steps needed to perform the three restores...

    Given the following output from df and/etc/dumpdate. Identify the steps needed to perform the three restores requested. Enumerate your assumptions. Assume that the sate of the restore request is January 18. Df output from the machine khaya.cs.colorado.edu:/dev/hda8 256194 81103 161863 33%//dev/hda1 21929 4918 15879 24%/boot/dev/hda6 3571696 24396 3365934 1%/local/dev/hda10 131734 5797 119135 5%/tmp/dev/hda5 1815580 1113348 610004 65%/ust/dev/hda7 256194 17013 225953 7%/var/etx/dumpdates from khaya.cs.colorado.edu:/dev/hda8 2 Sun Jan 17 22:59:23 2010/dev/hda6 3 Sun Jan 17 22:51:51 2010/dev/hda7 3 Sun Jan 17 22:50:24...

  • insert a formula into cell E6 that subtracts the hire date in cell D6 from the...

    insert a formula into cell E6 that subtracts the hire date in cell D6 from the date in cell D1, and divides that result by 365. Set up the formulas so it can be copied by other cells in Column E while continuing to reference the date in Cell D1 and divide by the number 365. Make sure there are no blank spaces within the formula. Remove all decimal places from the result. please make sure to explain everything in...

  • 1. Write 4 simple shell scripts. Each question will ask you to write one or more...

    1. Write 4 simple shell scripts. Each question will ask you to write one or more command lines to solve a problem. Put the command(s) from each problem into a file named problem1.sh, problem2.sh Note that if you want your script to be interpreted by bash, each file should start with the line: #!/bin/bash and will have one (or more, as needed) commands following it. To execute each script in bash, so you can determine if it is working or...

  • This is my process, can you fix it for me? 0 Input: Output: Value: Under control...

    This is my process, can you fix it for me? 0 Input: Output: Value: Under control of main function Under control of main function The purpose of this assignment is to become familiar with the process of providing overloaded operators for a class. The Rational class from Labs 02, 03, and 05 will be modified to provide overloaded operators for performing arithmetic on Rational numbers an overloaded unary minus for negating a Rational number (previously implemented as the additive an...

  • lated and purchase related transactions. The following were selected from among the transactions completed by the...

    lated and purchase related transactions. The following were selected from among the transactions completed by the Brown Company during May of the current year: Prepare journal entries for the following transactions. 4 Sold merchandise on VISA, $120,000. The cost of merchandise sold was $75,000. 5 Purchased merchandise on account from Black Co., list price $70,000, trade discount 40%, freight of $400, terms FOB shipping point, 2/10, n/eom. 12 Sold merchandise on account to Red Co., list price $15,000, terms 3/15,...

  • ENSC 102 . Problem Set #6 Due at the beginning of class on Wednesday, May 22 Answer each of the following questions in your own words and using your ow calculations. For worked problens remembe...

    ENSC 102 . Problem Set #6 Due at the beginning of class on Wednesday, May 22 Answer each of the following questions in your own words and using your ow calculations. For worked problens remember to explain any intermediate steps or assumptions, show all units, and box your final anwers. For ful possible credit, make sure your fintished work is legible, prepared on loose-leaf paper, and shows your name and your lab instructorname at the top of the first page...

  • please complete all parts to this problem and explain work. i know its allot but i...

    please complete all parts to this problem and explain work. i know its allot but i added wxtra pictures so it is easier. GL2-8 Complete the steps in the measurement of external transactions Thunder Cat Services specializes in training and veterinary services to household pets, such as dogs, birds, lizards, fish, horses, and of course, cats. After the first 11 months of operations in 2021, Thunder Cat has the following account balances: Credits THUNDER CAT SERVICES Trial Balance November 30,...

  • Register Date Transactions Unpaid Balance April 10 1389.21 April 11 April 12 April 13 April 14...

    Register Date Transactions Unpaid Balance April 10 1389.21 April 11 April 12 April 13 April 14 April 15 April 16 April 17 April 18 April 19 April 20 April 21 April 22 April 23 April 24 April 25 April 26 April 27 April 28 April 29 April 30 May 1 May 2 May 3 May 4 May 5 May 6 May 7 May 8 May 9 Perform the following tasks (continued): Enter your answers in this column. At the end...

  • Note: Ignore the effect of VAT on all the transactions. Complete the following subsidiary journals in...

    Note: Ignore the effect of VAT on all the transactions. Complete the following subsidiary journals in the below EXACT formal: Cash Receipts Journal                                                                                                (22)    Cash Receipts Journal of Superheroes SA for October 2019 Doc no. D Details F Analysis of Receipts Bank Sales Cost of Sales Debtors Control Sundry Accounts Amount F Details Question 2 [70] Please read the following scenario carefully and then use the information provided to answer the questions. John Brown, the owner of Superheroes SA,...

  • Python programming- Download the following two files you will need for this activity: customerData.csv This file...

    Python programming- Download the following two files you will need for this activity: customerData.csv This file contains randomly generated fictitious customer data. customer_regex.py This is a Python script that imports the customer data into a list of customer details. In your personal playground in Codio, upload the two files and investigate the contents before considering the task you will pose to your peers. Assume the position of a manager of an online retailer. Pose a question to your IT expert...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT