Results 1 to 3 of 3

Thread: the -r option

  1. #1
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,523
    Distro
    Xubuntu 18.04 Bionic Beaver

    the -r option

    the touch command has 2 options to reference another file object: --reference and -r
    the chmod and chown commands can reference another file object but they only have --reference to do that and not -r
    anyone know why? is there a security issue?
    What do you call someone who speaks 3 languages? Trilingual.
    What do you call someone who speaks 2 languages? Bilingual.
    What do you call someone who speaks 1 language? American.

  2. #2
    Join Date
    Feb 2015
    Beans
    Hidden!
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: the -r option

    Quote Originally Posted by Skaperen View Post
    ...
    the chmod and chown commands can reference another file object but they only have --reference to do that and not -r
    anyone know why? is there a security issue?
    Most likely for safety reasons as chmod and chown both use "-R" for "recursive"; whereas touch has no recursive action option at all so it is safe to use "-r" for "reference".

    If "-r" was used for "reference" with chown or chmod a simple accidental capitalization of "-r" to a "-R" could have a rather interesting/unexpected, possibly damaging, outcome. The recursive switch in some commands can at times have rather damaging consequences when used wrongly.

    I have not read or heard of this as an explanation, I am only surmising this is the case. From my experience it is sort of obvious to me this would be why but I have not heard or seen elsewhere this situation explained, as a result you should await further advice from more experienced helpers here. There may be other explanations I am unaware of for this.

    Regards, yeti.
    Last edited by yetimon_64; 1 Week Ago at 07:07 AM. Reason: sp. & gr.

  3. #3
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,523
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: the -r option

    that seems like a reasonable cause.
    What do you call someone who speaks 3 languages? Trilingual.
    What do you call someone who speaks 2 languages? Bilingual.
    What do you call someone who speaks 1 language? American.

Tags for this Thread

Bookmarks

Posting Permissions

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