Rafael Santiago
Rafael Santiago

Reputation: 13

Using the apt list command to output to a file (Debian)

I want to take the entire list that generates from the apt list command and save or view it in a file. Either in nano or some form of a text editor. I thought of piping results into a file, any help would be appreciated, Thank You!

Upvotes: 1

Views: 3073

Answers (1)

Sudip Ghimire
Sudip Ghimire

Reputation: 715

As updated to specfic sceniro The quick solution is to use

apt list | awk '{print $1}' | tee a.txt

where a.txt is the file name.

The above command simply pipe the output from awk to tee command which report to cli as well as write to file

Upvotes: 4

Related Questions