problem runing commands to manage files and directories


Results 1 to 7 of 7

Thread: problem runing commands to manage files and directories

  1. #1
    Join Date
    Oct 2013
    Posts
    10

    problem runing commands to manage files and directories

    I am taking a class in Linux for the first time so please bear with me here!

    I'm following a book btw. Running Fedora 13 on Virtual Box. My /root directory does not contain what the book says it should contain and I don't know why? and what I need to do about it because to do the rest of my projects, this must work.

    Also in the /root directory, logged on as root, I am unable to use the "cp" command. Error I get is: missing destination file operand after "filename".

    the filename does exist under ls -F and I've created a destination directory even though the book didn't go through it. but I still get the same error message.

    What am I doing wrong please?

    Thanks

  2. #2
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    Try the examples of the manual.
    Code:
    man cp
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  3. #3
    Join Date
    Oct 2013
    Posts
    10
    How can I tell where the command "cp" is located? I do the man cp command and although it gives me the help, it doesn't help me. I need to be able to run the cp command. I am following the book and according to the book, it should be working the way I'm doing it. But I have a hunch that the cp command is some directory that I'm not aware of. I am running as root btw and my working directory is /root.

  4. #4
    Join Date
    Oct 2002
    Location
    AZ, USA
    Posts
    110
    which cp will return the location of the cp command.

    Now the question is are you in the root users directory, or at root ( "/root", or "/" ) ?

    most textbooks when talking about the root directory are talking about "THE ROOT" directory "/".

  5. #5
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    How can I tell where the command "cp" is located?
    try

    Code:
    ls /bin
    Most Linux commands are in either /bin or /sbin.

    My output of "ls /bin"
    Code:
    code]saikee@Mint15 ~ $ ls /bin
    bash                  fgconsole   nano                     sed
    bunzip2               fgrep       nc                       setfacl
    busybox               findmnt     nc.openbsd               setfont
    bzcat                 fuser       netcat                   setupcon
    bzcmp                 fusermount  netstat                  sh
    bzdiff                getfacl     nisdomainname            sh.distrib
    bzegrep               grep        ntfs-3g                  sleep
    bzexe                 gunzip      ntfs-3g.probe            ss
    bzfgrep               gzexe       ntfs-3g.secaudit         static-sh
    bzgrep                gzip        ntfs-3g.usermap          stty
    bzip2                 hostname    ntfscat                  su
    bzip2recover          ip          ntfsck                   sync
    bzless                kbd_mode    ntfscluster              tailf
    bzmore                keyctl      ntfscmp                  tar
    cat                   kill        ntfsdump_logfile         tempfile
    chacl                 kmod        ntfsfix                  touch
    chgrp                 less        ntfsinfo                 true
    chmod                 lessecho    ntfsls                   ulockmgr_server
    chown                 lessfile    ntfsmftalloc             umount
    chvt                  lesskey     ntfsmove                 uname
    cp                    lesspipe    ntfstruncate             uncompress
    cpio                  ln          ntfswipe                 unicode_start
    dash                  loadkeys    open                     vdir
    date                  login       openvt                   vmmouse_detect
    dbus-cleanup-sockets  loginctl    pidof                    which
    dbus-daemon           lowntfs-3g  ping                     whiptail
    dbus-uuidgen          ls          ping6                    ypdomainname
    dd                    lsblk       plymouth                 zcat
    df                    lsmod       plymouth-upstart-bridge  zcmp
    dir                   mkdir       ps                       zdiff
    dmesg                 mknod       pwd                      zegrep
    dnsdomainname         mktemp      rbash                    zfgrep
    domainname            more        readlink                 zforce
    dumpkeys              mount       rm                       zgrep
    echo                  mountpoint  rmdir                    zless
    ed                    mt          rnano                    zmore
    egrep                 mt-gnu      running-in-container     znew
    false                 mv          run-parts
    Last edited by saikee; 10-08-2013 at 07:15 PM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  6. #6
    Join Date
    Oct 2013
    Posts
    10
    Quote Originally Posted by JRefL5 View Post
    which cp will return the location of the cp command.

    Now the question is are you in the root users directory, or at root ( "/root", or "/" ) ?

    most textbooks when talking about the root directory are talking about "THE ROOT" directory "/".
    I checked and I was in the /root directory, going to / didn't help but when I went into a subdirectory under /root, I was able to use the cp command.

    The author of this book forgot that it matters to know what location to start these projects from.

    Thanks for all your help. At least I got that project done! But I still don't understand why the cp command would not work under /root? I'll ask the teacher and hope he won't go off on a tangent explaining everything else and not give a comprehensible answer.

    I'm glad you all are here.

  7. #7
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    I still don't understand why the cp command would not work under /root?
    /root belongs to the root user. /home belongs to the PC user. It is like a guest wanting to deposit things in his host's room. What has been allow in Linux is the guest can mess up his own room (/home) and not allow to change the host's room (/root). This is the normal arrangement of the security in any OS. You can imagine inexperienced PC user can accidentally delete some important files of the OS so there must be a protection.

    Having said that you can become the root user temporary in Linux if you know the root password and by using commands su. Therefore theoretically any user can cp files into /root.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •