Discussion:
Why command does not get removed even removing its binary ?
swapnil kamble
2005-12-26 10:14:22 UTC
Permalink
Hi,
I made an application in GTK+ . I created its binariy . Copied it to /bin which will create my own command , which also mean that command gets executed from path /bin . And as and when I removed binary from /bin command gets vanished that`s fine . But if I want to delete built in command then I removed its binary from same path /bin and command remains still there perfectly working .
For example ,
#rm /bin/ls
#ls
home bin var tmp usr ....

To more fun to it if I removed all code and pasted code of other file it works as other command
For example
#vi /bin/ls
then remove all line of binary code
#vi /bin/pwd
then copy all binary code of pwd
again
#vi /bin/ls
paste copied code
now command ls will act as pwd

How it is possible ?

...Swapnil



---------------------------------
Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.
Bharathi Subramanian
2005-12-26 11:45:28 UTC
Permalink
Post by swapnil kamble
#rm /bin/ls
What is the output of below command, after the above command ?

# which ls
# whereis ls
Post by swapnil kamble
#ls
home bin var tmp usr ....
Bye :)
--
Bharathi S



------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/0XFolB/TM
--------------------------------------------------------------------~->


Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/bcslug/

<*> To unsubscribe from this group, send an email to:
bcslug-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Navtej Singh
2005-12-26 11:52:40 UTC
Permalink
This should clarify it a bit.

localhost ~ # which ls
/usr/bin/ls
localhost ~ # mv `which ls` `which ls`2
localhost ~ # ls
845patch I_Hate_Myself_For_Loving_You.mp3
localhost ~ # which ls
/bin/ls
localhost ~ # mv `which ls` `which ls`2
localhost ~ # ls
/bin/ls: No such file or directory
localhost ~ # ls2
845patch I_Hate_Myself_For_Loving_You.mp3
localhost ~ # which ls2
/bin/ls2
localhost ~ # mv `which ls2` /bin/ls
localhost ~ # ls
845patch I_Hate_Myself_For_Loving_You.mp3
localhost ~ # which ls
/bin/ls
localhost ~ # ls2
/bin/ls2: No such file or directory
localhost ~ # ls -l /usr/bin/ls2
lr-xr-xr-x 1 root root 7 Dec 7 21:51 /usr/bin/ls2 -> /bin/ls
localhost ~ # mv /usr/bin/ls2 /usr/bin/ls
localhost ~ # which ls
/usr/bin/ls

so basically the fun doesnt works for me. removing /bin/ls for me
**removed** it and no ls was available.
use which command to find where ur binary is and if it is symlink.

//N
Post by swapnil kamble
Hi,
I made an application in GTK+ . I created its binariy . Copied it to
/bin which will create my own command , which also mean that command gets
executed from path /bin . And as and when I removed binary from /bin command
gets vanished that`s fine . But if I want to delete built in command then I
removed its binary from same path /bin and command remains still there
perfectly working .
For example ,
#rm /bin/ls
#ls
home bin var tmp usr ....
To more fun to it if I removed all code and pasted code of other
file it works as other command
For example
#vi /bin/ls
then remove all line of binary code
#vi /bin/pwd
then copy all binary code of pwd
again
#vi /bin/ls
paste copied code
now command ls will act as pwd
How it is possible ?
...Swapnil
------------------------------
Yahoo! Photos
Ring in the New Year with Photo Calendars<http://us.rd.yahoo.com/mail_us/taglines/photos/*http://pg.photos.yahoo.com/ph//page?.file=calendar_splash.html&.dir=>.
Add photos, events, holidays, whatever.
SPONSORED LINKS
Linux open source<http://groups.yahoo.com/gads?t=ms&k=Linux+open+source&w1=Linux+open+source&w2=Gnu&c=2&s=32&.sig=psA60uhsbASym60pL5JN9w>
Gnu<http://groups.yahoo.com/gads?t=ms&k=Gnu&w1=Linux+open+source&w2=Gnu&c=2&s=32&.sig=Q23kkJEE9eXwuWINERh48g>
------------------------------
YAHOO! GROUPS LINKS
- Visit your group "bcslug <http://groups.yahoo.com/group/bcslug>"
on the web.
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/>.
------------------------------
Loading...