5

I've tried executing /proc/meminfo but my permission has been denied.

3
  • Can you please add the output of ls -l /proc/meminfo to your question? Commented Oct 14, 2015 at 15:44
  • 4
    You need to provide more information when asking questions. Assuming you mean Linux, you can run the 'free' command to see the total memory. Commented Oct 14, 2015 at 15:45
  • You can not execute /proc/meminfo, it is a text. Procfs does not support the chmod operation with what you could give it execute permission. Commented Jun 5, 2024 at 13:28

1 Answer 1

6

You need to use cat /proc/meminfo, not execute /proc/meminfo directly.

The reason you get "permission denied" is because you're trying to execute /proc/meminfo, and /proc/meminfo has no executable bit set (because it's not an executable, it's a file that you have to read).

Reading /proc/meminfo itself should not require any special permissions.

You might find it easier to find the total memory using the free command, though.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.