Hi I want to save both output of a command and the command that has been run to create the output into the same single file. I understand either of
*some_command* > file.txt
*some_command* | tee file.txt
can be done but either case the some_command doesn't get saved into the file but only the output of it gets saved. Is there a way to do so ?
script
which will create a new session and store everything on the terminal in a file called "typescript" until you leave the session. – Panki Jul 31 '19 at 07:09ls -l "$dir"/*.txt
) or the resulting command that was run, after all expansions (e.g.ls -l ./foo/file1.txt ./foo/file2.txt
)? – ilkkachu Jul 31 '19 at 07:23