Howto: FreeBSD configure or use mouse to copy and paste at a terminal

Q. How do I configure my mouse to copy and paste at a terminal under FreeBSD?

A. When you come from GUI to text-based terminal, you might miss the cut and past mouse functionality.

You can use your mouse to copy and paste at a terminal. Install moused which is utility and the console driver work together to support mouse operation in the text console and user programs.

FreeBSD moused configuration

To configure moused open /etc/rc.conf file:
# vi /etc/rc.conf

Add/modify following three lines:

Save and close the file.


  • moused_port=”/dev/psm0″ – The mouse port
  • moused_type=”auto” – Automatically detect mouse protocol
  • moused_enable=”YES” – Start mouse service when FreeBSD comes up i.e. start at boot time.

Task: Start/restarts/stop moused service

# /etc/rc.d/moused start
# /etc/rc.d/moused restart
# /etc/rc.d/moused stop

Task: Copy text

To select text press the left mouse button and drag the mouse.

Task: Paste text

To paste text in the same or another console, press the middle button.

Task: Configure two button mouse

Open /etc/rc.conf file
# vi /etc/rc.conf
Append following flags:
moused_flags="-m 2=3"

Save and close the file. Restart moused:
# /etc/rc.d/moused restart

Read moused man page for more information.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one

CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @