fstag - create, delete, or list file tags
VRTSvxfs
fstag create tag [file_path]fstag delete tag [file_path]
fstag deleteall [file_path]
fstag list [-n] [file_path]
The fstag command creates, deletes, or lists the file tags of a file. A file tag is an arbitrary ASCII string that is used to classify files based on any arbitrary criteria. You can have multiple tags per file.
The fstag command is supported only on VxFS file systems and will fail if run on files on a non-VxFS file system.Symlinks will not be followed, and tagging symlinks will fail.
NFS mount crossings will not be followed, and tagging files on NFS mounts will fail.
No cluster issues; command operates the same on cluster file systems.
create Creates a tag on the specified file. Duplicate tags are ignored. delete Deletes a tag from the specified file. Non-existent tags are ignored. deleteall Deletes all tags from the specified file. list Displays a two column table containing the pathnames and their corresponding file tags.
-n Suppresses column headings.
tag Specifies the file tag. The tag is an ASCII string of up to 63 characters and cannot contain the / (forward slash) character. file_path Specifies the file pathname on which to run the fstag command. You can specify file_path as a single pathname, or as a list of pathnames with one pathname per line being piped to the fstag command. If file_path is not specified, fstag expects to read the pathname from piped output.
The following command creates the file tag tag1 on the file /dst/mds1/file1.db:# fstag create tag1 /dst/mds1/file1.db
The following command creates the file tag tag1 on the file pathnames specified on separate lines in the /tmp/fpath plain text file:
The following command deletes the file tag tag1 from the file /dst/mds1/file1.db:# cat /tmp/fpath /tmp/file1.db /tmp/file2.db /tmp/file3.db # cat /tmp/fpath | fstag create tag1
# fstag delete tag1 /dst/mds1/file1.db
The following command deletes the file tag tag1 from the file pathnames specified on separate lines in the /tmp/fpath plain text file:
# cat /tmp/fpath /dst/mds1/file1.db /dst/mds1/file2.db /dst/mds1/file3.db # cat /tmp/fpath | fstag delete tag1
The following command deletes all file tags from the file /dst/mds1/file1.db:
# fstag deleteall /dst/mds1/file1.db
The following command deletes all file tags from the file pathnames specified on separate lines in the /tmp/fpath plain text file:
# cat /tmp/fpath /dst/mds1/file1.db /dst/mds1/file2.db /dst/mds1/file3.db # cat /tmp/fpath | fstag deleteall
The following command lists the file tags of the file /dst/mds1/file1.db:
# fstag list /dst/mds1/file1.db FILEPATH TAGNAME ======== ======= /dst/mds1/file1.db tag1 /dst/mds1/file1.db tag2 /dst/mds1/file1.db tag3 /dst/mds1/file1.db tag4
The following command lists the file tags of the file pathnames specified on separate lines in the /tmp/fpath plain text file:
# cat /tmp/fpath /dst/mds1/file1.db /dst/mds1/file2.db # cat /tmp/fpath | fstag list FILEPATH TAGNAME ======== ======= /dst/mds1/file1.db tag1 /dst/mds1/file1.db tag2 /dst/mds1/file1.db tag3 /dst/mds1/file1.db tag4 /dst/mds1/file2.db tag2 /dst/mds1/file2.db tag4
The following command lists the file tags of the file /dst/mds1/file1.db without the output column headings:
# fstag list -n /dst/mds1/file1.db /dst/mds1/file1.db tag1 /dst/mds1/file1.db tag2 /dst/mds1/file1.db tag3 /dst/mds1/file1.db tag4
fsppadm(1M), fsppmk(1M)
VxFS 7.4 | fstag(1M) |