Run a command in the background

Run a script that keeps working after you close the terminal (SIGHUP) and write its output to a file.

nohup ./script.sh > /tmp/out.log 2>&1 &

tool
linux133 commands
tags
linux

More linux commands

  • ssh -L 8080:internal-service:80 user@bastion -N -f

    Forward local port 8080 to an internal service through a bastion host and keep the tunnel in the background.

  • tar -xzf archive.tar.gz -C /target/dir/

    Extract a gzipped tar archive into a given directory.

  • openssl rand -base64 32

    Generate 32 bytes from a cryptographically secure source and encode them in base64.

  • openssl s_client -connect example.com:443 </dev/null 2>/dev/null | openssl x509 -noout -dates -subject

    Show the validity dates and subject of the certificate on a live TLS endpoint.

  • awk '{sum += $3} END {print sum}' file.txt

    Add up the values in column 3 of a file where fields are split by spaces.

all 133 linux commands