Skip to Content
Navigation:

A stick figure smiling

If you want to see more comics like this, sign up for my saturday comics newsletter or browse more comics!

Image of a comic. To read the full HTML alt text, click "read the transcript".

browse more comics! get the zine!
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 of a into b
  • cp -R a b copies the whole folder into b/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: renames file.txt
  • if dest is a folder: moves file.txt to that folder

Saturday Morning Comics!

Want another comic like this in your email every Saturday? Sign up here!

I'll send you one of my favourite comics from my archives every Saturday.
© Julia Evans 2024 | All rights reserved (see the FAQ for notes about licensing)