Become a MacRumors Supporter for \$25/year with no ads, private forums, and more!

# MacCopying Files from Package Files

#### Tomar

##### macrumors member
Original poster
Hello

I'm trying to copy a file with a specific extension out of a package file and into another directory.

I used the following in terminal:

cp filename.package/*.txt .

I keep getting the following error:

cp: filename.package/*.txt: No such file or directory

What am I doing wrong???

#### Terminated

##### macrumors newbie
Hello

I'm trying to copy a file with a specific extension out of a package file and into another directory.

I used the following in terminal:

cp filename.package/*.txt .

I keep getting the following error:

cp: filename.package/*.txt: No such file or directory

What am I doing wrong???

I can think of two possibilities:

1) It may be that filename.package is not in the current working directory.

2) Or it may be that there is no file with extension .txt in the first level of the directory filename.package.

Both situations would cause the same error message.

Comment

#### Tomar

##### macrumors member
Original poster
I can copy the file using the aforementioned command if specify the filename

cp filename.package/textfilename.txt .

However, it doesn't seem to work when I try to use the wildcard

cp filename.package/*.txt .

The name of the text file changes when a new package file which is why I'm trying to copy it using a wildcard and the file extension

Comment

#### chown33

##### Moderator
Staff member
Post the output of this command line:
Code:
``ls -ld filename.package ; ls -la filename.package ; id``
Copy and paste the exact command-line into Terminal. Copy and paste the complete unchanged output into a reply here, including any error messages that may appear.

Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.