🖥️exec
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the exec command with important options and switches using examples.
2 minute read
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███████╗██╗ ██╗███████╗ ██████╗
# ██╔════╝╚██╗██╔╝██╔════╝██╔════╝
# █████╗ ╚███╔╝ █████╗ ██║
# ██╔══╝ ██╔██╗ ██╔══╝ ██║
# ███████╗██╔╝ ██╗███████╗╚██████╗
# ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═════╝
# Shell builtin command
# It can start a new process to replace the shell, without a new process creation.
# It can make redirections take effect in the current shell
# Redirect the output of an entire shell script within the script itself
# Only stdout:
exec > foo.log
# Redirect the output of an entire shell script within the script itself
# Stdout and stderr:
exec > foo.log 2>&1
# Copy output to a log file
exec > >(tee -ia foo.log)
exec 2> >(tee -ia foo.log >&2)
# Disable suspend on lid close until current shell exits - Useful for running long commands with the laptop lid closed and screen off. Also see Gnome extension Caffeine. https://extensions.gnome.org/extension/517/caffeine/
exec systemd-inhibit --what=handle-lid-switch --mode=block bash
exec -a vim nethack
# Now if your boss runs ps aux on your system, they will think you are working, not playing a game.
#==============================##==============================#
# CMD EXEC #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command exec in a clear format. This allows users to quickly access the needed information for exec without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for exec are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.