Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i am new in linux. i am learning embedded linux, in a book i saw such an usage.
can anyone tell me, how echo 49 > export could creat a file name is gpio49. on the command, gpio is not written.
root@beaglebone:∼# cd /sys/class/gpio
root@beaglebone:/sys/class/gpio# ls
export gpiochip0 gpiochip32 gpiochip64 gpiochip96 unexport
root@beaglebone:/sys/class/gpio# echo 49 > export
root@beaglebone:/sys/class/gpio# ls
export gpio49 gpiochip0 gpiochip32 gpiochip64 gpiochip96 unexport
Echo standard outputs what its input - in this case "49". ">" writes the standard output of the command to the filename you give after it, in this case export.
Something's up. That command won't write a file called "gpio49"
The filesystem is sys, that is a pseudo-filesystem for accessing parts of the OS. Contents are unlikely to be simple files. Within /sys/class most "files" are links into /sys/devices. Writing anything into these files sends a message to some aspect of a device, what the device does with it will depend upon the device.
In this case I would assume that export allows you to create a new channel to a gpio device (this is a guess), so sending "49" to it will cause gpio to create gpio49. Unless you know this level of detail for the device concerned you should not write to any devices in /sys.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.