6 Replies Latest reply on May 25, 2016 11:34 AM by monahanz

    Where is .bashrc on the Edison breakout board Linux system

    monahanz

      I want to write a few alias for my Linux on the Edison breakout board   --  so they remain each time I boot.   I assume the have to be placed in my

      home folder and written into the normal Linux hidden file .bashrc.  I cannot find this file in my setup.  Do I have to make one and if so, where?

        • 1. Re: Where is .bashrc on the Edison breakout board Linux system
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi monahanz,

          I cannot find the .bashrc file either. Let me see if I'm able to find it, or if I'm able to find a way to make the aliases permanent.

          I'll post an update as soon as possible.

          Regards,
          Diego

          • 2. Re: Where is .bashrc on the Edison breakout board Linux system
            Intel Corporation
            This message was posted on behalf of Intel Corporation

            Hi monahanz,

            I was able to make the aliases permanent. Follow these steps:

            1. Create a file named as ".profile" in the /home/root directory.
            2. Include the aliases you need. For example alias stat=’df –H’
            3. Save the file and reboot the Edison using the command reboot.

            After the Edison boots, you should be able to run the aliases you saved in the .profile file.

            Regards,
            Diego

            • 3. Re: Where is .bashrc on the Edison breakout board Linux system
              monahanz

              Thanks for rapid feedback Diego.

              That totally did the trick!

              One strange thing while I have you...

              I tried creating the .profile text file on the LHS window of WinSCP using either Notepad or the 'internal editor".  When I transferred the file over to the Edison RHS window, I ran into two problems:-

               

              First, the file was not visible in the Edison \home\root directory. It was there however there when I looked with puTTY and the ls –ABFgh command.

               

              Second when I rebooted, Linux would not accept the lines of text. Looked like a problem with the cr/lf’s . 

              If however I used the Linux vi to generate the file and THEN rebooted the alias’se worked fine.

               

              What it the solution to using a Linux editor on Windows 10 in a case like this.

              Second, is there a way to get WinSCP to display protected files in the RHS "Edison window". 

               

              For use by other Windows/Linux newbies here is  the alias I used

              alias stat='df-H'

              alias copy='cp -i -r'

              alias dir='ls -ABFgh'

              alias del='rm -r'

              alias delete='rm -r'

              alias erase=’rm –r’

               

              • 4. Re: Where is .bashrc on the Edison breakout board Linux system
                monahanz

                I kind of discovered a partial answer to the second question. Putting a "." in front of a file name in Linux makes it invisible.  So if you move it across without the "." you can see it. You can then rename it .profile and the Edison Linux will recognize it.  The Edison Linux will not recognize profile it has to be .profile apparently. In WinSCP you cannot see it. To return it to the windows folder you have to rename it in Linux with mv back to profile, (or as I did again with alias REN='mv' for us window types).

                 

                Still unclear how to edit this .profile  in windows.

                 

                For any DOS/Windows types wanting a window list of aliases perhaps they can add to:-

                 

                alias dir='ls -ABFgh'

                alias copy='cp -i -r'

                alias stat='df -H'

                alias del='rm -r'

                alias delete='rm -r'

                alias erase='rm -r'

                alias ren='mv'

                alias rename='mv'

                • 5. Re: Where is .bashrc on the Edison breakout board Linux system
                  Intel Corporation
                  This message was posted on behalf of Intel Corporation

                  Hi monahanz,

                   

                  The "." at the beginning of the file name means that it's a hidden file, however I was able to see it in WinSCP. Check image below:

                  profilehidden.JPG


                  I was able to create the .profile in Windows and then transferring it to the Edison, and it worked fine. There is a detail however.  You have to delete the Carriage Return, otherwise you will get an error when trying to use the aliases. I used Notepad++, check the images below:

                  withCR.JPGwithoutCR.JPG

                   

                  In Notepad++, go to View>Show Symbol>Show All Characters to see the CR. To delete them, click ctrl+F and replace all the characters "\r" with blank space.

                  replace.JPG

                   

                  Then just send the .profile file to Edison using WinSCP and it should work.

                   

                  Regards,
                  Diego

                  1 of 1 people found this helpful
                  • 6. Re: Where is .bashrc on the Edison breakout board Linux system
                    monahanz

                    Excellent Diego.

                    Thank you so much for the great advice.

                    John