[TriLUG] Slightly off topic
Dewey Hylton
plug at hyltown.com
Sat Dec 6 00:31:46 EST 2014
ls -l /somedir/ | awk '/^-r/ { print $9 }'
----- Original Message -----
> From: "Ken MacKenzie" <ken at mack-z.com>
> To: "Triangle Linux Users Group General Discussion" <trilug at trilug.org>
> Sent: Friday, December 5, 2014 7:11:39 PM
> Subject: [TriLUG] Slightly off topic
>
> This is probably off topic as the intended target for this command is
> Sun/Solaris
>
> Anyway I need a single liner that will output files for me similar to ls -1
> (note that is a numebr 1 not an l)
>
> I need it to only list "true" files as in no links and no directories and
> obviously not recurse down those.
>
> Also it needs to spit out a file name not a full path
>
> I debated using ls -1p and using grep to leave off the entries that had a
> trailing / but that does not handle the links.
>
> I messed with find as an option with something like this
>
> find somepath -name "somesearchstring" -o -type d -prune
>
> That worked for removing directories but before I tried removing links as
> well I noticed the output spit out the full path.
>
> I figured I would hit this list as you guys tend to be quick on the draw
> and I would like to wrap up my work evening having this command sorted
> out. Even though I am aware it is a Friday night.
>
> Ken
> --
> This message was sent to: Dewey Hylton <plug at hyltown.com>
> To unsubscribe, send a blank message to trilug-leave at trilug.org from that
> address.
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web :
> http://www.trilug.org/mailman/options/trilug/plug%40hyltown.com
> Welcome to TriLUG: http://trilug.org/welcome
More information about the TriLUG
mailing list