Skip to content

How do I echo the results of pacman -Q into a file with lines?

Removed before it was archived.

1 points10 comments
Open on Reddit
About this post
Posted
Archived
Deleted on
Score
1 · 100% up
Kind
Text
ID
ap335n

12 comments

pacman -Q > file

8 points
printf "%s %s\n" $(pacman -Q) > file

(/s)

6 points

Duh… you completely disregarded OP's wish to use a pointless echo:

echo "$(printf '%s %s\n' $(pacman -Q))" >file
2 points
pacman -Q | perl -ne 's/^(.*)$/system "echo $1"/gem' | xargs -n 1 echo

works just fine.

1 points
unknown author

Deleted before we saved it.

0 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.