Version: 2008
Advanced Search
advertisement
advertisement
mySimon mySimon mySimon Outdoor Gear mySimon Swimwear mySimon Home and Garden

Forum display:

Linux: /usr/bin

by chuckieu - 10/9/04 7:49 AM
advertisement
Post 1 of 7

/usr/bin

by chuckieu - 10/9/04 7:49 AM

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

Post 2 of 7

Re: /usr/bin

by lilsim89 - 10/9/04 8:46 AM In reply to: /usr/bin by chuckieu

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

Post 3 of 7

Re: /usr/bin

by R. Proffitt Moderator - 10/9/04 8:46 AM In reply to: /usr/bin by chuckieu

"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

Post 4 of 7

Re: /usr/bin

by David Utidjian - 10/10/04 8:11 AM In reply to: /usr/bin by chuckieu

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...

Post 5 of 7

Re: /usr/bin

by chuckieu - 10/10/04 9:45 AM In reply to: Re: /usr/bin by David Utidjian

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

Post 6 of 7

Re: /usr/bin

by chuckieu - 10/11/04 11:37 AM In reply to: Re: /usr/bin by chuckieu

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

Post 7 of 7

Re: /usr/bin

by dlgehrt - 10/11/04 9:54 PM In reply to: /usr/bin by chuckieu

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.

Forum legend:
Locked Locked thread
Moderator Moderator
CNET staff CNET staff
Samsung staff Samsung staff
Norton Authorized Support team Norton Authorized Support team
AVG staff AVG staff
Windows Outreach team Windows Outreach team
Dell staff Dell staff
Intel staff Intel staff
Powered by Jive Software