
Ripping CDs on Linux with abcde, Made Simple
Feb 1st 2026ScriptsTL;DR:
I use abcde on Linux to rip CDs, and I love it. I wrote a small wrapper script called ripcd that detects all loaded CD drives, lets me rip one or all at once, and opens each disc in its own terminal tab. Everything rips to lossless FLAC by default. It is simple, fast, and removes a lot of manual steps when ripping multiple CDs.
Photo Credit
Photo was taken by myself at a New Found Glory show in 2017 at the Catalyst Club in Santa Cruz, CA.
I still buy music.
Part of that is nostalgia, and part of it is a conscious choice. Music has always been a big part of my life. Punk rock, hardcore, metal, indie. I like owning the album, the artwork, the liner notes, and having a physical copy that lives on my shelf.
Because of that, I buy CDs and records, then rip my CDs into a lossless music library that I keep for myself. I stream that library to my devices so I can listen wherever I am, without depending on third-party services.
No piracy. No sketchy sources. Just music I bought and ripped for my own collection.
I already had a setup I liked. I just wanted to make it easier to use.
A quick personal note on supporting artists
I want to be explicit about something that matters to me. I believe in supporting artists and musicians directly. That means buying records and CDs, going to shows, and paying for the music that means something to you.
Everything described here is about ripping music I already own for my personal library. No piracy, no file sharing, no gray areas. Just taking physical media I paid for and making it usable in a modern, self-hosted setup.
If you care about music, especially local scenes and independent artists, the best thing you can do is support them with your money and your time. Buy the album. Go to the show. Talk to the band at the merch table. The tools are just tools. The point is the music and the people who make it.
A few local bands worth supporting
Since I’m talking about buying music and supporting artists, I’d be remiss not to call out a few local bands that have meant a lot to me as of recent. These are artists I’ve seen live, bought records from, and still listen to regularly.
Outpatient X - Santa Cruz, CA
Bunker Club - Paso Robles, CA
Whats Good - Santa Cruz, CA
Why I use abcde on Linux
I really like abcde.
It is one of those Linux tools that has been around forever for a reason. It is reliable, flexible, and does exactly what it is supposed to do. Ripping, tagging, metadata lookups, encoding. It handles all of it without getting in the way.
I had no interest in replacing abcde or wrapping it in a heavy UI. I just wanted a better workflow when ripping more than one CD at a time.
A better multi-drive ripping workflow
I wrote a small wrapper script around abcde and called it ripcd.
From a terminal, I type:
1ripcd
The script checks all connected optical drives, detects which ones actually have discs loaded, and shows a simple menu. I can select a single drive or press a to rip all loaded CDs at once.
When ripping multiple discs, each CD opens in its own terminal tab. That keeps metadata prompts clean and makes it easy to work through several discs in parallel without mixing things up.
At that point, abcde takes over and does what it already does best.
FLAC only, by design
This script always rips CDs to lossless FLAC.
That choice is intentional. My goal is a clean archive, not a dozen encoding options. I keep one high-quality copy and convert formats later if I need to.
If you want different behavior, the abcde command is easy to change. The script is simple and readable on purpose so it can be adapted without much effort.
Why this setup works for me
I enjoy building and maintaining my own music library. I enjoy Linux tools that respect my time. I enjoy small bits of automation that remove friction instead of adding complexity.
Once ripping CDs became something I could start and mostly ignore, I knew the workflow was right.
Below this post you will find instructions for installing abcde on Fedora KDE, Ubuntu, and similar Linux setups, along with the full ripcd script. Everything is shared directly on the page so you can copy, paste, and tweak it for your own system.
Installing ripcd
ripcd is a simple shell script. There is no installer. Copy it into place, make it executable, and you are done.
You can install it per user or system-wide.
The Script
1#!/usr/bin/env bash2set -euo pipefail3 4# Detect optical drives with media inserted5get_drives_with_media() {6 for dev in /dev/sr*; do7 [[ -e "$dev" ]] || continue8 9 # Check if media is present10 if udevadm info -q property -n "$dev" 2>/dev/null | grep -qx 'ID_CDROM_MEDIA=1'; then11 echo "$dev"12 fi13 done14}15 16# Detect available terminal emulator17detect_terminal() {18 if command -v konsole >/dev/null 2>&1; then19 echo "konsole"20 elif command -v gnome-terminal >/dev/null 2>&1; then21 echo "gnome-terminal"22 elif command -v xterm >/dev/null 2>&1; then23 echo "xterm"24 else25 echo ""26 fi27}28 29# Find drives with media30mapfile -t drives < <(get_drives_with_media)31 32if (( ${#drives[@]} == 0 )); then33 echo "No discs detected in any optical drives."34 exit 135fi36 37# Show menu38echo "Discs detected:"39echo40for i in "${!drives[@]}"; do41 echo " $((i+1))) ${drives[$i]}"42done43echo44echo " a) ALL (rip all drives simultaneously in tabs)"45echo " q) Quit"46echo47 48read -rp "Select (1-${#drives[@]}, a, q): " choice49 50# Handle choice51case "${choice,,}" in52 q)53 echo "Quitting."54 exit 055 ;;56 57 a|all)58 term="$(detect_terminal)"59 60 if [[ -z "$term" ]]; then61 echo "No supported terminal found. Cannot open tabs."62 exit 163 fi64 65 case "$term" in66 konsole)67 echo "Opening Konsole with ${#drives[@]} tabs..."68 69 # Start an empty Konsole window70 konsole &71 konsole_pid=$!72 sleep 1.573 74 # Find the D-Bus service75 service="org.kde.konsole-$konsole_pid"76 77 # Check if the service exists78 if ! qdbus | grep -q "$service"; then79 echo "Could not connect to Konsole via D-Bus, opening separate windows instead..."80 for dev in "${drives[@]}"; do81 konsole -e bash -lc "abcde -d '$dev' -o flac; echo; echo 'Done. Press Enter to close.'; read" &82 sleep 0.383 done84 exit 085 fi86 87 # Process each drive88 for i in "${!drives[@]}"; do89 dev="${drives[$i]}"90 91 if (( i == 0 )); then92 # First drive: use the existing session93 session=$(qdbus $service /Windows/1 currentSession 2>/dev/null)94 else95 # Additional drives: create new tabs96 session=$(qdbus $service /Windows/1 newSession 2>/dev/null)97 sleep 0.598 fi99 100 if [[ -n "$session" ]]; then101 # Set tab title102 qdbus $service /Sessions/$session setTitle 1 "abcde $(basename "$dev")" 2>/dev/null103 104 # Send the command105 qdbus $service /Sessions/$session sendText "abcde -d '$dev' -o flac" 2>/dev/null106 qdbus $service /Sessions/$session sendText "$(printf '\r')" 2>/dev/null107 108 echo "Started ripping $dev in tab $((i+1))"109 fi110 done111 112 echo ""113 echo "All tabs created! You can:"114 echo " - Press Ctrl+Shift+* to split tabs side-by-side"115 echo " - Use Ctrl+Shift+Left/Right to switch between tabs"116 ;;117 118 gnome-terminal)119 echo "Opening ${#drives[@]} tabs in GNOME Terminal..."120 cmd="gnome-terminal"121 for dev in "${drives[@]}"; do122 cmd="$cmd --tab --title='abcde $(basename "$dev")' -- bash -lc \"abcde -d '$dev' -o flac; echo; echo 'Done. Press Enter to close.'; read\""123 done124 eval "$cmd" &125 ;;126 127 xterm)128 echo "Opening ${#drives[@]} separate xterm windows..."129 for dev in "${drives[@]}"; do130 xterm -title "abcde $(basename "$dev")" -e bash -lc "abcde -d '$dev' -o flac; echo; echo 'Done. Press Enter to close.'; read" &131 done132 ;;133 esac134 135 echo "All ripping processes started!"136 exit 0137 ;;138 139 *)140 # Check if it's a valid number141 if [[ "$choice" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#drives[@]} )); then142 dev="${drives[$((choice-1))]}"143 echo "Ripping ${dev}..."144 exec abcde -d "$dev" -o flac145 else146 echo "Invalid selection."147 exit 1148 fi149 ;;150esacOption A: User-only install (recommended)
Copy the script to:
1~/.local/bin/ripcd
Make it executable:
1chmod +x ~/.local/bin/ripcdMost modern distros already include ~/.local/bin in your PATH.
Option B: System-wide install
Copy the script to:
1/usr/local/bin/ripcd
Make it executable:
1sudo chmod +x /usr/local/bin/ripcdThis makes ripcd available to all users.
Optional: Close the launching terminal
If you want the terminal you run ripcd from to close after launching abcde, add an alias
User-only alias
Add to ~/.bashrc:
1alias ripcd='~/.local/bin/ripcd && exit'
Reload your shell:
1source ~/.bashrcSystem-wide alias
Create:
1sudo nano /etc/profile.d/ripcd.sh
Add:
1alias ripcd='ripcd && exit'Using ripcd
Run:
1ripcd
The script will:
Detect all connected optical drives
Check which drives have discs loaded
Show a menu of available options
Select a single drive or press a to rip all loaded CDs at once.
When ripping multiple discs, each CD opens in its own terminal tab or window. abcde then runs normally and prompts for metadata as needed.
Notes
abcdemust already be installed and working.All rips are done in lossless FLAC.
Supported terminals: Konsole, GNOME Terminal, xterm.
The abcde command inside the script can be modified if you want different options.

Josh Fridey
IT ManagerAbout the author:
Hi, I’m Josh Fridey, a Senior IT Manager with over 15 years of experience in the field. My work has centered around supporting companies that develop and deliver tech solutions for other businesses—especially in industries like agriculture, healthcare, construction, and petroleum—helping them grow through dependable, well-structured IT.

You can contact my best friend and food provider with this form. Suggestions, corrections, and questions are always welcome! Please also message me French fries...
