XATTR(1) General Commands Manual XATTR(1)NAME
xattr - sets or lists extended attributes on a file or directory
SYNOPSIS
xattr [ -lz ] filename [ filename ... ]
xattr -p [ -lz ] attr_name filename [ filename ... ]
xattr -w [ -z ] attr_name attr_value filename [ filename ... ]
xattr -d attr_name filename [ filename ... ]
DESCRIPTION
This manual page documents briefly the xattr command.
The first form lists the names of all xattrs on the given file(s).
The second form (-p) prints the value of the xattr attr_name.
The third form (-w) sets the value of the xattr attr_name to attr_value.
The fourth form (-d) deletes the xattr attr_name.
OPTIONS
A summary of options is included below.
-h Show summary of options.
-l Print long format (attr_name: attr_value) when listing xattrs.
-z Compress or decompress (if compressed) attribute value in zip format).
SEE ALSO
The Python module "xattr"
AUTHOR
xattr was written by Bob Ippolito <bob@redivi.com>.
This manual page was written by Federico Ceratto, for the Debian project (and may be used by others).
May 8, 2010 XATTR(1)
Check Out this Related Man Page
XATTR_GET(3) 1 XATTR_GET(3)xattr_get - Get an extended attributeSYNOPSIS
string xattr_get (string $filename, string $name, [int $flags])
DESCRIPTION
This function gets the value of an extended attribute of a file.
Extended attributes have two different namespaces: user and root. The user namespace is available to all users, while the root namespace is
available only to users with root privileges. xattr operates on the user namespace by default, but this can be changed with the $flags
parameter.
PARAMETERS
o $filename
- The file from which we get the attribute.
o $name
- The name of the attribute.
o $flags
-
Supported xattr flags
+-----------------+---------------------------------------------------+
| | |
|XATTR_DONTFOLLOW | |
| | |
| | Do not follow the symbolic link but operate on |
| | symbolic link itself. |
| | |
| | |
| XATTR_ROOT | |
| | |
| | Set attribute in root (trusted) namespace. |
| | Requires root privileges. |
| | |
+-----------------+---------------------------------------------------+
RETURN VALUES
Returns a string containing the value or FALSE if the attribute doesn't exist.
EXAMPLES
Example #1
Checks if system administrator has signed the file
<?php
$file = '/usr/local/sbin/some_binary';
$signature = xattr_get($file, 'Root signature', XATTR_ROOT);
/* ... check if $signature is valid ... */
?>
SEE ALSO xattr_list(3), xattr_set(3), xattr_remove(3).
PHP Documentation Group XATTR_GET(3)
:confused:
Bad if test:
if
returns an error
I have changed filename to
"filename"s su
"$filename"
'filename''
'$filename''
"./filename"
"./$filename"
error is usually
why cant I test the filename?
Thanks (4 Replies)
Hi,
I have a requirement that i need to store only the filename without its extension. Can anyone please help me to do this.
For Example, i have stored the filename in a varialble called fname. I need to extract all the charecters before the first occurence of the dot.
If fname has value... (3 Replies)
I have a script which includes an FTP. The filename is too long for my target area. The filename is HD012_ABCD_EFGH_061004_F_300_40. I need to the filename to be HD012_ABCD_EFGH_061004_F_. Any ideas. (5 Replies)
Hi everyone,
How to compare between two filenames, in case the current filename is the same as the last one an alarm to be sent, in case the current filename is different from the last filename, no alarm to be sent.
Is there a way to do this?
Thanks in advance. (4 Replies)
Hi all,
Can any one explain me what the below 'if' statement checking for?
if ; then
do something
fi
Iam aware of the remaining options like -z, -r, -w, -x etc., with 'if' statement, but I dont know about '-s' :confused:.
Thanks in advance,
Mysore 101 Ganapati. (4 Replies)
Hello ,
I am searching a directory for a file and have to assign the filename to a variable .
The variable must have form $$filename
So my code is
echo "'$$filename='`ls -lrt *PreMatch*.csv| head -1 | nawk '{print $9}'`"
however $$ is converting to a number .
How could I make it $$... (3 Replies)