Re: [PLUG] Print list of folders

2015-12-12 Thread Pete Lancashire
oh what the heck, off to the printer, how wide is the fixed font output on
your printer, if it support postscript take a look at enscript, just like
find is has a zillon options

have a dumb printer ?

take the above and  ...| column -c 
| lpr -P 



On Sat, Dec 12, 2015 at 10:47 AM, Pete Lancashire 
wrote:

> I forgot (still having my morning caffine) I forgot to have find strip off
> the starting directory
>
>
> so onto the printf options, another one with a zillon options
>
> the entity you only want is the 'filename'  (I didn't write the man page),
> what they really mean
> is 'what entity find finds'.
>
> In this case you want to print out '%f' and and newline
>
> so the corrected command is
>
> find /usr -maxdepth 1 -mindepth 1 -type d -printf '%f\n'
>
> oh 
>
>
> >   Yet, 'ls -d */' is simpler still for listing all directories in the 
> > current
> directory.
>
> The problem with this is it adds a trailing slash to the name of the
> directory, if one wants to
> do something with the output you'll need to get rid of the slash
>
>
>
> On Sat, Dec 12, 2015 at 10:31 AM, Pete Lancashire  > wrote:
>
>> Want: I wish to print a list of directories (but not the files or 
>> subdirectories
>> contained in the directories)
>>
>> The short answer
>>
>> find   -mindepth 1 -maxdepth 1
>> -type d
>>
>>
>> the find program is your friend, but one you will love and hate at the
>> same time, even I have to still do
>> a man or info find.
>>
>> find  [] [> options>]
>>
>> Your first requirement 'only directories' is handled by the option -type
>> , in your case object
>> type is d for directory
>>
>> Let use /usr as the starting point
>>
>> find /usr -type d
>>
>> This will output all directories under /usr and /usr it self since it is
>> a directory
>>
>> Next you only want the directories under your starting point, find calls
>> this depth, but it is not the
>> depth option you want (see find can be hard to get to like at times)
>>
>> the option you want is maxdepth, in your case you want a maximum depth of
>> 1.
>>
>> find /usr -maxdepth 1 -type d
>>
>> Note the maxdepth is before the type, I'll leave it up you to find out why
>>
>> You said only the directories under the one your interested in, so you
>> will need to use mindepth as well.
>>
>> so ...
>>
>> find /usr -mindepth 1 -maxdepth 1 -type d
>>
>> Hope this is what you are looking for 
>>
>> -pete
>>
>>
>> On Sat, Dec 12, 2015 at 10:08 AM, John Jason Jordan 
>> wrote:
>>
>>> Thanks for the additional suggestions - so many options! However, the
>>> initial suggestion to send the output of ls to a simple text file did
>>> the job. The only thing that might have made it a bit more elegant
>>> would have been to concatenate another command to send the text file to
>>> the printer with lpr. But it was just about as fast for me to double
>>> click on the text file, which opened it in Gedit, and then Ctrl-p to
>>> open the print dialog box.
>>>
>>> This was a one-off situation which I will likely never need to do
>>> again.
>>> ___
>>> PLUG mailing list
>>> PLUG@lists.pdxlinux.org
>>> http://lists.pdxlinux.org/mailman/listinfo/plug
>>>
>>
>>
>
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] Print list of folders

2015-12-12 Thread Pete Lancashire
I forgot (still having my morning caffine) I forgot to have find strip off
the starting directory


so onto the printf options, another one with a zillon options

the entity you only want is the 'filename'  (I didn't write the man page),
what they really mean
is 'what entity find finds'.

In this case you want to print out '%f' and and newline

so the corrected command is

find /usr -maxdepth 1 -mindepth 1 -type d -printf '%f\n'

oh 


>   Yet, 'ls -d */' is simpler still for listing all directories in the current
directory.

The problem with this is it adds a trailing slash to the name of the
directory, if one wants to
do something with the output you'll need to get rid of the slash



On Sat, Dec 12, 2015 at 10:31 AM, Pete Lancashire 
wrote:

> Want: I wish to print a list of directories (but not the files or 
> subdirectories
> contained in the directories)
>
> The short answer
>
> find   -mindepth 1 -maxdepth 1
> -type d
>
>
> the find program is your friend, but one you will love and hate at the
> same time, even I have to still do
> a man or info find.
>
> find  [] [ options>]
>
> Your first requirement 'only directories' is handled by the option -type
> , in your case object
> type is d for directory
>
> Let use /usr as the starting point
>
> find /usr -type d
>
> This will output all directories under /usr and /usr it self since it is a
> directory
>
> Next you only want the directories under your starting point, find calls
> this depth, but it is not the
> depth option you want (see find can be hard to get to like at times)
>
> the option you want is maxdepth, in your case you want a maximum depth of
> 1.
>
> find /usr -maxdepth 1 -type d
>
> Note the maxdepth is before the type, I'll leave it up you to find out why
>
> You said only the directories under the one your interested in, so you
> will need to use mindepth as well.
>
> so ...
>
> find /usr -mindepth 1 -maxdepth 1 -type d
>
> Hope this is what you are looking for 
>
> -pete
>
>
> On Sat, Dec 12, 2015 at 10:08 AM, John Jason Jordan 
> wrote:
>
>> Thanks for the additional suggestions - so many options! However, the
>> initial suggestion to send the output of ls to a simple text file did
>> the job. The only thing that might have made it a bit more elegant
>> would have been to concatenate another command to send the text file to
>> the printer with lpr. But it was just about as fast for me to double
>> click on the text file, which opened it in Gedit, and then Ctrl-p to
>> open the print dialog box.
>>
>> This was a one-off situation which I will likely never need to do
>> again.
>> ___
>> PLUG mailing list
>> PLUG@lists.pdxlinux.org
>> http://lists.pdxlinux.org/mailman/listinfo/plug
>>
>
>
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] Print list of folders

2015-12-12 Thread Pete Lancashire
Want: I wish to print a list of directories (but not the files or
subdirectories
contained in the directories)

The short answer

find   -mindepth 1 -maxdepth 1
-type d


the find program is your friend, but one you will love and hate at the same
time, even I have to still do
a man or info find.

find  [] []

Your first requirement 'only directories' is handled by the option -type
, in your case object
type is d for directory

Let use /usr as the starting point

find /usr -type d

This will output all directories under /usr and /usr it self since it is a
directory

Next you only want the directories under your starting point, find calls
this depth, but it is not the
depth option you want (see find can be hard to get to like at times)

the option you want is maxdepth, in your case you want a maximum depth of 1.

find /usr -maxdepth 1 -type d

Note the maxdepth is before the type, I'll leave it up you to find out why

You said only the directories under the one your interested in, so you will
need to use mindepth as well.

so ...

find /usr -mindepth 1 -maxdepth 1 -type d

Hope this is what you are looking for 

-pete


On Sat, Dec 12, 2015 at 10:08 AM, John Jason Jordan 
wrote:

> Thanks for the additional suggestions - so many options! However, the
> initial suggestion to send the output of ls to a simple text file did
> the job. The only thing that might have made it a bit more elegant
> would have been to concatenate another command to send the text file to
> the printer with lpr. But it was just about as fast for me to double
> click on the text file, which opened it in Gedit, and then Ctrl-p to
> open the print dialog box.
>
> This was a one-off situation which I will likely never need to do
> again.
> ___
> PLUG mailing list
> PLUG@lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] Print list of folders

2015-12-12 Thread Roderick Anderson


On 12/12/2015 10:08 AM, John Jason Jordan wrote:
> Thanks for the additional suggestions - so many options! However, the
> initial suggestion to send the output of ls to a simple text file did
> the job. The only thing that might have made it a bit more elegant
> would have been to concatenate another command to send the text file to
> the printer with lpr. But it was just about as fast for me to double
> click on the text file, which opened it in Gedit, and then Ctrl-p to
> open the print dialog box.
>
> This was a one-off situation which I will likely never need to do
> again.

Famous last words. Been there done that said the same. ;-)


Rod
-- 
> ___
> PLUG mailing list
> PLUG@lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] Print list of folders

2015-12-12 Thread John Jason Jordan
Thanks for the additional suggestions - so many options! However, the
initial suggestion to send the output of ls to a simple text file did
the job. The only thing that might have made it a bit more elegant
would have been to concatenate another command to send the text file to
the printer with lpr. But it was just about as fast for me to double
click on the text file, which opened it in Gedit, and then Ctrl-p to
open the print dialog box. 

This was a one-off situation which I will likely never need to do
again. 
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] Print list of folders

2015-12-12 Thread Michael Rasmussen
On Sat, Dec 12, 2015 at 06:00:38AM -0800, Russell Senior wrote:
> > "John" == John Jason Jordan  writes:
> 
> John> I wish to print a list of directories (but not the files or
> John> subdirectories contained in the directories) on Xubuntu 12.04 (up
> John> to date). I normally use the GUI file manager Thunar, but it has
> John> no menu item to print anything. There is, however, Edit >
> John> Configure custom actions, which appears to require me to use
> John> xfprint with specific options, but I haven't found much
> John> information about using xfprint.
> 
> John> I suspect this might be easier from the command line, but I don't
> John> know where to start looking for the right tool. That is, I have
> John> used lpr in the past and I have a fair idea of what the available
> John> options are, but lpr seems to be useful only for printing the
> John> contents of a file, not for printing a list of folders.
> 
> How about:
> 
>   du | cut -f 2-
> 
> The du utility descends a directory tree and tells you how many 1k
> blocks are stored in each subtree (or something like that), giving you a
> rough idea of where your diskspace is going.  The "cut -f 2-" part just
> throws the disk usage information away.
 
for the directories in the current directory with disk space used in 
nice human format:

du -sh */

optionally to sort it by the amount of space used

su -sh */ | sort -h

Which from my laptop's home directory gives output like

michael@bivy ~ % du -sh */ | sort -n | head
1.1GDropbox/
1.1Gphotos/
1.2GCloud/
1.2GLanguage/
1.4GVideos/
[bunch of stuff snipped]
940KTravel/
986Mdroid/
997MPhone/

Sort with -hr to make it smallest to biggest.

-- 
  Michael Rasmussen, Portland Oregon  
Be Appropriate && Follow Your Curiosity
If you want to build a ship, 
  don't drum up people to collect wood and 
  don't assign them tasks and work, but rather 
teach them to long for the endless immensity of the sea." 

~ Antoine de Saint Exupéry
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] Print list of folders

2015-12-12 Thread Bill Morita
There is an option to show only directories


-- Bill Morita
512-569-6387 (Cell)

On Sat, Dec 12, 2015 at 7:58 AM, Rich Shepard 
wrote:

> On Sat, 12 Dec 2015, Bill Morita wrote:
>
> > What about using "tree" ?
>
> Bill,
>
>According to the man page it produces a list as a tree of all
> directories
> and the files in each. John want(ed|s) to list only subdirectories under
> the
> current working directory.
>
>Thanks for making me aware of tree. I had not known of it before and I
> can
> see its usefullness.
>
> Rich
> ___
> PLUG mailing list
> PLUG@lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] Print list of folders

2015-12-12 Thread Russell Senior
> "John" == John Jason Jordan  writes:

John> I wish to print a list of directories (but not the files or
John> subdirectories contained in the directories) on Xubuntu 12.04 (up
John> to date). I normally use the GUI file manager Thunar, but it has
John> no menu item to print anything. There is, however, Edit >
John> Configure custom actions, which appears to require me to use
John> xfprint with specific options, but I haven't found much
John> information about using xfprint.

John> I suspect this might be easier from the command line, but I don't
John> know where to start looking for the right tool. That is, I have
John> used lpr in the past and I have a fair idea of what the available
John> options are, but lpr seems to be useful only for printing the
John> contents of a file, not for printing a list of folders.

How about:

  du | cut -f 2-

The du utility descends a directory tree and tells you how many 1k
blocks are stored in each subtree (or something like that), giving you a
rough idea of where your diskspace is going.  The "cut -f 2-" part just
throws the disk usage information away.


-- 
Russell Senior, President
russ...@personaltelco.net
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] Print list of folders

2015-12-12 Thread Rich Shepard
On Sat, 12 Dec 2015, Bill Morita wrote:

> What about using "tree" ?

Bill,

   According to the man page it produces a list as a tree of all directories
and the files in each. John want(ed|s) to list only subdirectories under the
current working directory.

   Thanks for making me aware of tree. I had not known of it before and I can
see its usefullness.

Rich
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] Print list of folders

2015-12-12 Thread Bill Morita
What about using "tree" ?

-- Bill Morita
512-569-6387 (Cell)

On Sat, Dec 12, 2015 at 1:47 AM, Steve Dum  wrote:

> John,
> Here is something that might get you what you want
> Say you want to list all directories under directory foo
> find foo -type d
> this just print the names of the directories
> If you want something similar to what 'ls -l' would say,
> find foo -type d -ls
> The out of this is like the following
>
> 979148404 drwxr-xr-x   2 steved   steved   4096 Nov 30 23:45 foo
>
> with find you can't customize the output.
> ls allows you more choices about what to display but would be hard to
> just do directories.
> find foo -type d -exec ls -ld  {} \;
> would give you just the directories, using the ls long format.
>
> You could just pipe the output into lpr, or redirect output to a file
> and then print it.
>
> steve
>
> John Jason Jordan wrote:
> > I wish to print a list of directories (but not the files or
> > subdirectories contained in the directories) on Xubuntu 12.04 (up to
> > date). I normally use the GUI file manager Thunar, but it has no menu
> > item to print anything. There is, however, Edit > Configure custom
> > actions, which appears to require me to use xfprint with specific
> > options, but I haven't found much information about using xfprint.
> >
> > I suspect this might be easier from the command line, but I don't know
> > where to start looking for the right tool. That is, I have used lpr in
> > the past and I have a fair idea of what the available options are, but
> > lpr seems to be useful only for printing the contents of a file, not
> > for printing a list of folders.
> >
> > Suggestions?
> > ___
> > PLUG mailing list
> > PLUG@lists.pdxlinux.org
> > http://lists.pdxlinux.org/mailman/listinfo/plug
> >
>
> ___
> PLUG mailing list
> PLUG@lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] Print list of folders

2015-12-12 Thread Rich Shepard
On Fri, 11 Dec 2015, Steve Dum wrote:

> Here is something that might get you what you want
> Say you want to list all directories under directory foo
>find foo -type d

   Yet, 'ls -d */' is simpler still for listing all directories in the
current directory.

Rich
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] Print list of folders

2015-12-11 Thread Steve Dum
John,
Here is something that might get you what you want
Say you want to list all directories under directory foo
find foo -type d
this just print the names of the directories
If you want something similar to what 'ls -l' would say,
find foo -type d -ls
The out of this is like the following

979148404 drwxr-xr-x   2 steved   steved   4096 Nov 30 23:45 foo

with find you can't customize the output.
ls allows you more choices about what to display but would be hard to 
just do directories.
find foo -type d -exec ls -ld  {} \;
would give you just the directories, using the ls long format.

You could just pipe the output into lpr, or redirect output to a file 
and then print it.

steve

John Jason Jordan wrote:
> I wish to print a list of directories (but not the files or
> subdirectories contained in the directories) on Xubuntu 12.04 (up to
> date). I normally use the GUI file manager Thunar, but it has no menu
> item to print anything. There is, however, Edit > Configure custom
> actions, which appears to require me to use xfprint with specific
> options, but I haven't found much information about using xfprint.
>
> I suspect this might be easier from the command line, but I don't know
> where to start looking for the right tool. That is, I have used lpr in
> the past and I have a fair idea of what the available options are, but
> lpr seems to be useful only for printing the contents of a file, not
> for printing a list of folders.
>
> Suggestions?
> ___
> PLUG mailing list
> PLUG@lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>

___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] Print list of folders

2015-11-28 Thread John Jason Jordan
On Sat, 28 Nov 2015 10:30:40 -0800
Dick Steffens  dijo:

>ls is the command line tool. There are, as usual, many options to use 
>with ls. (See man ls.) When I need to do something like this, which is 
>rare, I use ls -1 to get everything in the directory listed one item
>per line, and redirect it into a text file. Then I can edit the text
>file to remove what I don't want, or just print it.
>
>Example:
>
>$ ls -1 > list.txt

Perfect!
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] Print list of folders

2015-11-28 Thread Rich Shepard
On Sat, 28 Nov 2015, John Jason Jordan wrote:

> Suggestions?

John,

   'ls -d */' lists all directories under the current directory. You can then
pipe the output to lpr and send the output to the printer of your choice
using the -P option to lpr.

   Example: ls -d */ | lpr

HTH,

Rich
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] Print list of folders

2015-11-28 Thread Dick Steffens
On 11/28/2015 10:19 AM, John Jason Jordan wrote:
> I wish to print a list of directories (but not the files or
> subdirectories contained in the directories) on Xubuntu 12.04 (up to
> date). I normally use the GUI file manager Thunar, but it has no menu
> item to print anything. There is, however, Edit > Configure custom
> actions, which appears to require me to use xfprint with specific
> options, but I haven't found much information about using xfprint.
>
> I suspect this might be easier from the command line, but I don't know
> where to start looking for the right tool. That is, I have used lpr in
> the past and I have a fair idea of what the available options are, but
> lpr seems to be useful only for printing the contents of a file, not
> for printing a list of folders.
>
> Suggestions?

ls is the command line tool. There are, as usual, many options to use 
with ls. (See man ls.) When I need to do something like this, which is 
rare, I use ls -1 to get everything in the directory listed one item per 
line, and redirect it into a text file. Then I can edit the text file to 
remove what I don't want, or just print it.

Example:

$ ls -1 > list.txt


-- 
Regards,

Dick Steffens

___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug