HolidayBuyer's Guide

Linux forum

General discussion

/usr/bin

by chuckieu / October 9, 2004 12:49 AM PDT

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
You are posting a reply to: /usr/bin
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: /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
by lilsim89 / October 9, 2004 1:46 AM PDT
In reply to: /usr/bin

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

Collapse -
Re: /usr/bin
by R. Proffitt Forum moderator / October 9, 2004 1:46 AM PDT
In reply to: /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

Bob

Collapse -
Re: /usr/bin
by David Utidjian / October 10, 2004 1:11 AM PDT
In reply to: /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:

'/usr/bin/'
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:

/etc/[Tab][Tab]
and
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.

-DU-...etc...

Collapse -
Re: /usr/bin
by chuckieu / October 10, 2004 2:45 AM PDT
In reply to: 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
by chuckieu / October 11, 2004 4:37 AM PDT
In reply to: 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
by dlgehrt / October 11, 2004 2:54 PM PDT
In reply to: /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.

Popular Forums
icon
Computer Newbies 10,686 discussions
icon
Computer Help 54,365 discussions
icon
Laptops 21,181 discussions
icon
Networking & Wireless 16,313 discussions
icon
Phones 17,137 discussions
icon
Security 31,287 discussions
icon
TVs & Home Theaters 22,101 discussions
icon
Windows 7 8,164 discussions
icon
Windows 10 2,657 discussions

HOLIDAY GIFT GUIDE 2017

Cameras that make great holiday gifts

Let them start the new year with a step up in photo and video quality from a phone.