I have a lab I am doing for a Linux Operating class. The question I am stumped on is:
For the following questions, only use the
cp
command to copy files.You should currently be inside your
lab07
directory. Create a subdirectory inside this directory called ones and copy (working directory islab07
) all the files in the/labs/data/filenames/
that end with a1
,2
,3
, ...,9
into this new ones directory. I.e. copy the filesfile.1
,file.2
, etc., but not the filesfile.11
,file.21
, etc. Write the full command to copy these files into this new ones directory using only relative paths.
Now, I can do the problem using an absolute path, the command is:
cp /labs/data/filenames/file.[1-9] /lab07/ones
So from this, what would be the relative path?
I've been trying different commands for HOURS and I have no idea. I get the concept behind relative paths, it's just when I actually try to do it. I can't get it right!
We are using bash/shell, on a server. I am using Xquartz11
lab07
directory” really/lab07
? As Mirosław says, this is unlikely. But the only way to do this is if you know the full path to “yourlab07
directory”. Do you know it? (2) As Mirosław says,file.11
andfile.21
do end with1
. This problem is ill-defined.