keep command running in background linux code example

Example 1: bash how to leave a process running on remote server

# Short answer:
# Learn how to use screen

# Basic syntax:
# After logging in to remote server run:
screen # This starts a new screen. 

# After starting a long process, e.g., a download, detach with:
CTRL+a d # To detach from screen, press CTRL+a, release, then press d

# To view active screens:
screen -ls

# To resume active screen:
screen -r # If there is only one active screen
screen -r screen_number # If there are multiple active screens

Example 2: linux run task in background

[command] 2> /dev/null &