I find myself doing this often enough that I wonder if there's a standard Unix way to do it:
% mkdir -p /TARGETDIR/relative/path/to
% cp ./relative/path/to/somefile /TARGETDIR/relative/path/to
In other words, I don't want to just copy somefile to /TARGETDIR, but actually I want to copy its entire relative path.
Is there a simpler way to do this than the two-liner above?
I've got an IIS6 server that is returning 200 when I have my custom 404 page set (Set to be URL /404.htm).
Reading up on it, it seems that if I use the 'file' option instead, it will return an actual 404 status code.
However, I want to be able to set this for all websites on my server (a few hundred), so I want to be able to use a relative path.
When using IIS Manager, it only allows me to pick
I'm having a hard time finding a way to do something. This is probably kind of stupid but I want to add a path to the enviroment PATH, the problem is the script isn't going to know where it lives.
There is a tool that comes bundled with a project, project1/tools and that path needs to be set when making project 2.
I'm trying to run a command similar to the one below in a bash script.
I'm trying to get a program to work that isn't in my distro's package manager. It doesn't provide a makefile or sources, just binaries. If I copy the whole folder to /usr/local and then add that to my PATH in .bashrc, I can execute the program but there are problems. The program requires some local files from its directory, and they are stored as a relative path.
The scp (openssh) command accepts relative paths as host:path/ which are relative to the home directory on the host.
I have a sub-dir tree with varying number of branches and most of
the branches contain .cpp files (many of them).
I know this is a very basic question but I can't seem to figure out what to search for to get the answer.
In linux/unix/ssh I know you can create a folder like this:
mkdir path/to/myfolder
And you can move to that folder like this:
cd path/to/myfolder
But is it possible to create it and move to it in one command, to prevent having to type the path twice?
I'm trying to burn a DVD from Windows but it fails because the full path name length exceeds the limit of something like 255 characters.
Our files are stored in Debian Linux (accessed by Windows using samba), so to avoid running some dodgy Windows app to find long path names I'd prefer to find them using a Linux command.
What command could I run to output a list of the relative path and file nam