LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   Req:Changing Default Location Of ls Command (https://www.linuxquestions.org/questions/red-hat-31/req-changing-default-location-of-ls-command-499798/)

megacreations 11-08-2006 12:40 PM

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.

uselpa 11-08-2006 02:31 PM

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


unSpawn 11-08-2006 03:06 PM

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.


All times are GMT -5. The time now is 03:27 AM.