Updated ch 04

This commit is contained in:
Kenneth John Odle 2026-08-19 08:55:50 -04:00
parent d04261936d
commit ffd657b1f3

View File

@ -1,27 +1,16 @@
\chapter{Files}
\chapter{System}
\section{Remove Part of a Filename from Multiple Files}
\section{To Reload Your \texttt{.bashrc} File}
\lettrine{S}{ome} applications can produce files that are similarly named, and for whatever reason, you want to remove the repetitive bits. You can use the \texttt{mmv}\index{mmv} package to do this. Assume you have a list of files that all start with ``foo'':
\lettrine{S}{ometimes} you add something to your \texttt{.bashrc} file (such as a new bash alias)\index[concepts]{bash alias} and you need to reload it. Of course, this file is reloaded every time you log in, but you may not wish to log out and then log back in if you are in the middle of important work. There are few different ways to do this:
\begin{Verbatim}[]
foo143.txt
fooabi.txt
foo38r.txt
source ~/.bashrc
\end{Verbatim}
\index{source}
\lettrine{T}{his} can also be accomplished by using the \textbf{rename}\index{rename} command.
\section{Obtain a List of Files and their Paths}
\lettrine{T}{he} \texttt{find} command has options to obtain this list. To obtain this list with the full path, use:
\input{bits/find_PWD}
To obtain this list with a relative path, use:
and of course a shorter way:
\begin{Verbatim}[]
find .
. ~/.bashrc
\end{Verbatim}
\ktcbox{Sometimes you need a list of files with their filepaths, and these tools will do that. Unfortunately, Linux does not have a way to put the file first, so the way to do this is to redirect \texttt{stdout} to a \texttt{.csv} file and manipulate the output in a spreadsheet.}