• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

dmenu Command Examples in Linux

by Deepika

dmenu is a command-line program for Unix-like operating systems that provides a dynamic menu for launching other programs. It is commonly used as a launcher in window managers that follow the Unix philosophy of modularity and reusability. dmenu reads a list of newline-separated items from stdin, and shows them in a vertically scrolling list. The user can then select an item by typing a part of the item’s text and pressing Enter. The selected item is then printed to stdout.

dmenu Command Examples

1. Display a menu of the output of the `ls` command:

# ls | dmenu

2. Display a menu with custom items separated by a new line (`\n`):

# echo -e "red\ngreen\nblue" | dmenu

3. Let the user choose between multiple items and save the selected one to a file:

# echo -e "red\ngreen\nblue" | dmenu > color.txt

4. Launch dmenu on a specific monitor:

# ls | dmenu -m 1

5. Display dmenu at the bottom of the screen:

# ls | dmenu -b

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL : How to assemble a software RAID in Rescue mode
  2. iftop Command Examples in Linux
  3. nft Command Examples in Linux
  4. Linux Network File System (NFS) interview questions
  5. How to Setup a squid proxy server on CentOS/RHEL 7
  6. locale Command Examples in Linux
  7. dstat Command Examples in Linux
  8. xfs_admin: command not found
  9. usermod: command not found
  10. How To Enforce Password Complexity For All Users, Including “root”, By Using the “passwdqc” PAM Module CentOS/RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright