Write to file forbidden

GaryT taig at melbpc.org.au
Mon Mar 16 14:48:40 UTC 2009


Nils Kassube wrote:
> GaryT wrote:  
>> To obtain a recursive listing of all files, I'll use the command
>> 	ls -s -S -R
>> from the root directory.    
> That would be nearly all files - hidden files would stay hidden. If you 
> want to see ALL files, add the -A option.  
>> BUT
>> When attempting to capture that list by saving it to a text file, I
>> get "permission denied"
>> 	e.g.	ls -s -S -R >files.txt    
> You are not allowed to write to "/files.txt".
>> dding sudo makes no difference    
> No, it doesn't because sudo then only works for the ls command, not for 
> the output redirection. Try
> sudo ls -sSR / >~/files.txt
> which will give you a list of all files but place the output in your 
> home directory.
>> sing gksudo also makes no difference.
>>     
> There is no big difference between sudo and gksudo in this case because, 
> like sudo, it operates on the ls command not on the output redirection.
> Nils
Thanks for the reminder, Nils.  No doubt I would have done some 
fruitless searching for hidden files before the penny dropped.
Cheers
GT





More information about the ubuntu-users mailing list