Why GNU/Linux Rocks

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sgreger1
    Member
    • Mar 2009
    • 9451

    #496
    QUICk, I NEED HELP!I need to know how to add the following text to a text file via the CLI
    Code:
    deb http://backports.debian.org/debian-backports squeeze-backports main
    I have to add this to a file in /etc/apt/ called source.list, the problem is that it says I don't have permission to edit it. I don't know anything about permisions, how do I give myself permission to edit this file, and how to I add the above text to the text file?

    Comment

    • shikitohno
      Member
      • Jul 2009
      • 1156

      #497
      Code:
      sudo vim /etc/apt/sources.list
      or, if you either haven't configured sudo, or it still says permission denied
      Code:
      su -c 'vim /etc/apt/sources.list'
      The second one will require your root password.

      Comment

      • lxskllr
        Member
        • Sep 2007
        • 13435

        #498
        If you don't have vim, substitute that with nano, or vi. Both of those should be installed.

        Comment

        • sgreger1
          Member
          • Mar 2009
          • 9451

          #499
          Thanks all, I was able to get it working with nano. It took me all night but I finally got a VNC connection going to my raspberry Pi, so now on my main computer I can just do my regular stuff and then run the Pi headless without a keyboard or monitor plugged in to it.

          The one issue I am having with the Pi is that there is packet loss with the USB ports. It results in a bug where when you type, the key stays depressed and goes like thisssssssssssssssss. Verry annoying, it took me like 30 minutes to log in because I couldn't see if the keys were repeating at the password prompt (since the characters are hidden), so it rejected my password a hundred times since keys kept getting stuck. It's especially bad with a USB hub (powered) attached to it, for some reason the packet loss is even worse. I guess it's something the community will have to patch, but for right now the best way to access it is to just SHH into it or run a VNC session.

          Step 2: Figure out how to get my wifi dongle working on it. I'm halfway there, I think by today I will finally have it working.

          Comment

          • devilock76
            Member
            • Aug 2010
            • 1737

            #500
            You could also echo the line into the file.

            echo 'line of text' >> filename

            sudo if permissions deem necessary

            Ken

            Comment

            • sgreger1
              Member
              • Mar 2009
              • 9451

              #501
              Originally posted by devilock76
              You could also echo the line into the file.

              echo 'line of text' >> filename

              sudo if permissions deem necessary

              Ken
              I had seen this before but was curious, where does it place the text in the file. Life does it place it directly after the last character in the text file?
              For example, if I I had a text file that read:

              1. Sentence number one.

              And did echo "2. Sentence number two.", would it change it to:

              1. Sentence number one.2. Sentence number two.

              Or are there ways of telling it to start a new paragraph or start on a new line etc?

              Comment

              • devilock76
                Member
                • Aug 2010
                • 1737

                #502
                Originally posted by sgreger1
                I had seen this before but was curious, where does it place the text in the file. Life does it place it directly after the last character in the text file?
                For example, if I I had a text file that read:

                1. Sentence number one.

                And did echo "2. Sentence number two.", would it change it to:

                1. Sentence number one.2. Sentence number two.

                Or are there ways of telling it to start a new paragraph or start on a new line etc?
                >> appends the output to the end of the file, one new line. You could send it the newline character \n to enforce multiple lines, play with it.

                If you wish to insert text at the beginning you could do this.

                echo 'new first line' > newfile
                cat oldfile >> newfile

                And of course to get more fancy like inserting something in the middle or a million other things like that you can use sed. Sed is pretty much a language in its own right.

                Ken

                Comment

                • Ansel
                  Member
                  • Feb 2011
                  • 3696

                  #503
                  Can anyone recommend a laptop that's on Amazon UK that i can buy so i can run the latest version of Ubuntu very well but low in price. Thanks :-)

                  Comment

                  • lxskllr
                    Member
                    • Sep 2007
                    • 13435

                    #504
                    Originally posted by Ansel
                    Can anyone recommend a laptop that's on Amazon UK that i can buy so i can run the latest version of Ubuntu very well but low in price. Thanks :-)
                    I'd find a laptop you like, then do a search of "laptop model# ubuntu", and see how other people have done with it.

                    Comment

                    • Ansel
                      Member
                      • Feb 2011
                      • 3696

                      #505
                      Originally posted by lxskllr
                      I'd find a laptop you like, then do a search of "laptop model# ubuntu", and see how other people have done with it.
                      ok what do you make of this one?

                      http://www.amazon.co.uk/gp/product/B...pf_rd_i=468294

                      Comment

                      • lxskllr
                        Member
                        • Sep 2007
                        • 13435

                        #506
                        Originally posted by Ansel
                        I don't know what the UK computer scene is like, but that seems expensive to me. I've never heard of the brand, and the processor is an Atom, which is basically a bottom end netbook processor. Nothing wrong with that, but at that price it seems high. USA has the cheapest electronic prices in the world, so my expectations may not be realistic for you. If you're trying to save every penny, you might find something good on the used market. That may not work if battery life is important to you though. Batteries wear out, and are expensive to replace, so any savings could be taken up by needing a new battery. If it seldom leaves the wall though, it can be a good way to save money.

                        Comment

                        • Ansel
                          Member
                          • Feb 2011
                          • 3696

                          #507
                          Hmm i don't want to buy used but it needn't be up to date in spec. I will look on eBay US website. Thanks.

                          Comment

                          • lxskllr
                            Member
                            • Sep 2007
                            • 13435

                            #508
                            I wouldn't dismiss used computers. Buying online can be tricky, but there's some great deals out there if you're trying to save money. I bought the machine I'm typing on in 2008 for $200 on Ebay. It was virtually brand new. Someone got it, upgraded the ram, but I guess decided it didn't suit them. The same machine brand new was $250, and that was with less ram. It's pretty crappy spec wise, but it does what I need it to do. You could probably buy it now for less than $100.

                            Comment

                            • SnusoMatic
                              Member
                              • Jun 2009
                              • 507

                              #509
                              it don't take as much hardware to run linux as it does winblows.

                              Comment

                              • Ansel
                                Member
                                • Feb 2011
                                • 3696

                                #510
                                Well i bought the MeeNee laptop which came with just Ubuntu installed. I love it. Just backing up the hard-drives on my desktop PC so i can get rid of windows completely.

                                Comment

                                Related Topics

                                Collapse

                                Working...
                                X