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 08-05-2004, 07:01 AM   #31
Charalambos
Member
 
Registered: Aug 2004
Location: Switzerland
Distribution: debian
Posts: 149

Rep: Reputation: 15

Quote:
Originally posted by pony85
Well thats also no use stickman.... The same thing happens when i execute the ls command as a ordinary user...
Pony85
Really not. As a regular user you have no permission to overwrite the ls command (unless you have changed the write permissions before..?).
And regular user means a user with less privileges than root...
You really shouldn't mess around in linux as root.
 
Old 08-05-2004, 08:45 AM   #32
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Quote:
Originally posted by pony85
Well thats also no use stickman.... The same thing happens when i execute the ls command as a ordinary user...
regards
Pony85
By running that command as a regular user you minimize the chances of corrupting commands. Also since is appear that you're not getting an error message, it appears that that your ls command is still intact.

The cd piped to ls is not a bug. It's working correctly, but it not doing what you think it should do. Try the following (# are comment lines):

# go to home directory
cd
# run odd pipe command
cd /bin | ls
# get current directory
pwd
# re-run odd pipe command with another directory
cd /tmp | ls
# get current directory
pwd

You should get the same results for both /bin and /tmp. Changing to a valid directory produces no output to send to the pipe. ls reads arguments not from a pipe. The ls is always on the current directory. The command (although pointless) is producing the correct ouput. Better alternatives are:

cd /bin && ls
ls /bin

Last edited by stickman; 08-05-2004 at 08:47 AM.
 
Old 08-05-2004, 03:53 PM   #33
Muzzy
Member
 
Registered: Mar 2004
Location: Denmark
Distribution: Gentoo, Slackware
Posts: 333

Rep: Reputation: 30
I agee with stickman - if you had not experimented as root, you would never have ended up in this position in the first place. Linux will protect you from damaging your system *unless* you are logged in as root. It's too late now though, there is no 'undo' function.

Perhaps the easiest option is to reinstall, and not use root unless you absolutely have to, and only when following instructions, until you are more familiar with the command line. Nearly everything can be done without needing root, apart from when you need to install new software. Never use root for day to day tasks such as reorganising your mp3 collection, browsing the web, learning new commands, etc...

It's unfortunate that you had to find this out the hard way.

Regards,
Mark.
 
  


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


All times are GMT -5. The time now is 10:21 AM.

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