I want to have a command on Debian (Sid) that launches aptitude's TUI with a limit pattern defined within the command itself as an argument.

Otherwise I have to write the pattern every time by pressing l in Aptitude's TUI and then searching for an online manual in order to know how to write these patterns.

The basic command I use to launch Aptitude:

x-terminal-emulator -e sudo aptitude

A limit pattern I want to add as an argument:


In this case I want to launch Aptitude showing me all the Qt applications without having to input this pattern manually every time Aptitude launches.

I looked up Aptitude's man-pages, but I couldn't find the option for such argument.

1 Answer 1


There appears to be no clean way to do this. This kludge seems to work, with well-behaved x-terminal-emulators.
(Apparently qterminal isn't one of those, i just discovered. I'll look to see if there is a corresponding bugreport. (Edit: There is.))

x-terminal-emulator -e sh -c 'sudo -v ; { echo "l?tag(toolkit::qt)"; cat; } |sudo aptitude'
  • The sudo -v is needed so the second sudo doesn't consume echo's output.
  • The echo starts with l to select the correct option from the menu.
  • The cat allows interacting with aptitude after echo has finished.
  • I tested it right now with Alacritty and it works like a charm. Thanks! Mar 14, 2020 at 21:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .