element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Interfaces
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 12 replies
  • Subscribers 668 subscribers
  • Views 839 views
  • Users 0 members are here
  • raspberry_pi
Related

Interfaces

rincewind1
rincewind1 over 11 years ago

I am trying to access sudo nano  /network/interfaces on my new pi the nano screen opens but has no content and if I try to type and save I get message file does not exist, I am a beginner trying to run pi from laptop but cannot get pi to have a static IP address due to this, can you help?

I think I have tried everything

  • Sign in to reply
  • Cancel
  • element14jamie
    element14jamie over 11 years ago

    Hello Adrian,

    Welcome to the community and hope you are enjoying it, I will move this discussion to the Raspberry Pi Area of the Community as that fits your question a little better.

     

     

    Thank you,

     

     

    Jamie

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • johnbeetem
    johnbeetem over 11 years ago

    From doing a quick search of "/network/interfaces" at the top of the page, I think you need to access "/etc/network/interfaces".

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 11 years ago

    Wrong file name:

     

    "sudo nano /etc/network/interfaces"

     

    that should work.

     

    EDIT:

     

    Once you have the file open, change:

     

    iface eth0 inet auto

     

    to

     

    iface eth0 inet static

      address <your_ip_address>

      netmask <your_netmask>

     

    Hope this helps.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • rincewind1
    rincewind1 over 11 years ago in reply to wallarug

    Yes I have tried that, the ect/network/interfaces, that is the line I was using, just forgot it in my question, when the editor opens it puts that path on top of the window, but it is classed as a new file.

    I happily get online via wireless network, but the interfaces file eludes me no matter how many times I try it.

    I have looked at and copied the path faithfully from research and books all to no avail.

    I have to put 2 spaces after the nano part before the /ect /network/interfaces else I get message command not found

    Thank you both for the suggestion

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • webmanaus
    webmanaus over 11 years ago in reply to rincewind1

    I don't know why, but you have the name wrong both times in your message:

    ect/network/interfaces - wrong - missing / at the beginning, and not ect

    /ect /network/interfaces - also wrong - not ect and remove the extra space

     

    The correct version is:

    sudo nano /etc/network/interfaces

     

    If all else fails, sometimes it is easier to take it in multiple small steps:

    1) cd /etc

    2) cd network

    3) sudo nano interfaces

     

    Make sure you don't get any errors after each step, and if possible, copy and paste what happens, or upload a photo of the screen. That will help us spot real issues instead of typos you may only be making when posting here.

     

    Hope this helps.

     

    Regards,

    Adam

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • rincewind1
    rincewind1 over 11 years ago in reply to webmanaus

    Thank you.

    However the line

    Sudo nano/ect/network/interfaces

    Returns message "command not found"

     

    Cd/ect

    Returns "no such file or directory"

     

    Cd network

    Returns "no such file or directory"

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 11 years ago in reply to rincewind1

    However the line

    Sudo nano/ect/network/interfaces

    Returns message "command not found"

     

    Try sudo instead of Sudo.

    Try etc instead of ect.

    Try leaving a space after nano

     

    Cd/ect

    Returns "no such file or directory"

     

    Try cd instead of Cd.

    Try etc instead of ect.

    Try leaving a space after cd.

     

    Cd network

    Returns "no such file or directory"

     

    Try cd instead of Cd.

    You need to successfully do "cd /etc" before you can do "cd network".

     

    By the way, you aren't the first person to get etc and ect confused.

    It might be helpful to understand that etc (the correct spelling) is an abbreviation

    for the latin "et cetera" which means miscellaneous things, as opposed to ect

    which might be an abbreviation for ectomorph, which means skinny kid.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 11 years ago

    Hi Adrian,

     

    I sympathize with your frustration on this.  I'm a Windows guy and linux is a different world.  Fortunately, I've been around long enough to have delt with DOS which is also a command-line environment.  I am in no way a linux expert so I hope I don't mislead you anywhere, and those who know, please correct me if I do.

     

    I'd suggest you take a breath and spend some time with the "bash" command line and understand the file system.

     

    Lets break it down: What you're trying to do in the command  "sudo nano /etc/network/interfaces" is three things:

     

    First thing to remember is upper/lower case counts!

     

    1. sudo: this is a request to the bash shell to allow you special priviliges to write to a system level file.  This kind of file is restricted from normal use.  By typing 'sudo' you're telling the bash shell "OK I know what I'm doing so let me edit and save this file"

     

    2. nano: this is a text editor, so you're invoking the program nano.

     

    3. /etc/network/interfaces: this is the file you want to edit.

     

    However, for nano to find the file it has to follow the path you give it.  The path starts from where you are and nano (or any program you give a path to) has to be able to see the sign-posts of each part of the path.

     

    So to orient yourself with respect to your starting position, bash can respond to a command called 'pwd'.  If you type those characters (lower case only) on the command line bash will respond with the directory you're currently in.  I think 'pwd' stands for 'present working directory'.  Anyway, then you can know where you are. 

     

    The next thing to do is type 'ls' (lowercase 'L'). That gives you the items and directories that are in the directory you're in.  If you like you can type 'ls -l' (no quotes)  the minus L is a request to list out the directory contents vertically rather than in a simple word-wrap way.

     

    So, getting back to the path: /etc/network/interfaces.  when you give the path the nano takes it apart slash by slash.  It looks for the 'etc' signpost in the items of the directory you're in.  If it's there it determines whether it's a file or another directory.  If it's a directory it goes to that directory and looks for the next piece: 'network'.  if it finds it, it again determines whether it's a file or a directory.  If it's a directory it again follows the signpost to that location and selects the next part of the path: 'interfaces'. 

     

    As you might expect, the last piece of the path should be a file that nano can open.  Every section prior to that in the path should be a directory since a path is intended to be an 'address' of a single entity.

     

    So, to finally get to the answer of your most recent question:

     

    >> I am trying to access sudo nano  /network/interfaces on my new pi the nano screen opens but has no content.

     

    If your pwd directory doesn't have the first piece the '/etc' you might get this situation.

     

     

     

    Believe me, learning linux is a step back in time for me.  Many people swear by linux, and I'm sure it does many great things.  It's lean which is needed in a Raspberry Pi/ arduino environment and works well in computing intensive scientific scenarios.  But it's a huge paradyme shift that takes some patience (and courage).  If you're serious about learning it you have to take the time to learn it.

     

    Best regards,

     

    Lou

     

    I hope this helps.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 11 years ago in reply to Former Member

    If your pwd directory doesn't have the first piece the '/etc' you might get this situation.

    The slash on the front of "/etc" has a special meaning, it means to look for "etc"

    in the root directory, rather than in the current directory shown by pwd.

     

    But other than that, your suggestion is a good one, to use the ls command in the

    root directory to see that etc is there, and in the etc directory to see that network is there,

    and in the network directory to see that interfaces is there.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 11 years ago in reply to Former Member

    Ah, okay so the leading '/' starts from the 'root' directory? 

     

    If I started from the root as my pwd and typed 'etc/network/interfaces' would I get what I needed?

     

    Alternatively when typing /network/interfaces would fail to find the file since it's assuming '/network' is at the root... right?

     

    Thanks for the guidance.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube