-3

How can I create a file under /tmp/stage2/ named system.info? What are the commands to use? Also how do I append the following information to the file?

  • The full hostname
  • The current date
  • The load of the system
John Kugelman
  • 349,597
  • 67
  • 533
  • 578
  • Does this answer your question? [How to append output to the end of a text file](https://stackoverflow.com/questions/6207573/how-to-append-output-to-the-end-of-a-text-file) – John Kugelman Mar 11 '21 at 03:57

1 Answers1

0

maybe you show do like this:

#!/bin/bash

MYSYS_PATH="/tmp/stage2/system.info"
mkdir -p /tmp/stage2
hostname > $MYSYS_PATH
date >>$MYSYS_PATH
cat cat /proc/loadavg >>$MYSYS_PATH
jack ma
  • 76
  • 5