I'm trying to list the contents of the whole apropos
(makewhatis
) database with the following command but I keep getting Permission denied
.
sudo -s apropos . > touch thedatabase
-bash: touch: Permission denied
sudo -s apropos . > thedirectory
thedatabase: Permission denied
apropos . > touch thedatabase
All of these result in some form of Permission Denied
. How do I get around this or what is the more elegant way of doing this?
sudo -s apropos . thedatabase > touch
, and similarly the last example. Maybe just tryapropos . >/tmp/ap.out
, you should be able to write to /tmp.>
correct? And how does your example of of puttingthedatabase
before> touch
make sense? I don't think I have a solid grasp of the ordering that these things can be in. Thank you!echo hello >echo.out
is how one would normally write a command to echo a line containing "hello" to the file echo.out, butecho >echo.out hello
and>echo.out echo hello
do the same thing. So in your first example, the shell sees> touch
and treats that as a redirect to the file touch, then when it seesthedatabase
, it's treated as just another command argument.