Sponsored Content
Operating Systems HP-UX How to list file size on HPUX? Post 302827309 by rbatte1 on Friday 28th of June 2013 11:52:47 AM
Old 06-28-2013
Would you consider:-
Code:
ls -l file|read perms links owner group size rest
echo $size

This may run faster for larger files as ls reads the directory, where wc will actually read the whole file.



I hope that this helps.
Robin
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

List File size

Hello all, I have a directory filling up. I need to determine the size of the files in the directory. How do I do that, what command should I run when I am in the directory? Next question, can I expand the partition size? (10 Replies)
Discussion started by: komputersman
10 Replies

2. HP-UX

command to list file size

I'm new to HP-UX and am looking for the command that will allow to me determine the total size of listed files. I'm being told that my backup selection is exceeding my tape drive size and need to determine how much information is being backed up. Help? (3 Replies)
Discussion started by: rgordon
3 Replies

3. UNIX for Dummies Questions & Answers

Total file size of a subset list

Hello! I'm trying to find out the total file size of a subset list in a directory. For example, I do not need to know the total file size of all the files in a directory, but I need to know what the total size is of say, "ls -l *FEB08*" in a directory. Is there any easy way of doing this? ... (3 Replies)
Discussion started by: tekster757
3 Replies

4. UNIX for Dummies Questions & Answers

How to list a file size, but not its name?

If I have a file x.txt that is 8 bytes... I want to enter >> x.txt 8 I've played around with ls, and du... and they always list the file name. (2 Replies)
Discussion started by: ordano
2 Replies

5. UNIX for Dummies Questions & Answers

Sort by size, then list file in each directory

Hi, I have directories with name like: aaa bbb ccc ... I would like to to see which directories are the largest and then list the files within each. I have success using: du -ks * | sort -rin | head -n 20 which gives me an output like: 120 bbb 27 ccc 3 aaa ... I would like... (3 Replies)
Discussion started by: ChatPerdu
3 Replies

6. Shell Programming and Scripting

want to add the size of the selected list of file

i have a files in the dir as below. ls -lR ./.snapshot 5649600512 ./.snapshot/backup/data20080707 6006923264 ./.snapshot/backup/data20080708 5321129984 ./.snapshot/backup/data20080709 6686597120 ./.snapshot/backup/data20080710 7312855040 ... (4 Replies)
Discussion started by: mail2sant
4 Replies

7. UNIX for Advanced & Expert Users

How to set block size for CPIO in HPUX

Hi, One of our internal tool runs cpio command to archive certain files, but I receive an error as follows. CPIO Failure (operation would block) When i debugged, i assume that this an error due to block size.. My question are, How to find the block size in HP-UX?? How to set... (1 Reply)
Discussion started by: vj8436
1 Replies

8. UNIX for Dummies Questions & Answers

Determining file size for a list of files with paths

Hello, I have a flat file with a list of files with the path to the file and I am attempting to calculate the filesize for each one; however xargs isn't playing nicely and I am sure there is probably a better way of doing this. What I envisioned is this: cat filename|xargs -i ls -l {} |awk... (4 Replies)
Discussion started by: joe8mofo
4 Replies

9. Shell Programming and Scripting

Need to get the list of file with size in AUX

to get the list of file name with size Example: rwxrwxrwx 1 cm x 562KB Nov 6 19:22 a rwxrwxrwx 1 cm x 562MB Nov 6 19:22 a edit by bakunin: Please view this code tag video for how to use code tags when posting code and data. (5 Replies)
Discussion started by: Jewel
5 Replies

10. HP-UX

List of file name with size

how to get the file name list with size descriptive in hp-ux Required output: permission link user group size(with MB,KB,GB etc) date time name (7 Replies)
Discussion started by: Jewel
7 Replies
setfacl(1)							   User Commands							setfacl(1)

NAME
setfacl - modify the Access Control List (ACL) for a file or files SYNOPSIS
setfacl [-r] -s acl_entries file setfacl [-r] -md acl_entries file setfacl [-r] -f acl_file file DESCRIPTION
For each file specified, setfacl will either replace its entire ACL, including the default ACL on a directory, or it will add, modify, or delete one or more ACL entries, including default entries on directories. When the setfacl command is used, it may result in changes to the file permission bits. When the user ACL entry for the file owner is changed, the file owner class permission bits will be modified. When the group ACL entry for the file group class is changed, the file group class permission bits will be modified. When the other ACL entry is changed, the file other class permission bits will be modified. If you use the chmod(1) command to change the file group owner permissions on a file with ACL entries, both the file group owner permis- sions and the ACL mask are changed to the new permissions. Be aware that the new ACL mask permissions may change the effective permissions for additional users and groups who have ACL entries on the file. A directory may contain default ACL entries. If a file or directory is created in a directory that contains default ACL entries, the newly created file will have permissions generated according to the intersection of the default ACL entries and the permissions requested at creation time. The umask(1) will not be applied if the directory contains default ACL entries. If a default ACL is specified for a specific user (or users), the file will have a regular ACL created. Otherwise, only the mode bits will be initialized according to the intersection described above. The default ACL should be thought of as the maximum discretionary access permissions that may be granted. acl_entries Syntax For the -m and -s options, acl_entries are one or more comma-separated ACL entries. An ACL entry consists of the following fields separated by colons: entry_type Type of ACL entry on which to set file permissions. For example, entry_type can be user (the owner of a file) or mask (the ACL mask). uid or gid User name or user identification number. Or, group name or group identification number. perms Represents the permissions that are set on entry_type. perms can be indicated by the symbolic characters rwx or a number (the same permissions numbers used with the chmod command). The following table shows the valid ACL entries (default entries may only be specified for directories): ACL Entry Description u[ser]::perms File owner permissions. g[roup]::perms File group owner permissions. o[ther]:perms Permissions for users other than the file owner or members of file group owner. m[ask]:perms The ACL mask. The mask entry indi- cates the maximum permissions allowed for users (other than the owner) and for groups. The mask is a quick way to change permissions on all the users and groups. u[ser]:uid:perms Permissions for a specific user. For uid, you can specify either a user name or a numeric UID. g[roup]:gid:perms Permissions for a specific group. For gid, you can specify either a group name or a numeric GID. d[efault]:u[ser]::perms Default file owner permissions. d[efault]:g[roup]::perms Default file group owner permis- sions. d[efault]:o[ther]:perms Default permissions for users other than the file owner or members of the file group owner. d[efault]:m[ask]:perms Default ACL mask. d[efault]:u[ser]:uid:perms Default permissions for a specific user. For uid, you can specify either a user name or a numeric UID. d[efault]:g[roup]:gid:perms Default permissions for a specific group. For gid, you can specify either a group name or a numeric GID. For the -d option, acl_entries are one or more comma-separated ACL entries without permissions. Notice that the entries for file owner, file group owner, ACL mask, and others may not be deleted. OPTIONS
The options have the following meaning: -d acl_entries Deletes one or more entries from the file. The entries for the file owner, the file group owner, and others may not be deleted from the ACL. Notice that deleting an entry does not necessarily have the same effect as removing all permissions from the entry. -f acl_file Seta a file's ACL with the ACL entries contained in the file named acl_file. The same constraints on specified entries hold as with the -s option. The entries are not required to be in any specific order in the file. Also, if you specify a dash '-' for acl_file, standard input is used to set the file's ACL. The character "#" in acl_file may be used to indicate a comment. All characters, starting with the "#" until the end of the line, will be ignored. Notice that if the acl_file has been created as the output of the getfacl(1) command, any effective permissions, which will follow a "#", will be ignored. -m acl_entries Adds one or more new ACL entries to the file, and/or modifies one or more existing ACL entries on the file. If an entry already exists for a specified uid or gid, the specified permissions will replace the current permissions. If an entry does not exist for the specified uid or gid, an entry will be created. When using the -m option to modify a default ACL, you must specify a complete default ACL (user, group, other, mask, and any additional entries) the first time. -r Recalculates the permissions for the ACL mask entry. The permissions specified in the ACL mask entry are ignored and replaced by the maximum permissions necessary to grant the access to all additional user, file group owner, and additional group entries in the ACL. The permissions in the additional user, file group owner, and additional group entries are left unchanged. -s acl_entries Sets a file's ACL. All old ACL entries are removed and replaced with the newly specified ACL. The entries need not be in any specific order. They will be sorted by the command before being applied to the file. Required entries: o Exactly one user entry specified for the file owner. o Exactly one group entry for the file group owner. o Exactly one other entry specified. If there are additional user and group entries: o Exactly one mask entry specified for the ACL mask that indicates the maximum permissions allowed for users (other than the owner) and groups. o Must not be duplicate user entries with the same uid. o Must not be duplicate group entries with the same gid. If file is a directory, the following default ACL entries may be specified: o Exactly one default user entry for the file owner. o Exactly one default group entry for the file group owner. o Exactly one default mask entry for the ACL mask. o Exactly one default other entry. There may be additional default user entries and additional default group entries specified, but there may not be duplicate additional default user entries with the same uid, or duplicate default group entries with the same gid. EXAMPLES
Example 1: Adding read permission only The following example adds one ACL entry to file abc, which gives user shea read permission only. setfacl -m user:shea:r-- abc Example 2: Replacing a file's entire ACL The following example replaces the entire ACL for the file abc, which gives shea read access, the file owner all access, the file group owner read access only, the ACL mask read access only, and others no access. setfacl -s user:shea:rwx,user::rwx,group::rw-,mask:r--,other:--- abc Notice that after this command, the file permission bits are rwxr-----. Even though the file group owner was set with read/write permis- sions, the ACL mask entry limits it to have only read permission. The mask entry also specifies the maximum permissions available to all additional user and group ACL entries. Once again, even though the user shea was set with all access, the mask limits it to have only read permission. The ACL mask entry is a quick way to limit or open access to all the user and group entries in an ACL. For example, by chang- ing the mask entry to read/write, both the file group owner and user shea would be given read/write access. Example 3: Setting the same ACL on two files The following example sets the same ACL on file abc as the file xyz. getfacl xyz | setfacl -f - abc FILES
/etc/passwd password file /etc/group group file ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
chmod(1), getfacl(1), umask(1), aclcheck(3SEC), aclsort(3SEC), group(4), passwd(4), attributes(5) SunOS 5.10 31 Oct 2002 setfacl(1)
All times are GMT -4. The time now is 02:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy