Find the answer to your Linux question:
Results 1 to 6 of 6
I am using ubuntu 12.04 To find out the location of python I used "which python" in the terminal the location is /usr/bin/python I did a "cd /usr/bin/python" but then ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2014
    Posts
    2

    Unhappy ls command not showing all items


    I am using ubuntu 12.04
    To find out the location of python I used "which python" in the terminal
    the location is /usr/bin/python
    I did a "cd /usr/bin/python"
    but then I get "/usr/bin/python is not a folder"
    then I did "cd /usr/bin"
    and then "ls -a" to list all items in that folder.

    But I cannot find python.

    what is happening?

  2. #2
    Just Joined!
    Join Date
    Aug 2014
    Posts
    1
    /usr/bin/python is the path to the executable
    Try "cd /usr/bin" and "ls pyth*"

  3. #3
    Linux Engineer docbop's Avatar
    Join Date
    Nov 2009
    Location
    Woodshed, CA
    Posts
    947
    Quote Originally Posted by rubens34 View Post
    I am using ubuntu 12.04
    To find out the location of python I used "which python" in the terminal
    the location is /usr/bin/python
    I did a "cd /usr/bin/python"
    but then I get "/usr/bin/python is not a folder"
    then I did "cd /usr/bin"
    and then "ls -a" to list all items in that folder.

    But I cannot find python.

    what is happening?
    The which command gave you what you asked... which binary is executed if I type python. It gave you the path AND the name of the executable python. So /usr/bin/ is the path and /usr/bin/python is the binary.
    A lion does not lose sleep, over the opinion of sheep.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jul 2014
    Posts
    5
    Check whether python package is installed.

    dpkg -l |grep -i python

    Try using the below command to find out the location of the python files

    find /usr/bin -type d -iname "python"

    Usually, python is available as soft link in /usr/bin directory and it might be deleted in this case.

    exxxxxxxxx@xxxxxxxxxxxxxxxxxxxxx:/usr/bin$ pwd
    /usr/bin
    exxxxxxxxx@xxxxxxxxxxxxxxxxxxxxx:/usr/bin$ ls -lthr python
    lrwxrwxrwx 1 root root 9 Jun 18 2013 python -> python2.7
    exxxxxxxxx@xxxxxxxxxxxxxxxxxxxxx:/usr/bin$

  6. #5
    Just Joined!
    Join Date
    Aug 2014
    Posts
    2
    Look at what I did

    peter@peter-Inspiron-1750:~$ which python3.3
    /usr/bin/python3.3
    peter@peter-Inspiron-1750:~$ cd /usr/bin
    peter@peter-Inspiron-1750:/usr/bin$ l py*
    py3clean* pydoc3.3* python2.7* python3.3dm-config*
    py3compile* pygettext@ python3@ python3.3m*
    py3versions@ pygettext2.7* python3.2@ python3.3m-config*
    pyclean* pygettext3@ python3.2mu* python3mu@
    pycompile* pygettext3.2* python3.3@ pyvenv-3.3*
    pydoc@ pygettext3.3* python3.3-config@ pyversions@
    pydoc2.7* pyhtmlizer* python3.3-dbg@
    pydoc3@ python@ python3.3-dbg-config@
    pydoc3.2* python2@ python3.3dm*
    peter@peter-Inspiron-1750:/usr/bin$ type pydoc@
    bash: type: pydoc@: niet gevonden
    peter@peter-Inspiron-1750:/usr/bin$

    so my next questions are
    1. How do I find out what each item represents?
    2. what is the meaning of the postfix @ in " pydoc@"
    iden for * in "pyclean*"

    (it shows I am a novice here....)

  7. #6
    Linux Engineer
    Join Date
    Dec 2013
    Posts
    1,472
    Quote Originally Posted by rubens34 View Post
    so my next questions are
    1. How do I find out what each item represents?
    2. what is the meaning of the postfix @ in " pydoc@"
    iden for * in "pyclean*"

    (it shows I am a novice here....)
    1) A web search - try https://www.python.org/
    2) 'l' isn't really a command - it is an alias in your ~/.bashrc for 'ls -CF'. The F switch tells 'ls' to print the characters '*/=>@|' as a way to classify them. A better way to view them would be:
    Code:
    ls -l /usr/bin/py*
    You can then use the perms to understand it better. The @ is for a link and the * is for an executable.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •