Search code examples
bashzshfish

Bash: the first path then the second as relative path to the first path in the same command


Let's say I want: ln -s /very/long/path/to_file /very/long/path/from_file

Is there a way not to type full path to the from_file again?

smth like: ln -s /very/long/path/to_file [sign]/from_file

where sign is automatically revealed as /very/long/path

May be you know some ways for bash, zsh or fish?


Solution

  • Brace expansion!

    ln -s /very/long/path/{to_file,from_file}