13

If you give in the command "atom ." in the terminal, the Atom editor opens the current folder and I am ready to code.

I am trying to achieve the same with Pycharm using Ubuntu: get the current directory and open it with Pycharm as a project.

Is there way to achieve this by setting a bash alias?

handris
  • 1,999
  • 8
  • 27
  • 41
  • 1
    Possible duplicate of [Launch Pycharm from command line (terminal)](http://stackoverflow.com/questions/22133861/launch-pycharm-from-command-line-terminal) – Paul H Sep 14 '16 at 22:17

7 Answers7

17

PyCharm can be launched using the charm command line tool (which can be installed while getting started with PyCharm the first time).

charm .

masnun
  • 11,635
  • 4
  • 39
  • 50
  • 1
    You can configure it as explained here: https://www.jetbrains.com/help/pycharm/opening-files-from-command-line.html @salman – garciparedes Mar 09 '19 at 19:17
  • it opens PyCharm but the problem I am facing is, when I close terminal then PyCharm exited automatically. – Anonymous Jul 20 '20 at 08:59
12

This worked for me:

pycharm-community .
Dharman
  • 30,962
  • 25
  • 85
  • 135
Ashik
  • 1,204
  • 12
  • 22
3

This works for me:

alias atom_pycharm='~/pycharm/bin/pycharm.sh .'

Maybe you installed it to a different path, though - locate your pycharm.sh file and modify accordingly.

You have the usual bash tricks: if you want to run in the background, append an &, redirect stdout/stderr where you want etc.

wim
  • 338,267
  • 99
  • 616
  • 750
2
open -na "PyCharm CE.app" . 

worked for me in MacOS & PyCharm Community edition

Anandkumar
  • 1,338
  • 13
  • 15
  • This worked for me in mac. I also added an alias in `.zshrc` to make it easier: `alias pycharm="open -na PyCharm\ CE.app"` For more customization, see: https://www.jetbrains.com/help/pycharm/working-with-the-ide-features-from-command-line.html#toolbox – Upendra Oct 07 '21 at 09:54
0

For me its:

pycharm.bat .

but I had to add an Environment Variable first using the path where pycharm.bat is located. In my case it was:

C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\bin

(how to add an Environment Variable) Windows https://www.architectryan.com/2018/08/31/how-to-change-environment-variables-on-windows-10/

Ubuntu https://hackprogramming.com/2-ways-to-permanently-set-path-variable-in-ubuntu/

I'm using Pycharm Community Edition 2019.3.1 and for the life of me I couldn't find the "Command line launcher" everyone else is talking about so I had to resort to this method.

This was for Windows but hopefully it will give you some insight on figuring it out on Ubuntu!

0

I know this is way old but I just had to do this. I created an alias for pycharm in my bashrc file.

alias pycharm='pycharm.sh $(pwd)'

nesting the pwd command allowed me to use the current directory I am in.

Since jetbrains says to use

pycharm.sh /your/dir

source: https://www.jetbrains.com/help/pycharm/opening-files-from-command-line.html

-1

enter image description here

Open your terminal and type:$ cd Desktop/pycharm-community