I have this question in an assignment but can't figure it out.
In your commands history search for the use of the command
lsand append them in the file
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
you can use
history |grep ls > ~/history.txt for more info regarding grep you can use
man grep for pipe you can read https://www.geeksforgeeks.org/piping-in-unix-or-linux/