Skip to content

Instantly share code, notes, and snippets.

@rivancic
Last active June 22, 2017 15:51
Show Gist options
  • Save rivancic/3f17d072ddaa1ab5c3aad28d12269af9 to your computer and use it in GitHub Desktop.
Save rivancic/3f17d072ddaa1ab5c3aad28d12269af9 to your computer and use it in GitHub Desktop.
Linux

Export variable

~/.bashrc

When you open any terminal window this file will be run. Therefore, if you wish to have a permanent environment variable in all of your terminal windows you have to add the following

~/.profile

Same as bashrc you have to put the mentioned command line at the end of this file to have your environment variable in the every log in of your OS.

/etc/environment

If you want your environment variable in every windows or application ( not just terminal window ) you have to edit this file. Add the following command at the end of this file: DISPLAY=0 Note that in this file you do not have to write export command

Normally you have to restart your computer to apply this changes. But you can apply changes in bashrc and profile by these commands:

$ source ~/.bashrc $ source ~/.profile

https://stackoverflow.com/a/31546962/978302

Get linux version

cat /etc/*-release

Add quotes

to beginning and end of the line and write it to file

  • cat
  • dos2unix
  • sed

cat test.txt|dos2unix|sed 's/^/"/;s/$/"/' > file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment