[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-687581-105":59,"doc-detail-687581-en":130,"doc-similar-687581":153},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","cs-45-lecture-6-command-line-environment","CS 45 - Lecture 6 - Command Line Environment","","CS 45 Lecture 6 focuses on core concepts for working in a command-line terminal environment. It distinguishes terminal, shell, CLI, TUI, and GUI, then explains what an execution environment contains: the running user, filesystem context, environment variables, and standard streams (stdin, stdout, stderr). The lecture details configuration through input/output redirection, controlling terminals and pseudo-terminals, and environment variables such as PATH, TERM, USER, and PWD, including how to export or temporarily set them, and how inheritance affects child processes.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/cs-45-lecture-6-command-line-environment/687581/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/cs-45-lecture-6-command-line-environment/687581.png","ImageObject",300,407,{"name":92,"@type":93},"McGucket","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-30","2026-11-07",true,{"@type":102,"interactionType":103,"userInteractionCount":24},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What are the differences between terminal, shell, and CLI?","Question",{"text":112,"@type":113},"A terminal is the window you open. A shell is the program that launches other programs. A CLI is a text-based program that runs within a terminal, while TUI refers to text user interfaces such as vim.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What does a program’s environment include?",{"text":117,"@type":113},"It includes the running user, filesystem elements, environment variables, and standard streams like stdin, stdout, and stderr. These factors influence what programs can do and how they behave by default.",{"name":119,"@type":110,"acceptedAnswer":120},"How do environment variables like PATH affect running commands?",{"text":121,"@type":113},"Environment variables configure default behavior. For example, $PATH lists directories the shell searches left to right; if a program is not found on your $PATH, you get a “command not found” error.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},687581,1794084186,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":24,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":129,"read_time":41,"preview_page_count":14,"preview_urls":144},1236954412713,"https://us-avatar.wpscdn.com/davatar_29158cc5080c5b710cf443261637dec0","CS 45, Lecture 6  \nCommand Line Environment  \nAkshay Srivatsan, Ayelet Drazen, Jonathan Kula  \nSpring 2023  \nOutline  \nContents  \n1 Review 1  \n2 The Environment 2  \n2.1 Configuration ............................................. 2  \n2.2 Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4  \n2.3 Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7  \n3 Shell Configuration 8  \n4 Multitasking 9  \n4. 1 Job Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9  \n4.2 Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11  \nAnnouncements  \n• Assignment 1 is due today. Reach out if you don’t think you will be able to get it done in time.  \n• Assignment 2 is out! It’s due a week from today on Wednesday, April 26th at 11:59 PM.  \n1 Review Recap  \nIn the previous lecture, we saw:  \n• How to edit files in the terminal  \n• How to enter/exit a full screen program (vim) In this lecture, we will see:  \n• How to configure and customize your shell  \n• How to multitask in the terminal  \n• How to run multiple programs side-by-side  \nBefore we get into that, there are a few similar terms that are often confused; let’s get into what they mean and how they’re different.  \nTerminal vs. Shell vs. Command Line  \nDefinition 1.1 (terminal) . The terminal is the window you open. Think of it like a web browser.  \nDefinition 1.2 (shell) . The shell is the program you use to launch other programs. Think of it like Google.  \nDefinition 1.3 (cli) . A command line interface (CLI) is a generic term for a text-based program which runs within a terminal. Think of this like “the web”. A CLI program or a TUI program is like a website.  \nYou may often see a few acronyms in the context of user interfaces:  \nCLI: Command-Line Interface (like the shell)  \nTUI: Text User Interface (like vim)  \nGUI: Graphical User Interface (like Microsoft Word)  \n2 The Environment  \nWe’ve already seen how you can control the behavior of CLI programs using flags, but there’s another way to configure them. Each program runs in what’s called an “environment”.  \nContents of the Environment  \nThe “environment” a program runs in includes several things:  \n• The user who’s running it  \n• The files on the filesystem  \n• Environment variables (configuration variables)  \n• stdin and stdout (and stderr)  \nEach of these affects running programs in different ways. Some of them control what a program can or cannot do, others control the default behavior of programs.  \n2.1 Configuration  \nInput/Output  \nWe already saw this in Lecture 2, but we can control the default input and output files of a program using redirection, i.e., the \u003C , > , >> , and | operators.  \nBy default, input comes from the terminal (/dev/tty* or /dev/pts/*); you can see the name of the “controlling terminal” of a program by running tty.  \nA controlling terminal is essentially which terminal window a program is running in.  \nInput and output can be redirected, but a program is bound to a specific window. When that window is closed, the program will exit.  \nThe command tty stands for “teletypewriter”. A teletypewriter was, essentially, a typewriter than was plugged into a computer and used for input/output. As we talked about in Lecture 2, these got replaced later with “video terminals” (which had a basic screen instead of a piece of paper), which were themselves later replaced with terminal emulators (the program called “Terminal” on your computer) . Nowadays, terminal emulators tell your OS to create what’s called a “pseudo-terminal” (or “pty”), which lets them pretend to be a terminal even though they’re just normal programs.  \nEnvironment Variables  \nEnvironment variables are a way to configure a program’s default behavior.  \nWe’ve already seen shell scripting variables, environment variables are basically the same thing except ","cbCaifS5fhKgxRiU","https://ap.wps.com/l/cbCaifS5fhKgxRiU","pdf",164540,12,"English","# Review\n## Terminal vs. Shell vs. Command Line Interface (CLI)\n# The Environment\n## Configuration\n### Input/Output\n### Environment Variables\n## Permissions\n## Users and Groups\n# Shell Configuration\n# Multitasking\n## Job Control\n## Multiplexing","[{\"question\":\"What are the differences between terminal, shell, and CLI?\",\"answer\":\"A terminal is the window you open. A shell is the program that launches other programs. A CLI is a text-based program that runs within a terminal, while TUI refers to text user interfaces such as vim.\"},{\"question\":\"What does a program’s environment include?\",\"answer\":\"It includes the running user, filesystem elements, environment variables, and standard streams like stdin, stdout, and stderr. These factors influence what programs can do and how they behave by default.\"},{\"question\":\"How do environment variables like PATH affect running commands?\",\"answer\":\"Environment variables configure default behavior. For example, $PATH lists directories the shell searches left to right; if a program is not found on your $PATH, you get a “command not found” error.\"}]","CS 45 - Lecture 6 - Command Line Environment | PDF",[145,149],{"page_no":8,"url":146,"width":147,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/838fbbd4db3dd8d217dd1f16e19dc8c1.webp",983,1272,{"page_no":14,"url":150,"width":151,"height":152},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/382681ea7af60047c6efe79db5416fac.webp",982,1270,{"list":154,"token":66},[155,161,167,173,179,185,191,197,204,210],{"doc_id":156,"doc_title":157,"file_type":137,"home_preview_img_url":158,"slug":159,"view_count":24,"category_name":30,"create_tm":160},692887,"CA Spectrum - Command Line Interface User Guide - Release 9.3","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230005006892/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=rw87wbyvUJmsIh%2BU5GkmYSWSkXI%3D","ca-spectrum-command-line-interface-user-guide-release-93",1794241754,{"doc_id":162,"doc_title":163,"file_type":137,"home_preview_img_url":164,"slug":165,"view_count":29,"category_name":30,"create_tm":166},687564,"Introduction to Terminal - Computing in Optimization and Statistics","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001262463/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=rfLGbhWJkgltNxTEMkv5RDMO4%2Bw%3D","introduction-to-terminal-computing-in-optimization-and-statistics",1794084152,{"doc_id":168,"doc_title":169,"file_type":137,"home_preview_img_url":170,"slug":171,"view_count":34,"category_name":30,"create_tm":172},719798,"An Introduction to UNIX - Michaelmas 2006 - Basic UNIX","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230023662331/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=9Gs0b8c4XS1W9aQ5fTIoeFugP1E%3D","an-introduction-to-unix-michaelmas-2006-basic-unix",1795032115,{"doc_id":174,"doc_title":175,"file_type":137,"home_preview_img_url":176,"slug":177,"view_count":24,"category_name":30,"create_tm":178},689109,"Notes on Data Structures and Programming Techniques - CPSC 223 Spring 2018","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001510733/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=Y7SpalzakHwzdmQeiBV2GPZqsFI%3D","notes-on-data-structures-and-programming-techniques-cpsc-223-spring-2018",1794096425,{"doc_id":180,"doc_title":181,"file_type":137,"home_preview_img_url":182,"slug":183,"view_count":24,"category_name":30,"create_tm":184},686335,"PolyULib DS Guide - Ollama Local LLM","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000731483/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=JFgstazXhaMCkhLs6xl9%2F0ct4ow%3D","polyulib-ds-guide-ollama-local-llm",1794037342,{"doc_id":186,"doc_title":187,"file_type":137,"home_preview_img_url":188,"slug":189,"view_count":8,"category_name":30,"create_tm":190},760294,"Embedded Android","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230044228737/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=ZgovnDXO1R3yZlhRAMbcnTCmD1w%3D","embedded-android",1795899395,{"doc_id":192,"doc_title":193,"file_type":137,"home_preview_img_url":194,"slug":195,"view_count":19,"category_name":30,"create_tm":196},689250,"Pocket Reform Handbook - Safety, Setup, Linux Console, Hardware","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001554179/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=EXYxvWkWNryXSPncQs3L61fZ7Xw%3D","pocket-reform-handbook-safety-setup-linux-console-hardware",1794101230,{"doc_id":198,"doc_title":199,"file_type":137,"home_preview_img_url":200,"slug":201,"view_count":202,"category_name":30,"create_tm":203},347820,"Introduction to Programming Using Java - Version 5.0 - About the book version","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229911557945/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=X6tMi9nGUbIB5LAbQ%2FPHThldCvY%3D","introduction-to-programming-using-java-version-50-about-the-book-version",11,1790069243,{"doc_id":205,"doc_title":206,"file_type":137,"home_preview_img_url":207,"slug":208,"view_count":24,"category_name":30,"create_tm":209},720510,"Adafruit BNO055 Library Documentation - Release 1.0 - Installation and Dependencies","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230023674445/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=jR5KL9Hw2y1e3vEdaM9YPXuImO0%3D","adafruit-bno055-library-documentation-release-10-installation-and-dependencies",1795037659,{"doc_id":211,"doc_title":212,"file_type":137,"home_preview_img_url":213,"slug":214,"view_count":14,"category_name":30,"create_tm":215},720226,"STM32 Datasheet and User Manual - Lecture 5 - Microprocessor-based Systems (E155)","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230024389715/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=6qIojK%2B%2BwKfdYLUdsQQ8WfTDTzU%3D","stm32-datasheet-and-user-manual-lecture-5-microprocessor-based-systems-e155",1795035878]