LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 08-04-2004, 02:51 PM   #1
pony85
LQ Newbie
 
Registered: Aug 2004
Location: Bangalore
Distribution: Redhat Linux 9.0
Posts: 25

Rep: Reputation: 15
Problem with ls command URGENT


Hello everyone....

I run Redhat 9.0 Linux everything was fine till i ran the command

cd /bin | ls > wc

i did it just to check what will happen... but after this when i use the ls command i dont see any file listing on the screen. It just executes and i get the prompt again. PLEASE HELP ME SET THIS RIGHT!!!!!!!!!
 
Old 08-04-2004, 02:54 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Hi, and welcome to LQ!

Quote:
but after this when i use the ls command i dont see any file listing on the screen.
That's because you're redirecting the output
to a file called wc, rather than counting the
characters in ls ...



Cheers,
Tink


P.S.: Please don't flag a request as urgent, that's
very poor nettiquette....
 
Old 08-04-2004, 03:00 PM   #3
pony85
LQ Newbie
 
Registered: Aug 2004
Location: Bangalore
Distribution: Redhat Linux 9.0
Posts: 25

Original Poster
Rep: Reputation: 15
how do i set it right

Thanks a lot i dint know that. I won mark it as URGENT unless it really is.

But could u please tell me how i can get back the orginal from of ls
 
Old 08-04-2004, 03:03 PM   #4
Gkarfield
Member
 
Registered: Jul 2004
Location: Greece
Distribution: FreeBSD 6.2/widows[not 8 legs nor black]
Posts: 123

Rep: Reputation: 15
just guess .........
instead wc....... just put /dev/null (i think that null is the console)
 
Old 08-04-2004, 03:05 PM   #5
Gkarfield
Member
 
Registered: Jul 2004
Location: Greece
Distribution: FreeBSD 6.2/widows[not 8 legs nor black]
Posts: 123

Rep: Reputation: 15
ehmmmmmmmm check first if /dev/null is the console ...........soryyyyyyyyyyyyy
 
Old 08-04-2004, 03:10 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Re: how do i set it right

Quote:
Originally posted by pony85
Thanks a lot i dint know that. I won mark it as URGENT unless it really is.
Ummm ... there is no such thing as "urgent". It may be something
that's quite important for you, but that's not OUR problem. The
people here help in their own good time, and because they want
to ... if you had a service-contract with anyone, you could
ask them for urgent solutions. On the net it's rude, full stop.

Quote:
But could u please tell me how i can get back the orginal from of ls
I don't understand ...

If you are in /
and type ls
what do you get?


Cheers,
Tink
 
Old 08-04-2004, 03:17 PM   #7
pony85
LQ Newbie
 
Registered: Aug 2004
Location: Bangalore
Distribution: Redhat Linux 9.0
Posts: 25

Original Poster
Rep: Reputation: 15
well i dont see any thing in the next line i get back the prompt...
Here is a snippet of my terminal

[root@localhost root]# cd /bin | ls > wc
[root@localhost root]# ls
[root@localhost root]#
 
Old 08-04-2004, 03:25 PM   #8
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
execute this and see what happens:
Code:
[root@localhost root]# /usr/bin/ls
if that doesnt work, ls is broke
 
Old 08-04-2004, 03:29 PM   #9
pony85
LQ Newbie
 
Registered: Aug 2004
Location: Bangalore
Distribution: Redhat Linux 9.0
Posts: 25

Original Poster
Rep: Reputation: 15
Hii
well i executed the command

[root@localhost root]#/usr/bin/ls and it said

bash: /usr/bin/ls No such file or directory.
How do i set it right...
 
Old 08-04-2004, 03:30 PM   #10
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
you might also try
/bin/ls
/usr/ls
 
Old 08-04-2004, 03:34 PM   #11
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
For starters your redirecting the output of ls into a file called wc. Did you want a file called wc or did you want to use wc to do a word count. Secondly your piping the output of the cd command to ls, which with a proper directory is nothing. Perhaps you meant one of the following:
cd /bin; ls | wc
cd /bin && ls | wc
 
Old 08-04-2004, 03:34 PM   #12
pony85
LQ Newbie
 
Registered: Aug 2004
Location: Bangalore
Distribution: Redhat Linux 9.0
Posts: 25

Original Poster
Rep: Reputation: 15
Nop when i did /bin/ls it works same way as i have descirbed in the first post ie nothing happens i just get the prompt. When i use /usr/ls is says no such file or directory
 
Old 08-04-2004, 03:36 PM   #13
Muzzy
Member
 
Registered: Mar 2004
Location: Denmark
Distribution: Gentoo, Slackware
Posts: 333

Rep: Reputation: 30
And you could also see what you get if you type 'which ls'
 
Old 08-04-2004, 03:36 PM   #14
pony85
LQ Newbie
 
Registered: Aug 2004
Location: Bangalore
Distribution: Redhat Linux 9.0
Posts: 25

Original Poster
Rep: Reputation: 15
well stickman actually i didnt mean anything. I just tried it as i read bout piping in a Unix book.. but can u please let me know how i can set it right.
 
Old 08-04-2004, 03:37 PM   #15
pony85
LQ Newbie
 
Registered: Aug 2004
Location: Bangalore
Distribution: Redhat Linux 9.0
Posts: 25

Original Poster
Rep: Reputation: 15
nop just ls also does nothing visible on the terminal. I think the output of ls is getting redirected to somewhere else. and no restarting or logging out isnt helping either.
 
  


Reply



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
!!!! Urgent, using chown command ? AQG Linux - Security 8 08-12-2005 03:21 PM
URGENT: problem with the command insmod pierre44 Linux - General 3 07-11-2005 08:31 AM
URGENT : pb with insmod command pierre44 Linux - Newbie 1 07-11-2005 06:59 AM
tar command problem:urgent imsajjadali Linux - General 1 01-30-2004 04:50 AM
os command doubt===urgent google_man Solaris / OpenSolaris 10 08-04-2003 09:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:40 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
Open Source Consulting | Domain Registration