From: TJ Luoma <me@tj.luo.ma>
To: zsh-users@zsh.org
Subject: Re: How to find owner of file or folder?
Date: Mon, 27 Feb 2012 13:18:45 -0500 [thread overview]
Message-ID: <CAFDsEuO8utdhQSKk5PuwGWYYDWA6aoB2cu2fmDhxN2kXdm05iQ@mail.gmail.com> (raw)
In-Reply-To: <20120227173749.36fa1d79@pwslap01u.europe.root.pri>
Excellent! I knew there had to be a better way. Thanks, Peter.
Here's a little script I wrote up which will show the owner if just
one argument is given, or will shown the owner and filename if more
than one argument is given:
#!/bin/zsh
zmodload -F zsh/stat b:zstat
# if there's just one argument given, show the owner and exit
if [ "$#" = "1" ]
then
zstat -s +uid "$@"
exit
fi
# otherwise, loop through and shown the owner for each file which exists
for F in $@
do
[[ -e "$F" ]] || continue
echo -n "$F: "
zstat -s +uid "$F"
done
prev parent reply other threads:[~2012-02-27 18:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-27 16:55 TJ Luoma
2012-02-27 17:31 ` Dan Nelson
2012-02-27 18:30 ` TJ Luoma
2012-02-27 18:38 ` Dan Nelson
2012-02-27 19:55 ` TJ Luoma
2012-02-27 17:35 ` Danek Duvall
2012-02-27 17:37 ` Peter Stephenson
2012-02-27 18:18 ` TJ Luoma [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFDsEuO8utdhQSKk5PuwGWYYDWA6aoB2cu2fmDhxN2kXdm05iQ@mail.gmail.com \
--to=me@tj.luo.ma \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).