[TriLUG] Slightly off topic

William Sutton william at trilug.org
Fri Dec 5 19:14:54 EST 2014


I don't suppose that

find somedirectory -type f -maxdepth 1

would do the job?

William Sutton

On Fri, 5 Dec 2014, Ken MacKenzie wrote:

> 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: William <william at trilug.org>
> 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/william%40trilug.org
> Welcome to TriLUG: http://trilug.org/welcome


More information about the TriLUG mailing list