Results 1 to 10 of 10

Thread: Cannot "cd" into directory or file.

  1. #1
    Join Date
    Jul 2010
    Beans
    12

    Cannot "cd" into directory or file.

    Well before I start I want to apologise for my English, & say that, I done as much "google-ling" as my short attention spam has allowed me and more. Thank you

    I cannot "cd" into files, keeps giving me bash error.
    I im trying to get "FILE" that is in my desktop, I input
    cd /home/<user>/Desktop/FILE
    & it gives me
    bash: cd: /home/<user>/Desktop/file: Not a directory
    I checked the directory multiple times, even dragged the file into the terminal just to check the directory, but I keep getting same error. I also tried the "./" but that didnt work ether. Also tried being root while using "cd" but no difference.
    What am I doing wrong.
    Using ubuntu 12.4 64 bit. Thank you

  2. #2
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Cannot "cd" into directory or file.

    You can't change directory on a file.

    Are you trying to open the file?
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  3. #3
    Join Date
    Jul 2010
    Beans
    12

    Re: Cannot "cd" into directory or file.

    Yes im trying to open up the file.
    also tried " ls Desktop" to see if it showed the "file" and it did, so it just adds up to the questions.
    Last edited by leon951; December 17th, 2012 at 03:45 AM.

  4. #4
    Join Date
    Jul 2007
    Location
    Poland
    Beans
    4,499
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Cannot "cd" into directory or file.

    cd = change directory
    file is not a directory, so why would cd work? cd is like entering room in the library (changes current location), you can't physically enter the book located there (cding into file).
    What to do with the file depends on the kind of file. Executable files can be run after chmod +x (./file), text files can be opened with any of text editors (eg gedit file.txt), media files can be played using some media player (eg totem file.avi)
    Last edited by Vaphell; December 17th, 2012 at 04:25 AM.
    if your question is answered, mark the thread as [SOLVED]. Thx.
    To post code or command output, use [code] tags.
    Check your bash script here // BashFAQ // BashPitfalls

  5. #5
    Join Date
    Aug 2007
    Location
    Canada
    Beans
    440
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Cannot "cd" into directory or file.

    run this command to see what your are trying to open:

    $ file "file-name"
    Best, Gnusci

    "Never make a calculation until you know the answer." -- Wheeler, Spacetime Physics, pg 60.

  6. #6
    Join Date
    May 2012
    Beans
    34

    Re: Cannot "cd" into directory or file.

    if you tried to open a file via terminal 1# you should enter app to open that files with it looks like this:
    gedit /home/<username>/<directory>/<file>
    > thats if your files is a text files
    rhytmbox /home/<username>/<directory>/<file>
    > thats if your file is a sound/music files
    totem /home/<username>/<directory>/<file>
    > thats if your files is a video files

    so you must type an appropriated application to open that files with

  7. #7
    Join Date
    Oct 2007
    Beans
    1,815

    Re: Cannot "cd" into directory or file.

    part of the problem also is that you're trying to say what you did. Just copy paste your command, and the output. It will help us troubleshoot with you.

  8. #8
    Join Date
    Jul 2007
    Location
    Reykjavík, Iceland
    Beans
    1,555
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Cannot "cd" into directory or file.

    Quote Originally Posted by llamabr View Post
    part of the problem also is that you're trying to say what you did. Just copy paste your command, and the output. It will help us troubleshoot with you.
    no, that is utterly useless. What is useful is the exact intentions.

    When I mean exact intentions I mean something like this:

    "Want to open /home/leon951/Desktop/Diary.doc with some program that will allow me to view and edit it's contents. This file is of MS Word."

    Hiding the path (user's home) will increase odds of errors.
    Not saying what the end results are supposed to be makes it impossible to guess.

    When I get the information I am asking for I will be able, and happy, to help.

  9. #9
    Join Date
    Jan 2011
    Location
    Annapolis, MD
    Beans
    4
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Cannot "cd" into directory or file.

    Quote Originally Posted by leon951 View Post
    Well before I start I want to apologise for my English, & say that, I done as much "google-ling" as my short attention spam has allowed me and more. Thank you

    I cannot "cd" into files, keeps giving me bash error.
    I im trying to get "FILE" that is in my desktop, I input
    cd /home/<user>/Desktop/FILE
    & it gives me
    bash: cd: /home/<user>/Desktop/file: Not a directory
    I checked the directory multiple times, even dragged the file into the terminal just to check the directory, but I keep getting same error. I also tried the "./" but that didnt work ether. Also tried being root while using "cd" but no difference.
    What am I doing wrong.
    Using ubuntu 12.4 64 bit. Thank you

    For future noob onlookers, I came across this problem. It was as simple as making sure you have the correct lettering casing. i.e. I was trying to cd into Documents by typing: "cd documents", when it should have been: "cd Documents". hope this helps.

  10. #10
    Join Date
    Jan 2006
    Location
    Not heaven... Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Cannot "cd" into directory or file.

    Closed.
    Thanks for your input, but question was answered in posts 2 and 4.
    Linux User #415691 Ubuntu User #8629
    Iowa Team (LoCo): [Wiki] [Launchpad]
    IRC channel: #ubuntu-us-ia on irc.freenode.net

Bookmarks

Posting Permissions

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