LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 11-08-2006, 12:40 PM   #1
megacreations
LQ Newbie
 
Registered: Sep 2006
Posts: 4

Rep: Reputation: 0
Req:Changing Default Location Of ls Command


Hello,
I am using Redhat Enterprise 4 Linux.My problem is that ls command is always executed from the /bin/ls and i want to change the location of ls command.To perform this task i created a directory /root/temp and by using mv command i move the /bin/ls file to /root/temp and define the path of /root/temp in the $PATH variable but ls command is not executed from /root/temp.
I want to know is it possible to excuted ls or any other command from any location or directory we want.If is it possibe so please help me how to perform this task.
Thanks with regards.
 
Old 11-08-2006, 02:31 PM   #2
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
The procedure you describe should work assuming you do it as root.
When you have moved the ls command and changed the path, please post the output of the follwing commands:
Code:
which ls
ls -l /root/temp/ls
ls -l /bin/ls
ls -l /usr/bin/ls
 
Old 11-08-2006, 03:06 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,390
Blog Entries: 55

Rep: Reputation: 3563Reputation: 3563Reputation: 3563Reputation: 3563Reputation: 3563Reputation: 3563Reputation: 3563Reputation: 3563Reputation: 3563Reputation: 3563Reputation: 3563
My problem is that ls command is always executed from the /bin/ls and i want to change the location of ls command.
I can not imagine any circumstances where changing the location of "ls" is a "solution", so if it's not too much trouble I'd like to know why first. It would also mean you need to chmod 0751/root /root/temp for people outside root/wheel groups to be able to read the directory.
 
  


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
Changing emacs' default file location rose_bud4201 Linux - Software 6 11-16-2004 11:01 PM
Changing the default /tmp location nws_linux Linux - Newbie 6 09-16-2004 10:45 AM
Changing default Mozilla location compassman Linux - Software 2 06-26-2004 03:44 PM
changing user's default ftp home location GraemeK Linux - Networking 0 12-31-2003 12:11 PM
changing default mount location MeanJoshGreen Linux - Hardware 3 12-07-2003 02:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 03:10 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