[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-699566-105":59,"doc-detail-699566-en":130,"doc-similar-699566":161},{"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","cs2043-unix-tools-scripting-lecture-04","CS2043-Unix Tools & Scripting - lecture 04","","Lecture notes for CS2043 Unix Tools & Scripting (Cornell University, Spring 2014) covering practical shell usage in bash. Topics include search and replace in text, listing files with ls options, starting bash automatically on login via / .login, and shell shortcut keys. The lecture also demonstrates tab completion, history navigation with up-down arrows, cursor movement and line editing shortcuts, and the use of the bang operator to repeat commands from history. Command history searching with Ctrl+R is explained with example workflows.",{"@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/cs2043-unix-tools-scripting-lecture-04/699566/",{"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/cs2043-unix-tools-scripting-lecture-04/699566.png","ImageObject",300,407,{"name":92,"@type":93},"Genevieve","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-25","2026-11-12",true,{"@type":102,"interactionType":103,"userInteractionCount":29},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"How does the lecture perform search and replace in the editor?","Question",{"text":112,"@type":113},"It uses the command format `:%s/pattern/string/[options]` and explains using `n` to move to the next occurrence after finding the first search term.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What is the method to start bash automatically when logging in?",{"text":117,"@type":113},"Edit the / .login file and add `if ( -f /bin/bash) exec /bin/bash --login` to ensure bash starts on login.",{"name":119,"@type":110,"acceptedAnswer":120},"How can you reuse previously executed commands from history?",{"text":121,"@type":113},"Use the bang operator `!` with a prefix, e.g., `! p` or `! pdf`, to recall commands that begin with the specified characters. The lecture also covers Ctrl+R for interactive history search.","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},699566,1794479393,{"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":29,"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":144,"preview_page_count":19,"preview_urls":145},1374391974585,"https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c","CS2043-Unix Tools & Scripting Cornell University, Spring 20141  \nInstructor: Bruno Abrahao  \nJanuary 29, 2014  \n1 Slides evolved from previous versions by Hussam Abu-Libdeh and David Slater  \nInstructor: Bruno Abrahao CS2043-Unix Tools & Scripting  \nSearch and Replace  \nSearch for search term:/search term  \nReplace pattern with string:  \n:%s/pattern/string/[options]  \nOnce you 􀀌nd the 􀀌rst occurrence of search term, hit n to 􀀌nd the next occurence. The key N goes to the previous occurence.  \nInstructor: Bruno Abrahao CS2043-Unix Tools & Scripting  \nListing 􀀌les  \nThe human option: ls-lh  \nOne 􀀌le per line ls-1  \nInstructor: Bruno Abrahao CS2043-Unix Tools & Scripting  \nMany shells for UNIX-like systems:  sh: The Bourne Shell  \na popular shell made by Stephen Bourne  \n bash: The Bourne Again Shell  \ndefault shell for the GNU OS, most Linux distros, and OSX  \n csh: The C Shellinteractive and close to C  \ndefault shell for BSD-based systems  \n zsh: The Z Shell  \npossibly the most fully-featured shell inspired by sh, bash, ksh, and tcsh  \nInstructor: Bruno Abrahao CS2043-Unix Tools & Scripting  \nSince bash is the gold standard of shells and has more than enough features for this course, we'll stick with it.  \n For more info, use Wikipedia as a starting point: [http://en.wikipedia.org/wiki/Comparison](http://en.wikipedia.org/wiki/Comparison) of command shells  \nInstructor: Bruno Abrahao CS2043-Unix Tools & Scripting  \nIf  \nIf you are already logged in to the server, just type bash  \n More importantly we would like the server to automatically put us into bash when we login. One way to do this is by editing the 􀀌le / .login which gets executed each time you log in to the server and csh starts up.  \nStart bash automatically  \nAdd the following line to the end of / .login  \nif ( -f /bin/bash) exec /bin/bash--login  \nIf you had root privileges you could just edit /etc/passwd and 􀀌nd the line corresponding to the current user.  \nInstructor: Bruno Abrahao CS2043-Unix Tools & Scripting  \nIn this lecture:  \n Shell shortcut keys  Reusing history  Aliasing  \n Special character expansion  File compression  \nInstructor: Bruno Abrahao CS2043-Unix Tools & Scripting  \nMake entering commands easier:  Tab completion  \n Up-down arrow: browse through command history  so you do not have to retype everything  \n Ctrl + e: jump cursor to end of line  \n Ctrl + a: jump cursor to beginning of line  \n Ctrl + u : delete everything from cursor to beginning of line  \n Ctrl + k : delete everything from cursor to end of line  \n Ctrl + l : clear the screen More shortcuts at:  \n[http://linuxhelp.blogspot.com/2005/08/bash-shell-shortcuts.html](http://linuxhelp.blogspot.com/2005/08/bash-shell-shortcuts.html)  \nInstructor: Bruno Abrahao CS2043-Unix Tools & Scripting  \nUse the bang operator ( ! ) to repeat a command from your history that begins with the characters following it.  \nExample  \nhussam@orjwan:􀀘 $ pdflatex lecture3 .tex  \nhussam@orjwan:􀀘 $ ! p  \nhussam@orjwan:􀀘 $ ! pdf  \n! p and ! pdf will recall pdflatex lecture3 .tex  \nUsing ! can save you many keystrokes when repeating tasks.  \nInstructor: Bruno Abrahao CS2043-Unix Tools & Scripting  \nYou can search through your command history using the shortcut Ctrl + R:  \n Press Ctrl + R and type a search string. Matching history entries will be shown.  \n Press Ctrl + R again to see other matches.  \n If you like an entry, press ENTER to re-execute it.  \n Press ESC to copy the entry to the prompt without executing.  \n Press Ctrl + G to exit search and go back to an empty prompt.  \nExample  \n(reverse-i-search)`pd': pdsh-w node[0-9] -R ssh hostname-i  \nYou will not be able to type if there are no matches.  \nInstructor: Bruno Abrahao CS2043-Unix Tools & Scripting","cbCaieLdjJ0R7HpH","https://ap.wps.com/l/cbCaieLdjJ0R7HpH","pdf",136331,26,"English","# Search and Replace\n## Listing Files\n# Start bash Automatically on Login\n## Shell Shortcut Keys\n# Reusing History and Command Recall\n## Using Ctrl+R to Search History","[{\"question\":\"How does the lecture perform search and replace in the editor?\",\"answer\":\"It uses the command format `:%s/pattern/string/[options]` and explains using `n` to move to the next occurrence after finding the first search term.\"},{\"question\":\"What is the method to start bash automatically when logging in?\",\"answer\":\"Edit the / .login file and add `if ( -f /bin/bash) exec /bin/bash --login` to ensure bash starts on login.\"},{\"question\":\"How can you reuse previously executed commands from history?\",\"answer\":\"Use the bang operator `!` with a prefix, e.g., `! p` or `! pdf`, to recall commands that begin with the specified characters. The lecture also covers Ctrl+R for interactive history search.\"}]","CS2043-Unix Tools & Scripting - lecture 04 | PDF",66,[146,150,153,157],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/4ac442baaa701672ae7d84689fec758f.webp",983,736,{"page_no":14,"url":151,"width":152,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/f1eac3b2c6bd5cd0510803125d83f927.webp",982,{"page_no":81,"url":154,"width":155,"height":156},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/4ff547e1ef66abb857d94891336638a3.webp",981,735,{"page_no":19,"url":158,"width":159,"height":160},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/b518f91a7ea9723b0a788212ea61dc2c.webp",980,734,{"list":162,"token":66},[163,169,175,182,189,195,201,207,214,220],{"doc_id":164,"doc_title":165,"file_type":137,"home_preview_img_url":166,"slug":167,"view_count":19,"category_name":30,"create_tm":168},687609,"Lecture 11 - Bash Shell, Command Line","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001262831/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110619&Signature=NjUYl8PNsRX3OKqF7Qj0tyIiWTQ%3D","lecture-11-bash-shell-command-line",1794084276,{"doc_id":170,"doc_title":171,"file_type":137,"home_preview_img_url":172,"slug":173,"view_count":34,"category_name":30,"create_tm":174},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=1796110619&Signature=kW5DWpEv96ErYfKonynLk0JXAwo%3D","an-introduction-to-unix-michaelmas-2006-basic-unix",1795032115,{"doc_id":176,"doc_title":177,"file_type":137,"home_preview_img_url":178,"slug":179,"view_count":180,"category_name":30,"create_tm":181},116713,"BEST of BASH - 2026 Edition - Unsung Command-Line Tools","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229834364500/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110619&Signature=UNxMNjs01TlFB189W6cyTz9RWRo%3D","best-of-bash-2026-edition-unsung-command-line-tools",41,1785663519,{"doc_id":183,"doc_title":184,"file_type":137,"home_preview_img_url":185,"slug":186,"view_count":187,"category_name":30,"create_tm":188},686346,"Intro2LinuxMFF lesson1 - Introduction to the Linux OS","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000739120/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110619&Signature=NEhv4h4O2PdYfyGWQSaG%2BB0BjEg%3D","intro2linuxmff-lesson1-introduction-to-the-linux-os",11,1794037851,{"doc_id":190,"doc_title":191,"file_type":137,"home_preview_img_url":192,"slug":193,"view_count":81,"category_name":30,"create_tm":194},689514,"Beginning Shell Scripting","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001332523/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110619&Signature=CLDjrb7uQh%2Bh7UMuarecTKyUBKs%3D","beginning-shell-scripting",1794112221,{"doc_id":196,"doc_title":197,"file_type":137,"home_preview_img_url":198,"slug":199,"view_count":29,"category_name":30,"create_tm":200},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=1796110619&Signature=3WH9yYYxmghEQI7ruLDQBNo8ejs%3D","introduction-to-terminal-computing-in-optimization-and-statistics",1794084152,{"doc_id":202,"doc_title":203,"file_type":137,"home_preview_img_url":204,"slug":205,"view_count":187,"category_name":30,"create_tm":206},687654,"Linux Keyboard Shortcuts - Terminal Shortcuts","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001263126/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110619&Signature=s88wLLW33hgYhQmcLLLY62nKCaE%3D","linux-keyboard-shortcuts-terminal-shortcuts",1794084419,{"doc_id":208,"doc_title":209,"file_type":137,"home_preview_img_url":210,"slug":211,"view_count":212,"category_name":30,"create_tm":213},671807,"A Practical Guide to Linux Commands - Editors and Shell Programming - Third Edition","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988776589/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110619&Signature=7KWhy4Bv7XhknAZRPBQdHwh7pI4%3D","a-practical-guide-to-linux-commands-editors-and-shell-programming-third-edition",13,1793580874,{"doc_id":215,"doc_title":216,"file_type":137,"home_preview_img_url":217,"slug":218,"view_count":34,"category_name":30,"create_tm":219},699571,"BashGuide - About This Guide - Understanding Bash","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010750079/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110619&Signature=bVETI25YDnHDkGYiOrzAoAh6tLk%3D","bashguide-about-this-guide-understanding-bash",1794479404,{"doc_id":221,"doc_title":222,"file_type":137,"home_preview_img_url":223,"slug":224,"view_count":225,"category_name":30,"create_tm":226},117655,"Best of Bash 2026 Edition - Unsung Tools for the Shell - Going Deeper","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229834701874/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110619&Signature=0Wtful0rd9%2BBRgF3bdi3io%2B3iN8%3D","best-of-bash-2026-edition-unsung-tools-for-the-shell-going-deeper",38,1785678010]