I'm using the "init variable text file" to read the charging battery current at:
/sys/class/power_supply/battery/current_now
Whenever i execute it says "permission denied".
I'm using a rooted Nexus 5X - Vanilla Android
Permission denied??
Moderator: Martin
- digitalstone
- Posts: 342
- Joined: 21 Oct 2017 12:36
- Location: The Netherlands
Permission denied??
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)
Re: Permission denied??
That won't work, as general action of init and several files related operation are executed under normal user permission.
To access any file within root user permission, you must always use execute root command. (which mean we must know the command line alternatives)
To init the value of the current, use execute root command
check the {stdout} for the value.
To access any file within root user permission, you must always use execute root command. (which mean we must know the command line alternatives)
To init the value of the current, use execute root command
Code: Select all
cat sys/class/power_supply/battery/current_now
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
- digitalstone
- Posts: 342
- Joined: 21 Oct 2017 12:36
- Location: The Netherlands
Re: Permission denied??
Oh boy, i'm a Linux noob so i know why i didn't feel this one out.Desmanto wrote:That won't work, as general action of init and several files related operation are executed under normal user permission.
To access any file within root user permission, you must always use execute root command. (which mean we must know the command line alternatives)
To init the value of the current, use execute root commandcheck the {stdout} for the value.Code: Select all
cat sys/class/power_supply/battery/current_now
But thanks a bunch. It works now.
Little question though, i know of 'su' being used for interpreting super user commands.
But what does 'cat' stand for (other than your thumbnail

Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)
Re: Permission denied??
I am not quite familiar with linux too. Was forced to learn it bit by bit because of android. Most of the time I just google out the command using "android terminal" keyword. For example this cat command was found using "android terminal show file content"
cat command came from "concatenate" (some may say "catenate"). It supposed to be used to concatenate several files at once, and show them at the standard output. But somehow nowadays it usually used to show the content of a file.
Hehehe
, this cat has been my avatar since I active in other forum. It is easier for others to spot my post. (they said so) So i just kinda make it as my unique signature.
cat command came from "concatenate" (some may say "catenate"). It supposed to be used to concatenate several files at once, and show them at the standard output. But somehow nowadays it usually used to show the content of a file.
Hehehe

Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
- digitalstone
- Posts: 342
- Joined: 21 Oct 2017 12:36
- Location: The Netherlands
Re: Permission denied??
Sorry for the late reply. But alright, so it's just "on of these things" that you just have to knowDesmanto wrote:I am not quite familiar with linux too. Was forced to learn it bit by bit because of android. Most of the time I just google out the command using "android terminal" keyword. For example this cat command was found using "android terminal show file content"
cat command came from "concatenate" (some may say "catenate"). It supposed to be used to concatenate several files at once, and show them at the standard output. But somehow nowadays it usually used to show the content of a file.
Hehehe, this cat has been my avatar since I active in other forum. It is easier for others to spot my post. (they said so) So i just kinda make it as my unique signature.

New years eve has arrived, so with this i wish best of luck going through 2018 to you + cat (if yours) and anyone who reads this in 2017 (no time machine from future allowed).
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)