find can't redirect my output to a file

$ find /* -name "*assw*" -print 2> /dev/null

With the above command, how would I redirect the output to a file?

I tried these unsuccessfully
$ find /* -name "*assw*" -print 2> /dev/null >> file1 !(no
output)
$ find /* -name "*assw*" -print 2> /dev/null | tee file1 !(no
output)

thanks,
Crzzy1
cozzmo1 [ Mo, 05 November 2007 18:39 ] [ ID #1862397 ]

Re: find can't redirect my output to a file

cozzmo1 [at] hotmail.com wrote:
> $ find /* -name "*assw*" -print 2> /dev/null
>
> With the above command, how would I redirect the output to a file?
>
> I tried these unsuccessfully
> $ find /* -name "*assw*" -print 2> /dev/null >> file1 !(no
> output)
> $ find /* -name "*assw*" -print 2> /dev/null | tee file1 !(no
> output)

Which OS?

try:

$ find / -name "*assw*" -print >/tmp/file1

Are there any errors beside "Permission denied"?

--
Best regards | Be nice to America or they'll bring democracy to
Cyrus | your country.
Cyrus Kriticos [ Mo, 05 November 2007 19:33 ] [ ID #1862399 ]

Re: find can't redirect my output to a file

cozzmo1 [at] hotmail.com wrote:
> $ find /* -name "*assw*" -print 2> /dev/null
>
> With the above command, how would I redirect the output to a file?
>
> I tried these unsuccessfully
> $ find /* -name "*assw*" -print 2> /dev/null >> file1 !(no
> output)
> $ find /* -name "*assw*" -print 2> /dev/null | tee file1 !(no
> output)
>
> thanks,
> Crzzy1
>

Because it does not find anything that matches "*assw*"?
Then it will create an empty file1 or append nothing.

Or it dies with "too many arguments" because /* has too many
matches? The 2>/dev/null suppresses the error message.

Try

find / -print 2> /dev/null | tee file1


--
Michael Tosch [at] hp : com
Michael Tosch [ Mo, 05 November 2007 19:38 ] [ ID #1862400 ]

Re: find can't redirect my output to a file

On Nov 5, 1:38 pm, Michael Tosch <eed... [at] NO.eed.SPAM.ericsson.PLS.se>
wrote:
> cozz... [at] hotmail.com wrote:
> > $ find /* -name "*assw*" -print 2> /dev/null
>
> > With the above command, how would I redirect the output to a file?
>
> > I tried these unsuccessfully
> > $ find /* -name "*assw*" -print 2> /dev/null >> file1 !(no
> > output)
> > $ find /* -name "*assw*" -print 2> /dev/null | tee file1 !(no
> > output)
>
> > thanks,
> >Crzzy1
>
> Because it does not find anything that matches "*assw*"?
> Then it will create an empty file1 or append nothing.
>
> Or it dies with "too many arguments" because /* has too many
> matches? The 2>/dev/null suppresses the error message.
>
> Try
>
> find / -print 2> /dev/null | tee file1
>
> --
> Michael Tosch [at] hp : com

---------

I am sorry for not being more clear.

find /* -name "*assw*" -print 2> /dev/null

The above gives lots of output, but somehow I can't redirect it to a
file.
the below methods don't work, and file1 remains empty, the "tee"
option gives no output either.

$ find /* -name "*assw*" -print 2> /dev/null >> file1
$ find /* -name "*assw*" -print 2> /dev/null | tee file1

Thanks,
Crzzy1
------
cozzmo1 [ Mi, 07 November 2007 13:36 ] [ ID #1864305 ]

Re: find can't redirect my output to a file

On Wed, 07 Nov 2007 04:36:04 -0800, cozzmo1 [at] hotmail.com wrote:

>On Nov 5, 1:38 pm, Michael Tosch <eed... [at] NO.eed.SPAM.ericsson.PLS.se>
>wrote:
>> cozz... [at] hotmail.com wrote:
<snip>
>
>find /* -name "*assw*" -print 2> /dev/null
>
>The above gives lots of output, but somehow I can't redirect it to a
>file.
>the below methods don't work, and file1 remains empty, the "tee"
>option gives no output either.
>
>$ find /* -name "*assw*" -print 2> /dev/null >> file1
> $ find /* -name "*assw*" -print 2> /dev/null | tee file1
>
>Thanks,
>Crzzy1
>------

What OS/find are you using? Your first example works fine for me
using GNU find 4.2.31 in Slackware and the find in SCO Openserver.


Scott McMillan
Scott McMillan [ Mi, 07 November 2007 15:12 ] [ ID #1864311 ]

Re: find can't redirect my output to a file

In article <1194438964.279834.134210 [at] 57g2000hsv.googlegroups.com>,
<cozzmo1 [at] hotmail.com> wrote:
>On Nov 5, 1:38 pm, Michael Tosch <eed... [at] NO.eed.SPAM.ericsson.PLS.se>
>wrote:
>> cozz... [at] hotmail.com wrote:
>> > $ find /* -name "*assw*" -print 2> /dev/null
>>
>> > With the above command, how would I redirect the output to a file?
>>
>> > I tried these unsuccessfully
>> > $ find /* -name "*assw*" -print 2> /dev/null >> file1 !(no
>> > output)
>> > $ find /* -name "*assw*" -print 2> /dev/null | tee file1 !(no
>> > output)
>>
>> > thanks,
>> >Crzzy1
>>
>> Because it does not find anything that matches "*assw*"?
>> Then it will create an empty file1 or append nothing.
>>
>> Or it dies with "too many arguments" because /* has too many
>> matches? The 2>/dev/null suppresses the error message.
>>
>> Try
>>
>> find / -print 2> /dev/null | tee file1
>>
>> --
>> Michael Tosch [at] hp : com
>
>---------
>
>I am sorry for not being more clear.
>
>find /* -name "*assw*" -print 2> /dev/null
>
>The above gives lots of output, but somehow I can't redirect it to a
>file.
>the below methods don't work, and file1 remains empty, the "tee"
>option gives no output either.
>
>$ find /* -name "*assw*" -print 2> /dev/null >> file1
> $ find /* -name "*assw*" -print 2> /dev/null | tee file1
.
.
.
I don't understand the question.

Within /bin/bash, for example, if I command
find /* -name "*assw*" -print 2>/dev/null > $SOMEFILE
I get the result I expect: $SOMEFILE fills up with lines of
filenames which contain "assw".

I don't see what this has to do with Tcl, where this has been
cross-posted, nor can I reproduce the non-results you describe
for "... >> file1" and so on.
claird [ Mi, 07 November 2007 15:18 ] [ ID #1864312 ]

Re: find can't redirect my output to a file

["Followup-To:" header set to comp.unix.shell.]
>
> I am sorry for not being more clear.
>
> find /* -name "*assw*" -print 2> /dev/null
>
> The above gives lots of output, but somehow I can't redirect it to a
> file.
> the below methods don't work, and file1 remains empty, the "tee"
> option gives no output either.
>
> $ find /* -name "*assw*" -print 2> /dev/null >> file1
> $ find /* -name "*assw*" -print 2> /dev/null | tee file1
>
Are you using csh or tcsh? If so, try
find /* -name "*assw*" -print >& file1
Bill Marcum [ Mi, 07 November 2007 16:26 ] [ ID #1864318 ]

Re: find can't redirect my output to a file

-------
I am using bash, I can do csh, but with either shell..

That works more or less, but without the "2> /dev/null" then the
output has all the errors. (Below)
and as long as I am redirecting the errors to "/dev/null" I can't seem
to also redirect them to a file.


host01% find /* -name "*assw*" -print >& file1

host01% more file1
find: cannot read dir /apps/lost+found: Permission denied
find: cannot read dir /apps/Spectrum/lib/SDPM: Permission denied
find: cannot read dir /apps/Spectrum/.ssh: Permission denied
<snip>
-------

On Nov 7, 10:26 am, Bill Marcum <marcumb... [at] bellsouth.net> wrote:
> ["Followup-To:" header set to comp.unix.shell.]
>
> > I am sorry for not being more clear.
>
> > find /* -name "*assw*" -print 2> /dev/null
>
> > The above gives lots of output, but somehow I can'tredirectit to a
> > file.
> > the below methods don't work, and file1 remains empty, the "tee"
> > option gives no output either.
>
> > $ find /* -name "*assw*" -print 2> /dev/null >> file1
> > $ find /* -name "*assw*" -print 2> /dev/null | tee file1
>
> Are you using csh or tcsh? If so, try
> find /* -name "*assw*" -print >& file1
cozzmo1 [ Do, 08 November 2007 19:15 ] [ ID #1865322 ]

Re: find can't redirect my output to a file

cozzmo1 [at] hotmail.com writes:

> host01% find /* -name "*assw*" -print >& file1


find /* -name "*assw*" -print > file 2> /dev/null
Maxwell Lol [ Di, 13 November 2007 04:54 ] [ ID #1869003 ]
Linux » comp.unix.shell » find can't redirect my output to a file

Vorheriges Thema: Question on bc - basic calculator
Nächstes Thema: printf and shell variable