# Baeldung - Linux

Learn about Linux in practice

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Linux File Viewing Series

DevFeed: [Linux File Viewing Series](<https://devfeed.tech/articles/linux-file-viewing-series-4523.md>)

Original publisher: [Read original article](<https://feeds.feedblitz.com/~/952800815/0/baeldung/linux~Linux-File-Viewing-Series>)

Author: baeldung

Published: 2026-04-01T15:45:15Z

Content type: article

Language: en

Sources: [Baeldung - Linux](<https://devfeed.tech/sources/baeldung-linux.md>)

Topics: [Linux](<https://devfeed.tech/topics/linux.md>), [file](<https://devfeed.tech/topics/file.md>)

Tags: [command-line](<https://devfeed.tech/tags/command-line.md>), [comparison](<https://devfeed.tech/tags/comparison.md>), [file-viewing](<https://devfeed.tech/tags/file-viewing.md>), [file-viewing-series](<https://devfeed.tech/tags/file-viewing-series.md>), [linux](<https://devfeed.tech/tags/linux.md>), [paging](<https://devfeed.tech/tags/paging.md>), [series](<https://devfeed.tech/tags/series.md>), [vim](<https://devfeed.tech/tags/vim.md>)

### AI overview

The guide outlines command-line ways to view Linux file content, including pagers and readers for browsing, grep for searching patterns, and Vi/Vim for navigation. It also covers file comparison and tools for opening specialized formats such as EPUB, PDF, HEIC, and CAD. The excerpt names these areas but does not provide specific commands or compare individual tools.

### Source excerpt

This guide covers the essential techniques for viewing files in Linux. The post Linux File Viewing Series first appeared on Baeldung on Linux. Related Stories How To Open Visio Files in Linux Linux File Editing Series How to View Font Files in Linux

## How to Identify the Package Manager of a Linux System

DevFeed: [How to Identify the Package Manager of a Linux System](<https://devfeed.tech/articles/how-to-identify-the-package-manager-of-a-linux-system-4521.md>)

Original publisher: [Read original article](<https://feeds.feedblitz.com/~/921621143/0/baeldung/linux~How-to-Identify-the-Package-Manager-of-a-Linux-System>)

Author: Umara Mushtaq

Published: 2025-07-14T02:13:11Z

Content type: tutorial

Language: en

Sources: [Baeldung - Linux](<https://devfeed.tech/sources/baeldung-linux.md>)

Topics: [Bash](<https://devfeed.tech/topics/bash.md>), [Script](<https://devfeed.tech/topics/script.md>), [dnf](<https://devfeed.tech/topics/dnf.md>), [snap](<https://devfeed.tech/topics/snap.md>), [pacman](<https://devfeed.tech/topics/pacman.md>), [Ubuntu](<https://devfeed.tech/topics/ubuntu.md>)

Tags: [apt](<https://devfeed.tech/tags/apt.md>), [arch-linux](<https://devfeed.tech/tags/arch-linux.md>), [article](<https://devfeed.tech/tags/article.md>), [automated](<https://devfeed.tech/tags/automated.md>), [automation](<https://devfeed.tech/tags/automation.md>), [bash](<https://devfeed.tech/tags/bash.md>), [compatibility](<https://devfeed.tech/tags/compatibility.md>), [debian](<https://devfeed.tech/tags/debian.md>), [distribution](<https://devfeed.tech/tags/distribution.md>), [distributions](<https://devfeed.tech/tags/distributions.md>), [distro](<https://devfeed.tech/tags/distro.md>), [dnf](<https://devfeed.tech/tags/dnf.md>), [fedora](<https://devfeed.tech/tags/fedora.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [linux](<https://devfeed.tech/tags/linux.md>), [linux-distribution](<https://devfeed.tech/tags/linux-distribution.md>), [linux-how-to](<https://devfeed.tech/tags/linux-how-to.md>), [linux-mint](<https://devfeed.tech/tags/linux-mint.md>), [package-management](<https://devfeed.tech/tags/package-management.md>), [package-management-scripting-apt-dnf-pacman-snap-yum](<https://devfeed.tech/tags/package-management-scripting-apt-dnf-pacman-snap-yum.md>), [pacman](<https://devfeed.tech/tags/pacman.md>), [scripting](<https://devfeed.tech/tags/scripting.md>), [snap](<https://devfeed.tech/tags/snap.md>)

### AI overview

Identify a Linux system's likely default package manager by checking its distribution in `/etc/os-release` or with `lsb_release`, then verify whether a tool such as `apt` is installed with `which`. The text cautions that a system can have multiple package managers. Its basic Bash script checks with an `if`/`elif` chain and reports only the first match. The more flexible script loops through a fixed list (`apt`, `yum`, `dnf`, `zypper`, `pacman`, `snap`, `flatpak`) to report all detected tools, then maps selected distribution names to a presumed default. The examples map Ubuntu, Debian, and Linux Mint to `apt`; Fedora and Red Hat to `dnf`; CentOS to `yum`; Arch and Manjaro to `pacman`; and openSUSE to `zypper`.

### Source excerpt

Learn different ways to guess or identify the default package manager of a Linux system. The post How to Identify the Package Manager of a Linux System first appeared on Baeldung on Linux. Related Stories How to Check for Available Package Updates in Linux How to Properly Install Valgrind? Background Jobs in a Loop in Bash

## Background Jobs in a Loop in Bash

DevFeed: [Background Jobs in a Loop in Bash](<https://devfeed.tech/articles/background-jobs-in-a-loop-in-bash-4520.md>)

Original publisher: [Read original article](<https://feeds.feedblitz.com/~/920673941/0/baeldung/linux~Background-Jobs-in-a-Loop-in-Bash>)

Author: Sourov Jajodia

Published: 2025-06-24T11:47:03Z

Content type: tutorial

Language: en

Sources: [Baeldung - Linux](<https://devfeed.tech/sources/baeldung-linux.md>)

Topics: [Process](<https://devfeed.tech/topics/process.md>)

Tags: [bash](<https://devfeed.tech/tags/bash.md>), [jobs](<https://devfeed.tech/tags/jobs.md>), [linux](<https://devfeed.tech/tags/linux.md>), [loops](<https://devfeed.tech/tags/loops.md>), [processes](<https://devfeed.tech/tags/processes.md>), [resource](<https://devfeed.tech/tags/resource.md>), [scripting](<https://devfeed.tech/tags/scripting.md>), [scripting-bash](<https://devfeed.tech/tags/scripting-bash.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

### AI overview

A Bash tutorial on running loop iterations as background jobs, waiting for completion, and avoiding excessive parallel work.

### Source excerpt

Learn several patterns to run background jobs in a loop in Bash. The post Background Jobs in a Loop in Bash first appeared on Baeldung on Linux. Related Stories Why the Value of a Variable Modified in a while Loop Is Not Remembered Outside? Executing Commands in Gnuplot through Shell Script Converting Output to String in Linux

## Redirecting Standard Output in C With the dup2() Function

DevFeed: [Redirecting Standard Output in C With the dup2() Function](<https://devfeed.tech/articles/redirecting-standard-output-in-c-with-the-dup2-function-4519.md>)

Original publisher: [Read original article](<https://feeds.feedblitz.com/~/920203664/0/baeldung/linux~Redirecting-Standard-Output-in-C-With-the-dup-Function>)

Author: Marcin Buczkowski

Published: 2025-06-14T07:02:25Z

Content type: tutorial

Language: en

Sources: [Baeldung - Linux](<https://devfeed.tech/sources/baeldung-linux.md>)

Topics: [Redirection](<https://devfeed.tech/topics/redirection.md>), [IO](<https://devfeed.tech/topics/io.md>), [Process](<https://devfeed.tech/topics/process.md>)

Tags: [c](<https://devfeed.tech/tags/c.md>), [command](<https://devfeed.tech/tags/command.md>), [examples](<https://devfeed.tech/tags/examples.md>), [file](<https://devfeed.tech/tags/file.md>), [flow](<https://devfeed.tech/tags/flow.md>), [fork](<https://devfeed.tech/tags/fork.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [linux](<https://devfeed.tech/tags/linux.md>), [processes](<https://devfeed.tech/tags/processes.md>), [processes-gcc-redirection-streams](<https://devfeed.tech/tags/processes-gcc-redirection-streams.md>), [redirection](<https://devfeed.tech/tags/redirection.md>), [streams](<https://devfeed.tech/tags/streams.md>)

### AI overview

In C, `dup2(oldfd, 1)` makes standard output refer to the file or device open on `oldfd`, so existing code that writes to stdout can be redirected without modification. The examples open a file for output, then use `dup2()` to redirect either `printf()` output or an `uname` command launched with `execvp()`. Since `execvp()` replaces the current process, a separate example uses `fork()` so only the child's redirection affects stdout; the parent waits and continues writing to the terminal. To restore stdout, the article duplicates the original descriptor with `dup()` before redirecting, then copies it back with `dup2()`. It notes that `dup2()` returns the new descriptor on success and `-1` on failure; the examples omit error checking.

### Source excerpt

Learn how redirection works and the way the dup2() function achieves it in C. The post Redirecting Standard Output in C With the dup2() Function first appeared on Baeldung on Linux. Related Stories How to Find the SCHED_RR Scheduling Policy's Time Slice How Can I Swap Colors With GIMP? How to Identify the Package Manager of a Linux System

## Linux Emergency Recovery With init=/bin/bash

DevFeed: [Linux Emergency Recovery With init=/bin/bash](<https://devfeed.tech/articles/linux-emergency-recovery-with-init-bin-bash-4518.md>)

Original publisher: [Read original article](<https://feeds.feedblitz.com/~/920030138/0/baeldung/linux~Linux-Emergency-Recovery-With-initbinbash>)

Author: Francesco Galgani

Published: 2025-06-10T19:40:59Z

Content type: tutorial

Language: en

Sources: [Baeldung - Linux](<https://devfeed.tech/sources/baeldung-linux.md>)

Topics: [Disaster Recovery](<https://devfeed.tech/topics/disaster-recovery.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [Bash](<https://devfeed.tech/topics/bash.md>), [boot](<https://devfeed.tech/topics/boot.md>), [GRUB](<https://devfeed.tech/topics/grub.md>), [systemd](<https://devfeed.tech/topics/systemd.md>), [mount](<https://devfeed.tech/topics/mount.md>), [Ext4](<https://devfeed.tech/topics/ext4.md>)

Tags: [1-1-1-1](<https://devfeed.tech/tags/1-1-1-1.md>), [apt](<https://devfeed.tech/tags/apt.md>), [backup](<https://devfeed.tech/tags/backup.md>), [bash](<https://devfeed.tech/tags/bash.md>), [bash-shell](<https://devfeed.tech/tags/bash-shell.md>), [boot](<https://devfeed.tech/tags/boot.md>), [boot-process](<https://devfeed.tech/tags/boot-process.md>), [boot-process-passwd-popular-systemd](<https://devfeed.tech/tags/boot-process-passwd-popular-systemd.md>), [boot-process-passwd-systemd](<https://devfeed.tech/tags/boot-process-passwd-systemd.md>), [bootloader](<https://devfeed.tech/tags/bootloader.md>), [c](<https://devfeed.tech/tags/c.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [emergency](<https://devfeed.tech/tags/emergency.md>), [init](<https://devfeed.tech/tags/init.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [linux](<https://devfeed.tech/tags/linux.md>), [parameter](<https://devfeed.tech/tags/parameter.md>), [passwd](<https://devfeed.tech/tags/passwd.md>), [popular](<https://devfeed.tech/tags/popular.md>), [recovery](<https://devfeed.tech/tags/recovery.md>), [restore](<https://devfeed.tech/tags/restore.md>), [root](<https://devfeed.tech/tags/root.md>), [shell](<https://devfeed.tech/tags/shell.md>), [systemd](<https://devfeed.tech/tags/systemd.md>)

### AI overview

When the bootloader and kernel still work, adding `init=/bin/bash` in GRUB can start Bash as PID 1 with root privileges, bypassing normal services and boot scripts. The root filesystem starts read-only, so remount it read-write before changing passwords or repairing files. For root filesystem corruption, use `break=premount` to reach BusyBox in the initramfs before the damaged filesystem is mounted; there, unlock LUKS, activate LVM, and run `fsck`. To reinstall missing packages, the excerpt shows manually configuring networking and mounts, then using apt and dpkg. Normal reboot commands may fail without systemd; `reboot -f` is usually available, while `sync` followed by writing `b` to `/proc/sysrq-trigger` forces an immediate reboot and risks data loss or corruption. The examples were tested with Linux Mint 22 and are described as applicable to Debian/Ubuntu-based systems; commands need adapting to the installation.

### Source excerpt

Learn to use the init=/bin/bash kernel parameter to access a minimalist root shell on systems that wouldn't otherwise boot. The post Linux Emergency Recovery With init=/bin/bash first appeared on Baeldung on Linux. Click the icon below to watch. Related Stories Linux Emergency Recovery With init=/bin/bash - Enclosure How to Restore Systemd After Deleting It Accidentally How to Dual Boot Windows and Linux

## What Is SELinux?

DevFeed: [What Is SELinux?](<https://devfeed.tech/articles/what-is-selinux-4516.md>)

Original publisher: [Read original article](<https://feeds.feedblitz.com/~/919939004/0/baeldung/linux~What-Is-SELinux>)

Author: Zachary Bouhannana

Published: 2025-06-09T04:53:08Z

Content type: article

Language: en

Sources: [Baeldung - Linux](<https://devfeed.tech/sources/baeldung-linux.md>)

Topics: [SELinux](<https://devfeed.tech/topics/selinux.md>), [Access Control](<https://devfeed.tech/topics/access-control.md>), [Security](<https://devfeed.tech/topics/security.md>), [Process](<https://devfeed.tech/topics/process.md>), [least privilege](<https://devfeed.tech/topics/least-privilege.md>)

Tags: [access-control](<https://devfeed.tech/tags/access-control.md>), [administration](<https://devfeed.tech/tags/administration.md>), [administration-security-chmod-ls-selinux](<https://devfeed.tech/tags/administration-security-chmod-ls-selinux.md>), [attack-surface](<https://devfeed.tech/tags/attack-surface.md>), [chmod](<https://devfeed.tech/tags/chmod.md>), [context](<https://devfeed.tech/tags/context.md>), [linux](<https://devfeed.tech/tags/linux.md>), [ls](<https://devfeed.tech/tags/ls.md>), [security](<https://devfeed.tech/tags/security.md>), [selinux](<https://devfeed.tech/tags/selinux.md>), [what-is](<https://devfeed.tech/tags/what-is.md>), [with](<https://devfeed.tech/tags/with.md>), [works](<https://devfeed.tech/tags/works.md>)

### AI overview

SELinux adds kernel-enforced mandatory access control alongside Linux's ordinary discretionary permissions. DAC is checked first; SELinux then checks labeled users, roles, processes, and resources against policy rules, denying actions that are not explicitly allowed. This can restrict a compromised service or even root when its actions violate policy. Administrators can inspect labels with `ls -Z`, adjust supported policy behavior through booleans such as `httpd_can_network_connect`, and choose enforcing, permissive, or disabled mode. The excerpt notes that `setenforce` changes do not persist after reboot; persistent mode changes use `/etc/selinux/config`. Its example shows Apache's `httpd_t` process denied access to a file labeled `admin_home_t`, even when the command runs as root.

### Source excerpt

Learn what SELinux is, how it works, and the way it can provide better security when paired with the common discretionary access control. The post What Is SELinux? first appeared on Baeldung on Linux. Related Stories Sending a Password via SSH or SCP Using subprocess.Popen in Linux Resolving the Reverse Tunnel Remote port forwarding failed for listen port SSH Error How to Fix USB Sticks Mounted as Read-Only

## Resolving the Reverse Tunnel Remote port forwarding failed for listen port SSH Error

DevFeed: [Resolving the Reverse Tunnel Remote port forwarding failed for listen port SSH Error](<https://devfeed.tech/articles/resolving-the-reverse-tunnel-remote-port-forwarding-failed-for-listen-port-ssh-error-4517.md>)

Original publisher: [Read original article](<https://feeds.feedblitz.com/~/919939007/0/baeldung/linux~Resolving-the-Reverse-Tunnel-Remote-port-forwarding-failed-for-listen-port-SSH-Error>)

Author: Hiks Gerganov

Published: 2025-06-09T04:49:53Z

Content type: article

Language: en

Sources: [Baeldung - Linux](<https://devfeed.tech/sources/baeldung-linux.md>)

Topics: [ssh](<https://devfeed.tech/topics/ssh.md>)

Tags: [bash](<https://devfeed.tech/tags/bash.md>), [bind](<https://devfeed.tech/tags/bind.md>), [bookworm](<https://devfeed.tech/tags/bookworm.md>), [client](<https://devfeed.tech/tags/client.md>), [clients](<https://devfeed.tech/tags/clients.md>), [command](<https://devfeed.tech/tags/command.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [configure](<https://devfeed.tech/tags/configure.md>), [connectivity](<https://devfeed.tech/tags/connectivity.md>), [curl](<https://devfeed.tech/tags/curl.md>), [debian](<https://devfeed.tech/tags/debian.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [diagnose](<https://devfeed.tech/tags/diagnose.md>), [error](<https://devfeed.tech/tags/error.md>), [failed](<https://devfeed.tech/tags/failed.md>), [network-configuration](<https://devfeed.tech/tags/network-configuration.md>), [network-configuration-network-monitoring-security-ssh](<https://devfeed.tech/tags/network-configuration-network-monitoring-security-ssh.md>), [port](<https://devfeed.tech/tags/port.md>), [remote](<https://devfeed.tech/tags/remote.md>), [reverse](<https://devfeed.tech/tags/reverse.md>), [security](<https://devfeed.tech/tags/security.md>), [ssh](<https://devfeed.tech/tags/ssh.md>), [vpn](<https://devfeed.tech/tags/vpn.md>)

### AI overview

Reverse SSH forwarding uses `ssh -N -R` to expose a service reachable from a protected client through a listening port on a remote server. The `-R` value specifies the remote bind address and port, then the destination host and port reachable from the client; by default, the remote listener is loopback-only. The "remote port forwarding failed for listen port" error can result from a busy port, attempting to bind a privileged port below 1024, malformed address or port fields, an unavailable bind address or disabled forwarding in `sshd_config`, or other configuration issues. Check listeners and their IP versions on the server with `ss`, verify the forwarding syntax and port availability, and inspect `AllowTcpForwarding` and `GatewayPorts` when relevant. A working tunnel may still be unreachable externally if the port is filtered by a firewall, router, or ISP; client-side tunneling does not remove those restrictions beyond the remote server.

### Source excerpt

Learn about reverse SSH tunnels, i.e., SSH port forwarding, and issues that you might encounter when trying to use them. The post Resolving the Reverse Tunnel Remote port forwarding failed for listen port SSH Error first appeared on Baeldung on Linux. Related Stories Sending a Password via SSH or SCP Using subprocess.Popen in Linux What Is SELinux? How To Automatically Connect to a VPN in Linux

## Using if-else Conditionals in a Makefile

DevFeed: [Using if-else Conditionals in a Makefile](<https://devfeed.tech/articles/using-if-else-conditionals-in-a-makefile-4515.md>)

Original publisher: [Read original article](<https://feeds.feedblitz.com/~/919796387/0/baeldung/linux~Using-ifelse-Conditionals-in-a-Makefile>)

Author: baeldung

Published: 2025-06-06T09:36:00Z

Content type: tutorial

Language: en

Sources: [Baeldung - Linux](<https://devfeed.tech/sources/baeldung-linux.md>)

Topics: [make](<https://devfeed.tech/topics/make.md>), [conditionals](<https://devfeed.tech/topics/conditionals.md>), [Bash](<https://devfeed.tech/topics/bash.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [awk](<https://devfeed.tech/tags/awk.md>), [bash](<https://devfeed.tech/tags/bash.md>), [build](<https://devfeed.tech/tags/build.md>), [building](<https://devfeed.tech/tags/building.md>), [building-make-popular](<https://devfeed.tech/tags/building-make-popular.md>), [cc](<https://devfeed.tech/tags/cc.md>), [command](<https://devfeed.tech/tags/command.md>), [commands](<https://devfeed.tech/tags/commands.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [conditional](<https://devfeed.tech/tags/conditional.md>), [conditionals](<https://devfeed.tech/tags/conditionals.md>), [debug](<https://devfeed.tech/tags/debug.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [directives](<https://devfeed.tech/tags/directives.md>), [disk-space](<https://devfeed.tech/tags/disk-space.md>), [echo](<https://devfeed.tech/tags/echo.md>), [endif](<https://devfeed.tech/tags/endif.md>), [environment](<https://devfeed.tech/tags/environment.md>), [error](<https://devfeed.tech/tags/error.md>), [file](<https://devfeed.tech/tags/file.md>), [linux](<https://devfeed.tech/tags/linux.md>), [make](<https://devfeed.tech/tags/make.md>), [popular](<https://devfeed.tech/tags/popular.md>), [scripting](<https://devfeed.tech/tags/scripting.md>), [shell](<https://devfeed.tech/tags/shell.md>)

### AI overview

Makefile conditionals use directives such as `ifeq` and `ifneq` to compare strings, and `ifdef` and `ifndef` to check whether variables are defined. The examples select compiler flags, provide a default compiler, and choose OS-specific behavior. For file checks inside a recipe, the article uses a shell `if`; Make's `$(if ...)` function supports inline conditional values. It also demonstrates checking disk space with `$(shell ...)` and stopping with `$(error ...)`. Recipe lines generally run in separate shell instances, so shell variables do not carry across lines.

### Source excerpt

Learn how to use if-else conditional statements inside of Makefiles. The post Using if-else Conditionals in a Makefile first appeared on Baeldung on Linux. Related Stories How to Identify the Package Manager of a Linux System Background Jobs in a Loop in Bash Executing Commands in Gnuplot through Shell Script

## How to Fix USB Sticks Mounted as Read-Only

DevFeed: [How to Fix USB Sticks Mounted as Read-Only](<https://devfeed.tech/articles/how-to-fix-usb-sticks-mounted-as-read-only-4514.md>)

Original publisher: [Read original article](<https://feeds.feedblitz.com/~/919792943/0/baeldung/linux~How-to-Fix-USB-Sticks-Mounted-as-ReadOnly>)

Author: Samuel Njuguna Karanja

Published: 2025-06-06T07:56:19Z

Content type: tutorial

Language: en

Sources: [Baeldung - Linux](<https://devfeed.tech/sources/baeldung-linux.md>)

Topics: [mount](<https://devfeed.tech/topics/mount.md>), [USB](<https://devfeed.tech/topics/usb.md>), [fstab](<https://devfeed.tech/topics/fstab.md>)

Tags: [administration](<https://devfeed.tech/tags/administration.md>), [administration-filesystems-hardware-mount-usb](<https://devfeed.tech/tags/administration-filesystems-hardware-mount-usb.md>), [data-loss](<https://devfeed.tech/tags/data-loss.md>), [diagnose](<https://devfeed.tech/tags/diagnose.md>), [errors](<https://devfeed.tech/tags/errors.md>), [failure](<https://devfeed.tech/tags/failure.md>), [filesystem](<https://devfeed.tech/tags/filesystem.md>), [filesystems](<https://devfeed.tech/tags/filesystems.md>), [flash](<https://devfeed.tech/tags/flash.md>), [flash-memory](<https://devfeed.tech/tags/flash-memory.md>), [fsck](<https://devfeed.tech/tags/fsck.md>), [fstab](<https://devfeed.tech/tags/fstab.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [linux](<https://devfeed.tech/tags/linux.md>), [mount](<https://devfeed.tech/tags/mount.md>), [permission](<https://devfeed.tech/tags/permission.md>), [usb](<https://devfeed.tech/tags/usb.md>)

### AI overview

A USB stick mounted read-only may be affected by filesystem errors, a read-only mount option, a physical write-protect switch, or failing flash hardware. Check `mount` output for `ro` and try creating a file to confirm. If the mount configuration or prior errors appear responsible, identify the device and mount point with `df -h`, then try `sudo mount -o remount,rw /dev/sda1 /mnt/MyUSB`. Check and toggle any physical lock switch. For suspected filesystem corruption, unmount the device and run its filesystem-specific check (the example uses `fsck.exfat`), then remount and test writing. If it remains read-only, failure may have triggered the controller's protection mode; copy off accessible data and replace the stick.`,

### Source excerpt

Learn how to identify and diagnose undesired USB flash drive read-only mounts. The post How to Fix USB Sticks Mounted as Read-Only first appeared on Baeldung on Linux. Related Stories SMB mount Security Modes and Fixing mount error(13): Permission denied in Linux What Is SELinux? Removing Log Files with a Cron Job in Linux