Linux

How to Play Music From the Linux Terminal With cmus

How to Play Music From the Linux Terminal With cmus

cmus (C* Music Player) is a fast, lightweight, and powerful music player designed to run within the Linux terminal. It offers an efficient way to organize and play your music collection without the need for a graphical interface, making it ideal for users who prefer to use the command line. In this guide, we will walk through the installation, basic usage, and some key features of cmus.

Why Use cmus?
Lightweight: It consumes minimal system resources, making it perfect for low-powered systems or users who want a simple music player without the bloat of a graphical interface.
Fast: Its responsive interface is designed to handle large music libraries with ease.
Customizable: With configurable keybindings and support for various audio formats, it provides flexibility to users.
Terminal-Based: Ideal for those who spend most of their time in the terminal.
Step 1: Installing cmus
cmus is available in the default repositories of most Linux distributions, so installing it is straightforward.

For Ubuntu/Debian:

sudo apt update
sudo apt install cmus

For Fedora:

sudo dnf install cmus

For Arch Linux:

sudo pacman -S cmus

For CentOS/RHEL (EPEL required):

sudo yum install epel-release
sudo yum install cmus

Once the installation is complete, you can launch cmus by simply typing cmus in your terminal:

cmus

Step 2: Navigating cmus
The interface of cmus may seem minimal at first, but it offers a variety of powerful features once you get used to it. Here’s how to navigate and manage your music within cmus:

Main Interface: After launching, the main screen will show your music library, which is initially empty.
File Browser: To load music into the player, press 5 to enter the file browser. Navigate to the directory where your music is stored using the arrow keys.
Adding Music: Once you’ve located your music folder, press Enter to add the selected directory to your library. You can add individual files as well.
Switching Views: cmus has different views for your music library, playlists, and more. You can switch between these views using the numbers 1 to 7:
1: Library view
2: Playlists
3: Queue
4: Browsing artist/album
5: File browser
6: Filters
7: Settings
Step 3: Basic Commands
Here are the essential commands to control your music playback in cmus:

Play/Pause: Press c to play or pause the current track.
Next/Previous Track: Press b to skip to the next track or z to go to the previous track.
Volume Control: Increase volume with + and decrease with -.
Seek Within a Track: Use the arrow keys (left and right) to seek forward or backward within the current track.
Shuffle Mode: Press s to toggle shuffle mode on or off.
Repeat Mode: Press r to enable or disable repeat mode for tracks or the entire playlist.
Step 4: Managing Your Music Library
cmus allows you to organize your music library and create playlists, making it easier to manage large collections.

Adding Music to the Library:
To add more music after the initial setup, press 5 to go back to the file browser and navigate to other folders. Press a to add entire directories to your library.

Creating Playlists:
To create a playlist, go to the library view (1), select a song, and press y to copy it to the playlist. You can then switch to the playlist view (2) to manage your playlists.
You can create multiple playlists, queue songs, and easily shuffle between them.
Step 5: Customizing cmus
One of the strengths of cmus is its customizability. You can modify keybindings, colors, and other settings to suit your preferences.

Editing Configuration:
The configuration file for cmus is located at ~/.config/cmus/autosave. You can manually edit this file to adjust various settings like keybindings and the appearance of cmus.

Plugins and Extensions:
Cmus supports a wide range of plugins and third-party tools that can extend its functionality. You can add equalizer support, integration with online music services, or even use Last.fm for scrobbling.

Step 6: Playing Different Formats
Cmus supports a variety of audio formats including:

MP3
OGG Vorbis
FLAC
AAC
WAV
You don’t need to install additional plugins for these formats; cmus handles them natively, ensuring a seamless playback experience.

Step 7: Exiting cmus
To exit cmus, press q. If you want to save your current session (library, queue, and playlists), cmus automatically saves this information, so you can continue from where you left off next time you open it.

Conclusion

Cmus is an excellent terminal-based music player for Linux users who prefer a minimalist, resource-efficient, and customizable interface. Whether you’re managing a large music collection or just need a quick way to play some tunes, cmus provides a flexible solution directly from your terminal. Try exploring more advanced features, such as integrating external plugins, customizing keybindings, or setting up scrobbling with Last.fm for an even more personalized experience.

For further details and advanced configurations, refer to the official cmus documentation.

Enjoy your music, all from the command line!

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button