If you want to see more comics like this, sign up for my saturday comics newsletter or browse more comics!
read the transcript!
panel 1: ls ..
and cd ..
refer to different folders if you cd
to a symlinked folder
~/Dropbox -> ~/Library/CloudStorage/Dropbox
cd ~
cd Dropbox
ls ..
cd ..
ls ..
lists~/Library/CloudStorage
cd ..
moves to~
this is because ls
is a program and cd
is run by the shell.
The shell handles ..
differently from other programs.
panel 2: ls ~/Dropbox
will list the contents of the folder
this is annoying if you just want to look at its permissions, or where it links to
to fix this:
ls -d ~/Dropbox
panel 3: deleting a folder and recreating it with the exact same name makes everything weird
everything you do in the folder will fail with weird errors like:
$ touch newfile
touch: newfile: no such file
or directory
how to fix it:
cd .
panel 4: on Mac OS, these are not the same: cp -R a/ b
and cp -R a b
cp -R a/ b
merges the contents ofa
intob
cp -R a b
copies the whole folder intob/a
panel 4: tip: cd -
switches to the folder you were previously in
panel 5: notes on mv file.txt dest
- if
dest
is a file: renamesfile.txt
- if
dest
is a folder: movesfile.txt
to that folder
Saturday Morning Comics!
Want another comic like this in your email every Saturday? Sign up here!
© Julia Evans 2024 | All rights reserved (see the FAQ for notes about licensing)