LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-08-2007, 11:04 AM   #1
innak
LQ Newbie
 
Registered: May 2007
Posts: 4

Rep: Reputation: 0
/usr/bin/wc not available in the system


Please help!
I am new to Linux.
I need to use wc command.
If I run "which wc" the output is /usr/bin/wc
However, /usr/bin/wc file is empty. wc command doesn't work at all.
I would really appreciate any advice on how to install wc into my system or how to replace wc if something else can give me word count output.
Thank you for any help,
Inna

This is output from lsb_release -a
LSB Version: core-2.0-noarch:core-3.0-noarch:core-2.0-ia32:core-3.0-ia32:graphics-2.0-ia32:graphics-2.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch
Distributor ID: SUSE LINUX
Description: SUSE LINUX Enterprise Server 9 (i586)
Release: 9
Codename: n/a
 
Old 05-08-2007, 11:57 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
What do you mean "wc command doesn't work at all."?
Linux usually gives error messages if something is wrong, and when it is silent, it is either waiting for some input (you don't see a prompt), or it has completed the command (you get a prompt back).

wc needs a filename in the current directory to count the words in that file eg
wc mytextfile
 
Old 05-08-2007, 12:10 PM   #3
innak
LQ Newbie
 
Registered: May 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Thank you for answering.
Nothing at all happens. Prompt returns right away, but no any output.
I am using it like this:
/usr/bin/wc filename.txt
If I go to /usr/bin directory and do ls -l ws, I am getting:
-rwxr-xr-x 1 root root 0 Mar 9 10:49 /usr/bin/wc

Was it not installed properly with Linux? What do I do?
Thank you for you help,
Inna
 
Old 05-08-2007, 12:16 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
wc is supplied by the coreutils package. You can check the integrity of the package with the command: "rpm -qV coreutils".

By empty, do you mean that
ls -l /usr/bin/wc
says that it has zero size?

You could reinstall coreutils if so.
If that is the only program in coreutils that shows up as bad, you could use the unrpm program and copy the wc program to /usr/bin/.
 
Old 05-08-2007, 12:18 PM   #5
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
It seems that you have a file called usr/bin/wc which is of zero length. So it is unlikely to work.
When I do ls -l /usr/bin/wc I see this:

-rwxr-xr-x 1 root root 18348 Feb 13 2003 /usr/bin/wc*

So something is very wrong with your installation. Is everything else working alright? If so, then I'd just reinstall wc, otherwise, it might be a good idea to start afresh.

This is a very unusual situation, and I wonder how it happened. You haven't been "runnng as root" have you?
 
Old 05-08-2007, 12:39 PM   #6
innak
LQ Newbie
 
Registered: May 2007
Posts: 4

Original Poster
Rep: Reputation: 0
I have no idea how it happened. The installation was done before me and all I need is to install small cron job on this machine (which is supposed to use wc).
Do you have an idea where I cat get/download wc program?
Thank you.
 
Old 05-08-2007, 12:44 PM   #7
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
Do you have an idea where I cat get/download wc program?
Please see jschiwal's post above(#4), in this thread.
 
Old 05-08-2007, 12:59 PM   #8
innak
LQ Newbie
 
Registered: May 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Yes, thank you so much!
 
Old 05-08-2007, 01:03 PM   #9
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Welcome to LQ!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
making files available in /usr/local/bin and /usr/sbin reakinator Linux - Newbie 1 10-14-2006 06:09 PM
what is difference between /usr/bin/7za /usr/bin/7z fakie_flip Linux - Software 9 08-14-2006 10:22 PM
Ubuntu 5.10 -> 6.06: diversion of /usr/bin/ldd to /usr/bin/ldd.amd64 by ia32-libs HellSpawn Linux - Software 2 06-04-2006 10:18 PM
path in services wrong for clamav updated frm 0.75 to 0.80 usr/bin vs usr/local/bin Emmanuel_uk Linux - Newbie 3 04-22-2005 02:02 AM
/usr/bin/X11/ and /usr/X11R6/bin/ the same? linuxtesting2 Linux - Newbie 2 11-16-2004 11:57 AM


All times are GMT -5. The time now is 08:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration