[TriLUG] Slightly off topic

Ken MacKenzie ken at mack-z.com
Fri Dec 5 19:11:39 EST 2014


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


More information about the TriLUG mailing list