Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-27-2013, 02:49 PM   #1
LQ Newbie
Registered: Oct 2012
Posts: 15

Rep: Reputation: Disabled
strange bash command


Those are three lines, that I saw at site related to RPi. Still, I consider this forum to be the right one for placing my question.

root@raspberrypi:~# modprobe i2c-dev
root@raspberrypi:~# modprobe rtc-pcf8563
root@raspberrypi:~# echo pcf8563 0x51 > /sys/class/i2c-adapter/i2c-0/new_device

I want to ask someone to explain me the meaning of third line ie. what does it do ?
The matter is related to RTC chip (pcf8563), which has I2C bus and the (software) way of accessing it.

Old 01-27-2013, 03:14 PM   #2
Senior Member
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,849
Blog Entries: 36

Rep: Reputation: 455Reputation: 455Reputation: 455Reputation: 455Reputation: 455
/sys/class/i2c-adapter/i2c-0/new_device will Instantiate a new device from user-space. File new_device takes 2 parameters: the name of the I2C device (a string) and the address of the I2C device (a number, typically expressed in hexadecimal starting with 0x, but can also be expressed in decimal.) Read more (docs)

Source 1
pcf8563 likely refers to "Real-time clock/calendar".

Hope that helps. I found it by downloading the kernel source code and then finding keywords using "grep -irl".

1 members found this post helpful.
Old 01-28-2013, 01:29 AM   #3
LQ Newbie
Registered: Oct 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
Thank you Sag47 for your effort and quick unswer - I'm going to read docs you proposed. Hope I'll comprehend.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does this work from the bash command line and then fails in a bash script? Rupadhya Linux - Newbie 5 09-26-2012 12:05 AM
bash strange subshell command result fenor Programming 12 11-26-2009 07:35 AM
[SOLVED] Using a long Bash command including single quotes and pipes in a Bash script antcore Linux - General 9 07-22-2009 11:10 AM
Strange output when ssh - bash: ... command not found Azazwa Linux - Newbie 3 05-11-2009 09:23 AM
Strange if statement behaviour when using bash/bash script freeindy Programming 7 08-04-2008 06:00 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:16 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration