Note that for most commands, if you run them in the background using the & after the command, they will terminate when the terminal is closed. This is because the operating system sends the SIGHUP (hang up) signal to background jobs when a terminal closes, and mos programs terminate on receipt of this signal.
You can prevent the signal from getting to the program by starting it like this:
The nohup stands for "no hangup", referring to the signal mentioned above.
As for the time, unix-like filesystems do not store the creation time for files. You have three time stamps to choose from:
- atime - the time the file was last accessed (e.g. read)
- mtime - the time the file contents were last modified (e.g. appended to)
- ctime - time of last change to the file contents or the file meta-data (e.g. permissions change).
Probably the one you want is the mtime. You can get this for a specific file using the stat command, like this:
stat -c %y filename
Of using the -l option to ls will also display the mtime, although the format changes more, so if you are trying to use it in a script, the stat method is probably more suitable.