Click to See Complete Forum and Search --> : "Less" lost, Larry livid....


Larry Rink
08-03-2003, 07:14 PM
When I try to use the command "less" this is the error message I always get:

]$ less
/usr/bin/less: Usage:: command not found
/usr/bin/less: line 2: syntax error near unexpected token `(t'
/usr/bin/less: line 2: `List information about the FILEs (the current directory by default).'


I tried to re-install less with RPMDRAKE, but I get an error message saying it is already installed. I thought about uninstalling it but WHOA!, it wants to uninstall a dozen other programs with it. Many of which looked VERY important to the system.

Any advice????

Thanks in advance...

Larry

Twisted
08-03-2003, 07:17 PM
if it is an RPM, can't you use the
rpm -e --nodeps

so it won't check for dependencies?

Larry Rink
08-03-2003, 08:19 PM
if it is an RPM, can't you use the
rpm -e --nodeps

so it won't check for dependencies?

Yes, yes I could... If I knew how.
See, I'm just tainted by the gui habit and have little
experience working at the command line. But I'll give it a try.


I'll do some reading on it first though : )


-Larry

Alex Cavnar, aka alc6379
08-05-2003, 01:47 AM
it looks like it's trying to pull in some garbage text as the input files to it or something.

does this just happen in your HOME directory, or does it happen everywhere in your system? Does it happen with other users, too?

Run these commands, and print the output of them here:

alias less
which less
type less

Larry Rink
08-05-2003, 08:09 PM
Run these commands, and print the output of them here:

alias less
which less
type less


[larry@LarryRink larry]$ alias less
bash: alias: `less' not found
[larry@LarryRink larry]$ which less
/usr/bin/less
[larry@LarryRink larry]$ type less
less is /usr/bin/less
[larry@LarryRink larry]$

Here's some more examples as user "root":

[root@LarryRink storage]# less
/usr/bin/less: Usage:: command not found
/usr/bin/less: line 2: syntax error near unexpected token `(t'
/usr/bin/less: line 2: `List information about the FILEs (the current directory by default).'
[root@LarryRink storage]#
[root@LarryRink storage]#
[root@LarryRink storage]# alias less
bash: alias: `less' not found
[root@LarryRink storage]# which less
/usr/bin/less
[root@LarryRink storage]# type less
less is hashed (/usr/bin/less)

Thanks to all for having a look!!
-Larry

kevinalm
08-05-2003, 10:34 PM
Your post seems to suggest that you are trying to call less without any input. ie.

less

This will do nothing.
The two ways I know of to use less:

Pipe another function into less, for example

ls | less

Call less with the file to be used as an argument

less thistextfile.txt

where thistextfile.txt is a file is the current directory. Alternately,

less /path/to/thistextfile.txt

Larry Rink
08-06-2003, 05:19 PM
[larry@LarryRink larry]$ ls|less
/usr/bin/less: Usage:: command not found
/usr/bin/less: line 2: syntax error near unexpected token `(t'
/usr/bin/less: line 2: `List information about the FILEs (the current directory by default).'
[larry@LarryRink larry]$ less test.txt
/usr/bin/less: Usage:: command not found
/usr/bin/less: line 2: syntax error near unexpected token `(t'
/usr/bin/less: line 2: `List information about the FILEs (the current directory by default).'
[larry@LarryRink larry]$

Same thing your way!

-Larry

brast
08-06-2003, 05:31 PM
was there a space? I don't know if that'd affect it though. try

ls | less

note the spaces. i always do it that way and it works fine

Nice alliteration by the way.

kevinalm
08-06-2003, 05:48 PM
Spaces shouldn't make any difference in this case because the | character is a "reserved word" on the bash command line. Looks to me like the less command is broken all right. Take a look at the file modification date as compared to other commands. Also check the permisions. If you know which rpm contains less you might try something like:

rpm -Uvh --force rpmname.rpm

A little drastic but often will work.

o0zi
08-07-2003, 04:16 AM
I had the same problem on my Mandrake 9.1 system after I'd rebooted without unmounting and Mandrake did a fsck on the drive. Perhaps you could just use the "more" command?

Larry Rink
08-07-2003, 06:56 PM
Originally posted by Twisted
if it is an RPM, can't you use the
rpm -e --nodeps

so it won't check for dependencies?

Way to go TWISTED !!!!

This worked just great!

Thanks for the advice!!

-Larry