Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I execute following command:

cd ./avast4workstation_1.3.0-2_i386.deb

or

cd '/home/ravi/avast4workstation_1.3.0-2_i386.deb'

I get this error message:

bash: cd: /home/ravi/Downloads/20120409121148448001.pdf: Not a directory

How do I solve this problem?

share|improve this question
    
As ephsmith said, these are not directories. To open them, use gnome-open FILE (replacing FILE with the file you want to open). –  MiJyn Jul 19 '12 at 2:30
    
If trying to install try sudo dpkg -i avast4workstation_1.3.0-2_i386.deb go to dash and type avast click the link saying "Click here to obtain license key" and follow the rest of the on screen prompts –  damien Jul 19 '12 at 4:54
    
@ephsmith Put that as the answer. –  Uri Herrera Jul 19 '12 at 6:41
    
@lkjoel You can post that as the answer too, both are correct. –  Uri Herrera Jul 19 '12 at 6:42
2  
If no-one posts it as an answer I will and I will steal all your reputation :+ –  Rinzwind Jul 19 '12 at 6:47

2 Answers 2

  • If you want to open any file from terminal, you should issue command like

    gnome-open ~/Downloads/photo.rar

Here, photos.rar is file I want to open in the directory ~/Downloads/.

BTW, ~is used for user's home directory. ~/Downloads/photo.rar will be interpreted like /home/USER_NAME/Downloads/photo.rar.

  • if you are trying to install .deb file, you should issue

    sudo dpkg -i /home/ravi/avast4workstation_1.3.0-2_i386.deb

also, this can be done like this,

cd /home/ravi/
sudo dpkg -i avast4workstation_1.3.0-2_i386.deb

remember you can use cd ~ instead cd /home/ravi/.

  • if you want to execute a file which is in current directory, then you should use

    ./FILE_NAME.sh

Here FILE_NAME.sh can be any executable file.

Note: if path contains special characters like, spaces you should put it between single quote like '/home/ravi/avast4workstation 1.3.0-2 i386.deb' or you should escape special characters like /home/ravi/avast4workstation\ 1.3.0-2\ i386.deb

Hope I haven't confused you.

share|improve this answer

cd is a shell command to change to a directory, so it would not work to try to change directories into a file. If you tried to open these the same way you open a file in a file manager, you would have to use this:

gnome-open FILE

What that does is that it opens FILE using the default program associated with the type of that file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.