Is there a way to run Emacs in the background from a Linux shell?

  • Thread starter Thread starter ehrenfest
  • Start date Start date
  • Tags Tags
    Linux Shell
Click For Summary
SUMMARY

To run Emacs in the background from a Linux shell, append an ampersand (&) to the command, such as "emacs foo.txt &". This allows the shell to remain usable while Emacs operates in the background. Additionally, if Emacs is already running in the foreground, it can be suspended and resumed in the background using the "bg" command, referencing the job ID with "bg %". This method enhances multitasking capabilities within the Linux shell environment.

PREREQUISITES
  • Basic knowledge of Linux shell commands
  • Understanding of job control in Unix-like systems
  • Familiarity with Emacs text editor
  • Experience with command-line interfaces
NEXT STEPS
  • Research Linux job control commands, specifically "bg" and "fg"
  • Explore advanced Emacs features for background processes
  • Learn about terminal multiplexers like tmux or screen
  • Investigate shell scripting for automating Emacs tasks
USEFUL FOR

Linux users, Emacs enthusiasts, and developers looking to enhance their productivity by managing background processes effectively.

ehrenfest
Messages
2,001
Reaction score
1
When I open emacs from a linux shell, it always makes it run in the "foreground" so that I cannot do anything else in the shell until I close emacs. I used to know a way around this with some extra command after "$ emacs" but I forgot it. Does anyone know what I am talking about?
 
Computer science news on Phys.org
You automatically background commands by adding & behind it.

So for example "emacs foo.txt &"

Also if you suspend a program, you can resume it in the background with the command bg. Example would be

"jobs -l" outputs 512 for your emacs program, so then you run "bg %512".
 

Similar threads

Replies
3
Views
11K
  • · Replies 18 ·
Replies
18
Views
2K
Replies
9
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
3
Views
2K
Replies
2
Views
3K
Replies
16
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K