Every one of these commands will silently overwrite or delete without asking. That is not a bug; it is what makes them scriptable. The habit to build is knowing which flag turns the safety on.
1. Make a tree in one command
mkdir -p ~/labs/linux-files/app/{config,logs,data}
cd ~/labs/linux-files
find . -type d-p creates parents and does not complain if the directory already exists, which is why it is the only form you should use in a script.
Verify
2. Copy, and notice what happens without -r
touch app/config/settings.conf
cp app/config/settings.conf app/config/settings.conf.bak
cp app/config app/config-copyThe last one fails: cp refuses a directory unless you pass -r.
cp -r app/config app/config-copy
ls app/config-copyVerify
3. Watch cp overwrite something
echo "original" > a.txt
echo "replacement" > b.txt
cp b.txt a.txt
cat a.txta.txt now says replacement and the original is gone. No prompt, no backup. Two flags change that:
echo "original" > a.txt
cp -i b.txt a.txt # asks first
cp -n b.txt a.txt # refuses silently if the target exists
cat a.txtVerify
4. Move is rename
mv a.txt renamed.txt
ls
mv renamed.txt app/data/
ls app/dataThere is no separate rename command. mv within a filesystem is instant regardless of file size, because only the directory entry changes — the data never moves.
Verify
5. Delete, carefully
rm b.txt
rm -r app/config-copy
ls apprm -rf on the wrong path is the single most expensive typo in this profession. Two habits that cost nothing: run the ls first with the same glob you are about to delete, and never build the path with an unquoted variable.
ls app/data/*.txt # look at what will match
rm app/data/*.txt # then delete exactly thatVerify
Clean up
cd ~ && rm -rf ~/labs/linux-filesWhere this goes next
You can change a filesystem. Next: finding out who you are and what you are allowed to do — which is the thing that decides whether these commands succeed at all.