Cryptic but consistent 0 ▲ John D. Cook 52 minutes ago · Tech · hide · 0 comments Suppose you’ve never worked at the command line and you’re reading a book about the bash shell. You read that !$ is a shortcut to refer to the last word of the previous command. That little fact will almost certainly not stick in your head for a couple reasons. First, you probably see no need for such a shortcut. Second, the syntax seems completely arbitrary. But then after you use the command line a while, you might begin to notice a pattern. You often have to run a pair of commands with the same last argument, such as when you make a directory then navigate into it. mkdir /some/long/path/name cd /some/long/path/name Maybe someone sees you typing this and offers a helpful suggestion: you can type !$ to repeat the last part of the previous command. mkdir /some/long/path/name cd !$ Once you learn this, you’ll see uses for it regularly. Sorta like when you buy a green Toyota Corolla and suddenly become aware how many green Toyota Corollas there are out there. So then you start to use… No comments yet. Log in to reply on the Fediverse. Comments will appear here.