What is the difference between single quotes, double quotes and no quotes?
BeginnerConceptPackages, Shell & Text Tools
Answer
Single quotes are literal: nothing expands. Double quotes expand $var, $(cmd) and backslash escapes, but prevent word splitting and globbing. Unquoted variables are split on whitespace and glob-expanded, so rm $file with file="my report.txt" tries to delete two files. Rule: always double-quote variables, "$file".
More on Packages, Shell & Text Tools
Compare apt and dnf package management.BeginnerWhat is the difference between `apt upgrade` and `apt full-upgrade`?IntermediateHow do you find which package provides a file or command?BeginnerHow do you pin or hold a package version?IntermediateHow are repositories and their GPG keys configured?AdvancedWhat is the difference between a login shell and an interactive non-login shell?Intermediate