General discussion


I am having an odd problem. May be something I knew and forgot. I have a need to veiw my bin commands. Simple. Except that when I use the normal "ls /usr/bin" I get a listing in single file, making the first half of the list hidden. I have found no other directory that does this. Don't currently have a printer, so that is not an option. Any ideas to getting it to use whole terminal instead of single-filing? Am using MDK10. TIA chuck

Discussion is locked
Reply to: /usr/bin
PLEASE NOTE: Do not post advertisements, offensive materials, profanity, or personal attacks. Please remember to be considerate of other members. If you are new to the CNET Forums, please read our CNET Forums FAQ. All submitted content is subject to our Terms of Use.
Reporting: /usr/bin
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
- Collapse -
Re: /usr/bin

Why don't you just open the folder and take a peek.

- Collapse -
Re: /usr/bin

"when I use the normal "ls /usr/bin" I get a listing in single file, making the first half of the list hidden."

I found that ls can do this if some-really-long-name-file is in that directory. It won't do columns and you get the effect you wrote about. In the meantime try...

ls | more


- Collapse -
Re: /usr/bin

As has been said it usually happens because there is a long file name or dir name in /usr/bin so that the default multi-column view is forced to single column.
/usr/bin also tends to have a huge number of files in it. On my system (FC2) I currently have 2710 files in /usr/bin. With a simple 'ls' on that folder it will still produce 10+ screens of listing even with the terminal window maximized so that I get 4 columns.

There are several ways around this:

'ls /usr/bin/ | less'
you will get a single column listing that is searchable and pageable. Type '/string' to search forward for 'string', type '/' to repeat last forward search, type 'q' to quit. You can also add the '-x' option if you want to get more than one column when the output is piped through 'less'.

Another option is to simply use automatic filename completion. This is a standard feature in the bash shell and is configured correctly on most versions of Linux I have ever used. Simply type:

Then press the [Tab] key a couple of times. You should see something like this:

[utidjian@cobalt utidjian]$ /usr/bin/
Display all 2710 possibilities? (y or n)

Then press 'Y' to get a multicolumn (depending on terminal and filename size) view of the contents of /usr/bin that is automagically piped through 'more'. Press the spacebar to page, 'q' to quit. Another nice feature of Tab completion is, say, you wanted to list all the commands that begin with 'k' (or whatever). Just type '/usr/bin/k' and press the [Tab] key twice. On my system I get:

[utidjian@cobalt utidjian]$ /usr/bin/k
Display all 217 possibilities? (y or n)

Press 'y' and you will get all possible completions that begin with 'k'.

Note: This feature of Tab completion works this way because the all files in /usr/bin/ are executable (or should be). Compare to the commands:

ls /etc/

For more Tab completion silliness try just pressing [Tab][Tab] at a blank prompt. You will get all possible completions... which is all possible commands in your path.


- Collapse -
Re: /usr/bin

Thanks, everyone. Will try suggestions(although I have no doubt all will do what I need). I do remember Bob's solution(now) from the Red Hat 9 Bible I no longer have. In Windows now, but "manana". chuck

- Collapse -
Re: /usr/bin

Played with different ones. Got what I needed and David's info for future reference. Thats why I have change to a new downloads and info CD. Save good old ones to HDD and reburn. Incidently, I had 2056 in Mandrake 10. Thanks,
again. chuck

- Collapse -
Re: /usr/bin

You have two choices: On most VTs <shift> PgUP will scroll back to the missing lines or use the command string: ls /usr/bin | less

Hpe this helps.

CNET Forums