How to easily manipulate long paths in Linux
I found this little gem a while ago and a coworker identified it as useful too, so I’m posting it:
Let’s say you want to copy a file from a different directory to a new file in that same directory but don’t want to change to that directory, and the path is really long…
cp /my/very/long/path/to/{old_file,new_file}.cpp
This will copy /my/very/long/path/to/old_file.cpp
to /my/very/long/path/to/new_file.cpp
Categories