Command 'code' not found

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Dimls13
Level 1
Level 1
Posts: 4
Joined: Mon Aug 19, 2019 12:47 pm

Command 'code' not found

Post by Dimls13 » Mon Aug 19, 2019 12:51 pm

Hey there,

I'm trying to open a folder in visual studio through the terminal.

However, 'code .' command isn't working.

Any ideas?

User avatar
Flemur
Level 17
Level 17
Posts: 7088
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Command 'code' not found

Post by Flemur » Mon Aug 19, 2019 1:30 pm

You might look here:
https://askubuntu.com/questions/852076/ ... g-terminal

Also try this, in case it exists but isn't in your $PATH, as mentioned in the link above.

Code: Select all

sudo find / -name code 
(my only results were some icons, but I don't have VS installed).
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 19.1 Xfce/fluxbox
Manjaro openbox/fluxbox

User avatar
smurphos
Level 12
Level 12
Posts: 4113
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Command 'code' not found

Post by smurphos » Mon Aug 19, 2019 1:40 pm

Try /usr/share/code/code

The deb package doesn't appear to put the executable in the default locations that would be in your $PATH so you need to launch it with the full path.

Edit to add - or try the suggestions in Flemur's linked thread.... :wink:
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

gm10
Level 18
Level 18
Posts: 8752
Joined: Thu Jun 21, 2018 5:11 pm

Re: Command 'code' not found

Post by gm10 » Mon Aug 19, 2019 2:07 pm

smurphos wrote:
Mon Aug 19, 2019 1:40 pm
Try /usr/share/code/code

The deb package doesn't appear to put the executable in the default locations that would be in your $PATH so you need to launch it with the full path.
Ah, my learned friend, you overlooked the postinst: ;)

Code: Select all

# Symlink bin command to /usr/bin
rm -f /usr/bin/code
ln -s /usr/share/code/bin/code /usr/bin/code
I'd suggest OP didn't actually install if if he cannot launch it.

Also just to be clear, this isn't about Visual Studio, this is about Visual Studio Code, which is an entirely different application.
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

Dimls13
Level 1
Level 1
Posts: 4
Joined: Mon Aug 19, 2019 12:47 pm

Re: Command 'code' not found

Post by Dimls13 » Tue Aug 20, 2019 5:06 am

Hey guys,

Thanks for your answers!

I followed the above commands but I didn't manage to get it working.

I reinstalled vs code through the snap store

Code: Select all

sudo snap install --classic code
And then vs opens with

Code: Select all

snap run code .
Last edited by Dimls13 on Tue Aug 20, 2019 5:37 am, edited 1 time in total.

gm10
Level 18
Level 18
Posts: 8752
Joined: Thu Jun 21, 2018 5:11 pm

Re: Command 'code' not found

Post by gm10 » Tue Aug 20, 2019 5:22 am

Dimls13 wrote:
Tue Aug 20, 2019 5:06 am
I reinstalled vs code through the snap store

Code: Select all

sudo apt-get install --classic code
And then vs opens with

Code: Select all

snap run code .
Important details you should have mentioned, for Mint does not have a snap store by default. ;)

Also the apt-get command you wrote does not install a snap so you possibly have 2 versions of code installed now but as long as it works I cannot say I care.
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

Dimls13
Level 1
Level 1
Posts: 4
Joined: Mon Aug 19, 2019 12:47 pm

Re: Command 'code' not found

Post by Dimls13 » Tue Aug 20, 2019 5:43 am

My mistake! I just edited my answer.

1)So, should I assume that the 'code' command comes only with the vs version that's installed through the snap store?
2)I deleted the other version which was installed through the software manager ( I also realized that it has really bad reviews :oops: )

gm10
Level 18
Level 18
Posts: 8752
Joined: Thu Jun 21, 2018 5:11 pm

Re: Command 'code' not found

Post by gm10 » Tue Aug 20, 2019 5:55 am

Actually I loath container formats and have neither snap nor flatpak installed on my system so I do not know how those variants are packaged. My previous answer in response to smurphos was about the regular .deb package which is available here:

https://code.visualstudio.com/
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

Dimls13
Level 1
Level 1
Posts: 4
Joined: Mon Aug 19, 2019 12:47 pm

Re: Command 'code' not found

Post by Dimls13 » Tue Aug 20, 2019 6:22 am

I'm totally newbie! :roll:

I just installed the regular .deb package. The 'code' command works just fine.

Thanks again for your answers, guys!

Post Reply

Return to “Newbie Questions”