1

I like to get an output on the screen of the who command, buth with the current date on the first line (without the use of a script)

Following does the job, buth I prefer one command.

$ who > who
$ date > date
$ cat date who

Thanks.

1

Try using this combination:

date; who

You can also use && to combine commands. However, anything before the && will need to return no error code before the command after && can run.

date && who

In the latter example, date failed for some reason, who would never run.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.