Visual Studio Code – Linux installation

Elementary OS – linux distribution

On one of my machines I use ElementaryOS linux. This flavor of linux does not support DEB or RPM packages directly so I will use tar.gz file as installation medium.


Download code***.tar.gz file from address. Link to .tar.gz is under the “deb” square.


Open terminal and go to /usr/local directory. Unpack tar.gz file into default folder and create soft-link to code application:

cd /usr/local
sudo tar xvfz ~/Download/code****.tar.gz 
ln -s /usr/local/VSCode-linux-x64/Code /usr/local/bin/code


To update with a new version just download latest version of tar.gz package and unpack it to the same location. It is wise to delete (or rename) original folder first and then unpack new one.

sudo mv VSCode-linux-x64/ VSCode-linux-x64-OLD/
sudo tar xvfz ~/Download/code****.tar.gz 
sudo rm -rf VSCode-linux-x64-OLD/

Run and keep shortcut in the dock

We run code editor with “code” command. With the right click on the running program icon (in the dock), we change settings for “keep in Dock” and the program shortcut will stay in the dock.







Bash script

How to write bash script

I am using cygwin on windows and I wish to use bash as my primary scripting tool.

Write script file with the special first line which define interpreter. Put file in a folder accessible  from anywhere (folder must be on the PATH). Change file characteristics to be executable (chmod +x).

/cygdrive/c/Program\ Files\ \(x86\)/Notepad++/notepad++.exe $@ &
$ chmod +x note

This script will call notepad++ editor and open file from passed parameters (test.txt).

$ note test.txt

Unix (LF) – proper line endings

Well, don’t forget (like I was), that cygwin is linux on the windows ! It means , your script files need to be in proper format, as on linux.  If you use console editors as for example “nano”,  it will work automatically, but with notepad++ (windows app), files will be created with windows line endings by default.

2016-11-24-21_30_20-h__home_demo-notepadYou need to change line endings with right click menu … to Unix(LF) , or on the menu /Edit/EOL Conversion/.

2016-11-24-22_16_49-settings Example

echo $myvar1 $myvar2

2016-11-24-22_25_59-settingsIf you ran demo script and you didn’t get expected “Hello World” but only ” World” maybe, well check your line ending definition.

Want to know more ? Look at this nice little beginners bash tutorial or special hacker web site.