Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

file change-owner

Syntax

Description

Change the ownership of a file to a specified user, group or both.

Options

filename

Filename to change owner.

user

New owner of the file.

group

New group of the file.

to

New owner:group of the file.

recurse

Operate recursively. Changes the ownership of all files and subdirectories within the specified directory.

Required Privilege Level

maintenance

Sample Output

file change-owner (user)

The following sample command changes the owner of /var/tmp/config.txt to labuser. The group remains unchanged.

file change-owner (group)

The following sample command changes the group of /var/tmp/config.txt to staff. The user remains unchanged.

file change-owner (to)

The following sample command sets the owner of the file to labuser and the group to staff.

file change-owner (recurse)

The following sample command recursively changes the ownership of all files and subdirectories within /var/home/john/config-dir directory.

Release Information

Command introduced before Junos OS Release 7.4.