Running a program as a background process from the command line
[
]
In short, add “&” to your command to launch it as a background process from the terminal.
I’m in the habit of launching programs on MacOSX from the command line, with the most notable example probably being GitX, my favorite git GUI program.
A few months ago, though, while playing with GitX installs, GitX started hogging my terminal and launching in the foreground when I would call it from Terminal. I would have to use GitX and then close it before command came back to my terminal session.
My brother showed me this neat trick to signify launching something as
a background process. Instead of gitx
, I just type gitx&
and I
still command my terminal:
Kasim:kasimte.github.io Kasim$ gitx&
[1] 56298
Kasim:kasimte.github.io Kasim$
Another case i often find myself using this trick is on a remote server, where I want to run something like visdom to display results from a machine learning experiment.
In this case, it also helps to send the output of the process to
/dev/null
, which means it won’t clog up the console in your shell
session. That can be done with a line like this:
nohup visdom > /dev/null 2>&1 &
Archive
chinese
tang-dynasty-poetry
李白
python
王维
rl
pytorch
numpy
emacs
杜牧
spinningup
networking
deep-learning
贺知章
白居易
王昌龄
杜甫
李商隐
tips
reinforcement-learning
macports
jekyll
骆宾王
贾岛
孟浩然
xcode
time-series
terminal
regression
rails
productivity
pandas
math
macosx
lesson-plan
helicopters
flying
fastai
conceptual-learning
command-line
bro
黄巢
韦应物
陈子昂
王翰
王之涣
柳宗元
杜秋娘
李绅
张继
孟郊
刘禹锡
元稹
youtube
visdom
system
sungho
stylelint
stripe
softmax
siri
sgd
scipy
scikit-learn
scikit
safari
research
qtran
qoe
qmix
pyhton
poetry
pedagogy
papers
paper-review
optimization
openssl
openmpi
nyc
node
neural-net
multiprocessing
mpi
morl
ml
mdp
marl
mandarin
macos
machine-learning
latex
language-learning
khan-academy
jupyter-notebooks
ios-programming
intuition
homebrew
hacking
google-cloud
github
flashcards
faker
docker
dme
deepmind
dec-pomdp
data-wrangling
craftsman
congestion-control
coding
books
book-review
atari
anki
analogy
3brown1blue
2fa