Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Help with Linux command line...?

Okay, I have a file in the directory /data named file1 and the owner is smith and the group is acctg.

If I am logged in as root, what would be the command line to change the owner to brown. So, the command line to change "smith" to "brown".

Also, what would the command line to change the group from "acctg" to "engr".

And, finally, what would the whole command line be to make sure these worked?

Thanks! I have little experience with Linux. Loving it so far, more than Windows though. I need to change the owner and group though. thanks ahead of time! :)

4 Answers

Relevance
  • 9 years ago
    Favorite Answer

    In the terminal input:

    chown brown:engr /data/file1

    or change to the directory:

    cd /data

    chown brown:engr file1

    Where chown is change owner user:group (brown is in the user space, engr is in the group space), /data/file1 is the location and file in question.

    Then input :

    ls -la

    where ls is to list content, -l uses long list format -a is all including hidden files, thus -la long list all.

  • 9 years ago

    Summary, data/file1 is now owned by smith:acctg and needs to be changed to brown:engr

    Note: This assumes that data is in your current path, if not, add the path to it.

    From your ssh or terminal window:

    ls -1alhr data/file1

    You should see something like,

    -rw-r--r-- 1 smith acctg 125 Aug 15 23:46 data/file1

    Now change the ownership.

    chown -v brown:engr data/file1

    The -v switch tells you what happened.

    You should see something like:

    changed ownership of `data/file1 to brown:engr

    To verify again:

    ls -1alhr data/file1

    You should see an output similar to the following:

    -rw-r--r-- 1 brown engr 125 Aug 15 23:46 data/file1

    Hope this helps.

    Source(s): Detailed info on usage. man ls man chmod
  • loar
    Lv 4
    5 years ago

    You do not have got to use commandline, however I in my view use it loads. More often than not since I started on UNIX before graphic interfaces of any form existed. But also from the commandline you've got manipulate that i do not feel you ever get from a GUI (picture consumer interface). There are things such as loading your photographs from a digital camera and you want to create thumbnails but in addition want them copied to a listing sized for a special purpose. I nip onto the commandline and run my batch file for it. Takes moments to do, masses turbo and extra controllable than any Paint software i know of. That is just one example, I would speak about many areas where the commandline makes lifestyles effortless. However, you cannot jump straight into that kind of thing, you must with one or more of the Linux tutorials. There are various free ones, start along with your own Linux variant tutorials.But Linux is Linux, that you may read other tutorials. Debian have excellent tutorials that cover just about each Linux, on the grounds that the bulk are founded on Devian.

  • Say
    Lv 5
    9 years ago

    you go to the directory and then

    chown brown file1

    this will change the owner

    then chgrp engr file1

    this will change the group.

Still have questions? Get your answers by asking now.