Need some help
So I am taking an half online/ half go to school class. I am working on an assignment that is due tonight by midnight. I am kind of confused on this question and am waiting on an email from my instructor but only have 2.5 hrs left til it's done. Here is the question.
Use file globbing to copy all the files in the /labs/data directory that end with a .out to the lab07 directory. How many files are in the lab07 directory? Ok so.... I put myself into the /labs/data dir cd /labs/data ls -l when I ls -l into this directory. I don't see any files with that extension. Is there an easier way that I am missing such as. cp /labs/data *.out > lab07 ??? Someone help? |
I don't think the command you tried have worked.
Before copying files, you will have to make sure that the files with the extensions .out are there or not in '/lab/data' directory. Then, have the following command to copy the files, cp /labs/data/*.out /lab07/ |
I tried using the advice given. Now it tells me that the directory doesn't exist. Starting up the first thing I did was mkdir /lab07. I am really not to sure where to go from here.
|
Ok ... so you are in the /labs/data directory ... and you run ls -l ... and you see no files that are blahblah.out ?
Hmmm .. try ls -a |
Yes I tried both of those... I enter the directory cd /labs/data and then I ls -l or -a and I see nothing in there that ends with .out.
As for copying it over into my directory... what about this? cp /labs/data/ned /labs/data/fred ~/labXX # now combine it together using file globing: cp /labs/data/[nf]ed ~/labXX |
I figured out the one from last night, now I am onto a new headache....
Use file globbing to copy all the files in the /labs/data directory that start with a c, d, or n into the lab07 directory. How many files are now located in the lab07 directory? this is the command I am using I am in my created directory lab07 cp /labs/data[c,d,n]~/lab07 I am getting a specified destination directory does not exist, I know it exists I am in it right now. Any help would be awesome. |
As this is homework, I'll just make a few suggestions (as per LQ rules)
1. you need a '/' between the dirname & filenames 2. you need space between src and target 3. Bookmark and read: http://rute.2038bug.com/index.html.gz http://tldp.org/LDP/Bash-Beginners-G...tml/index.html http://www.tldp.org/LDP/abs/html/ |
All times are GMT -5. The time now is 04:03 AM. |