Fill these in once
- Save the output to a file
ls -la > output.txtThis replaces the file each time.
- Add to the end of the file instead
ls -la >> output.txt - Save errors too
ls -la > output.txt 2>&1 - See it on screen and save it at the same time
ls -la | tee output.txt
- Save the output to a file
ls -la > output.txtThis replaces the file each time.
- Add to the end of the file instead
ls -la >> output.txt - Save errors too
ls -la > output.txt 2>&1 - See it on screen and save it at the same time
ls -la | tee output.txt
- Save the output to a file
Get-ChildItem | Out-File output.txtThis replaces the file each time.
- Add to the end of the file instead
Get-ChildItem | Out-File output.txt -Append - Save errors too
Get-ChildItem *> output.txt - See it on screen and save it at the same time
Get-ChildItem | Tee-Object output.txt