Announcement

Collapse
No announcement yet.

Need some command line help

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need some command line help

    I've been playing around with some command lines and I'm having trouble using the cp and mv commands. I created a "test" file on my Desktop and wanted to copy it to a etc/Test file I created. Here's what I tried:

    jacatone@eMax:~/Desktop$ cp /etc/Test/ test
    cp: omitting directory `/etc/Test/'
    jacatone@eMax:~/Desktop$

    Didn't work. What am I doing wrong here?

    How would I mv (move) this file to the etc/Test directory?

    Also, when I'm root#, what command brings me back to $.

    Thanks.







    #2
    Re: Need some command line help

    You need superuser permissions to mv or cp to /etc.

    So you would have to do:
    Code:
    fred1@fintanws2:~/Desktop$ sudo cp test /etc/test
    or
    Code:
    fred1@fintanws2:~/Desktop$ sudo mv test /etc/test
    HP Pavilion dv6 core i7 (Main)
    4 GB Ram
    Kubuntu 18.10

    Comment


      #3
      Re: Need some command line help

      "Also, when I'm root#, what command brings me back to $."

      exit
      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

      Comment


        #4
        Re: Need some command line help

        The mv command worked fine but the cp command gave me the following error message:

        jacatone@eMax:~/Desktop$ sudo cp test /etc/Test
        cp: omitting directory `test'

        Know what went wrong here?

        Comment


          #5
          Re: Need some command line help

          No, sorry I would have a google

          This is what google gives me:
          HP Pavilion dv6 core i7 (Main)
          4 GB Ram
          Kubuntu 18.10

          Comment


            #6
            Re: Need some command line help

            No need to use cp or mv commands .. If you want to move files to root folders use this

            Code:
            sudo dolphin

            Comment


              #7
              Re: Need some command line help

              Please don't use sudo for gui apps in the cli

              Use kdesudo instead
              HP Pavilion dv6 core i7 (Main)
              4 GB Ram
              Kubuntu 18.10

              Comment


                #8
                Re: Need some command line help

                hm .. seems that not many shell users here

                the error is not a permission error. He is triing to copy a directory, not a file. To copy a directory and everithyng inside you should use -r option ( recursive)

                "cp -r /etc/Test/ test" should work ( copy "/etc/Test/" diretory into "test" )

                else ( if /etc/Test dont contain dubdirectories) u can use also:

                cp /etc/test/* test/ ( copy all files in "/etc/test/" inside test/

                another usual opption is f ( force, used also to rewrite)

                usual usage is:
                "cp -fr /etc/Test/ test" , but be carefull .. it rewrites all without warnings and you cant "undo" what u did. ;-)

                Comment


                  #9
                  Re: Need some command line help

                  jacatone, suggest you put Tuxfiles on your list, as time/interest permits. On command line, she'll explain in detail cp for files and cp for directories, including recursive -r option.

                  Tuxfiles: http://www.tuxfiles.org/
                  An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                  Comment

                  Working...
                  X