Search code examples
linuxcd

what does this linux command do: "cd !!:1"


In linux command cd, after make a dir, I can use "cd !!:1" to enter it, but what exactly does !!:1 mean, I can't search it by google, because it include special chars.


Solution

  • !! is short hand for the previous command. The :1 goes to the second parameter in the command, which in your previous command was the directory name.

    One of my favorite command-line shortcuts is sudo !!