Using fdisk -l in openSUSE

Discussion in 'all things UNIX' started by wat0114, Mar 20, 2011.

Thread Status:
Not open for further replies.
  1. wat0114

    wat0114 Guest

    Something is baffling me with this command in openSUSE, and that is to view partitions, I need to run it from root directory as: "/sbin/fdisk -l", but if I navigate to the /sbin directory and try to run it as one would expect (at least I would expect :) ) as: "fdisk -l" I get back "Absolute path to 'fdisk' is '/sbin/fdisk', so running it may require superuser privileges (eg. root)", so then to run it from the sbin directory I need to log in as su first. Why will it run from the root directory as normal user but su is required to run it from its home directory sbin? I’m guessing it has something to do with "absolute path"?

    BTW, same thing seems to be true when I want to view the fstab file using kwrite, i have to run it from root directory as "kdesu kwrite /etc/fstab"
     
  2. wilbertnl

    wilbertnl Registered Member

    Joined:
    Dec 29, 2004
    Posts:
    1,850
    Location:
    Tulsa, Oklahoma
    Unlike Windows/DOS, Linux does not include the current directory in it's search path for commands. This is done for security reasons.
    If you do want to run some command from the current directory, then you need to include the path: "./fdisk -l" for example
     
  3. wat0114

    wat0114 Guest

    That helps clear up my confusion. Thanks for you help, wilbertnl!
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.