In Linux, the jobs command is used to list the currently running jobs in the background or stopped processes that have been started from the terminal. Each job is associated with a unique job number, and you can manage these jobs using foreground (fg) and background (bg) commands.
The fg command is used to bring a background job to the foreground, allowing you to interact with it directly. On the other hand, the bg command is used to resume a stopped job in the background, allowing it to run without occupying the terminal.
# Start a long-running command in the background
sleep 300 &
# Check the list of jobs
jobs
# Bring the job with job number 1 to the foreground
fg %1
# Stop the job with Ctrl+Z, which pauses it and puts it in the background
# Then, to resume it in the background, use:
bg %1
How do I avoid rehashing overhead with std::set in multithreaded code?
How do I find elements with custom comparators with std::set for embedded targets?
How do I erase elements while iterating with std::set for embedded targets?
How do I provide stable iteration order with std::unordered_map for large datasets?
How do I reserve capacity ahead of time with std::unordered_map for large datasets?
How do I erase elements while iterating with std::unordered_map in multithreaded code?
How do I provide stable iteration order with std::map for embedded targets?
How do I provide stable iteration order with std::map in multithreaded code?
How do I avoid rehashing overhead with std::map in performance-sensitive code?
How do I merge two containers efficiently with std::map for embedded targets?