Find the answer to your Linux question:
Results 1 to 9 of 9
Hi All, I am new to Linux. So, please pardon if the question is too trivial. 'Is there a shell command to verify path and a file in some path?' ...
  1. #1
    Just Joined!
    Join Date
    Apr 2007
    Posts
    6

    Is there a shell command to verify path?

    Hi All,

    I am new to Linux. So, please pardon if the question is too trivial.

    'Is there a shell command to verify path and a file in some path?'

    Thanks!

  2. #2
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    I'm afraid that I don't understand your question.

    The command 'pwd' (or the environment variable $PWD) will tell you your current path. If you combine this with the relative path of any file, you will have its absolute path.

    If this doesn't answer your question, please explain your question further.
    DISTRO=Arch
    Registered Linux User #388732

  3. #3
    Linux Guru Juan Pablo's Avatar
    Join Date
    Mar 2006
    Location
    /home/south_america/ecuador/quito
    Posts
    2,064
    Do you mean 'the folders on your path'? If so, you can get them like this

    echo $PATH
    Put your hand in an oven for a minute and it will be like an hour, sit beside a beautiful woman for an hour and it will be like a minute, that is relativity. --Albert Einstein
    Linux User #425940

    Don't PM me with questions, instead post in the forums

  4. #4
    Just Joined!
    Join Date
    Apr 2007
    Posts
    6
    Sorry for being abstract.

    Here I go again:

    I want to be able to verify if there is a file/dir at a particular location on the local system, using shell command.

    Ex: I want to verify if directory /usr/bin/abcd is present, using shell. if file /usr/bin/notes.txt is present, using shell.

    Thanks!

  5. #5
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    *cough*ls*cough*
    Can't tell an OS by it's GUI

  6. #6
    Just Joined!
    Join Date
    Apr 2007
    Posts
    6
    I knew I was being stupid

    Thanks a ton!

  7. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    check this link too.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  8. #8
    Just Joined! GTX2GvO's Avatar
    Join Date
    Jul 2007
    Location
    The Black Den
    Posts
    34
    Survival in Linux
    This should be added to the top sticky in this forum.
    Easy to use AND understand and even a Total Linux N00b (me) can pass this tutorial with flying colors.
    (I Aced ALL quizzed! )
    Last edited by devils casper; 07-18-2007 at 06:22 PM.

  9. #9
    Just Joined!
    Join Date
    Jun 2007
    Posts
    46
    hi
    you can also use locate command to know every file`s path with the given name

    # locate <name to be searched>
    # find path -name <file_to_search>



    regards

Posting Permissions

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