[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-573360-105":53,"doc-detail-573360-en":126},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":119,"head_meta":121,"extra_data":123,"updated_unix":125},105,"en","shell-scripting-cheat-sheet-for-unix-and-linux-v13-quick-reference","Shell Scripting Cheat Sheet for Unix and Linux - v1.3 - quick reference","","Shell Scripting Cheat Sheet for Unix and Linux provides a compact reference of practical commands and shell syntax. It covers test operators and conditional constructs (e.g., numeric comparisons, if blocks), common control patterns, variable substitution, and function declaration and invocation. It also summarizes file and stream operations, conditional execution with logical operators, and search/filter tools such as grep, egrep, awk, sed, find, less, strace, tar, ssh, and scp, plus useful shell shortcuts like alias management.",{"@graph":63,"@context":118},[64,80,101],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/shell-scripting-cheat-sheet-for-unix-and-linux-v13-quick-reference/573360/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/shell-scripting-cheat-sheet-for-unix-and-linux-v13-quick-reference/573360.png","ImageObject",442,249,{"name":88,"@type":89},"Lucas Martin","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-18","2026-10-14",true,{"@type":98,"interactionType":99,"userInteractionCount":73},"InteractionCounter",{"@type":100},"ViewAction",{"@type":102,"mainEntity":103},"FAQPage",[104,110,114],{"name":105,"@type":106,"acceptedAnswer":107},"What test syntax and operators are shown for conditional checks?","Question",{"text":108,"@type":109},"It shows using an if statement with test brackets like if [ “$x” -lt “$y” ]; then ... fi to compare values before running commands.","Answer",{"name":111,"@type":106,"acceptedAnswer":112},"How can logical conditional execution be performed?",{"text":113,"@type":109},"The sheet uses operators such as cmd1 || cmd2 to run cmd2 only if cmd1 fails, and cmd1 && cmd2 to run cmd2 only if cmd1 succeeds.",{"name":115,"@type":106,"acceptedAnswer":116},"Which tools are listed for searching and text processing?",{"text":117,"@type":109},"It includes grep/egrep for matching patterns, awk for printing a specific word field, sed for replacing text in files, and find for locating files by name or type.","https://schema.org",{"og:url":78,"og:type":120,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":122,"canonical":78},"index,follow",{"doc_id":124,"site_id":56},573360,1792359718,{"code":4,"msg":5,"data":127},{"doc_id":124,"user_id":128,"nickname":88,"user_avatar":129,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":130,"file_id":131,"file_url":132,"file_type":133,"file_size":134,"view_count":73,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":9,"language":135,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":136,"faqs":137,"seo_title":138,"seo_description":61,"update_tm":139,"read_time":4},8796095360427,"https://ap-avatar.wpscdn.com/davatar_994ba38a5ba835b3df7d355c54d3ed8d","v1.3 Sept  \n2012  \nShell Scripting Cheat Sheet for Unix and Linux  \nOnline: [http://steve-parker.org/sh/sh.shtml](http://steve-parker.org/sh/sh.shtml)[ ](http://steve-parker.org/sh/sh.shtml)Book: [http://steve-parker.org/shellscripting](http://steve-parker.org/shellscripting)  \nFile Redirection Test Operators Variable Substitution  \nif [ “$x” -lt “$y” ]; then \\# do something fi  \nCommon Constructs  \n\n| \u003Cbr>$ while read f read text file\u003Cbr>> do line by line\u003Cbr>> echo “Line is $f”\u003Cbr>> done \u003C file note: “$” prompt\u003Cbr>becomes “>” |  |\n| --- | --- |\n| \u003Cbr>$ grep foo myfile find lines in\u003Cbr>afoo myfile\u003Cbr>foo containing the\u003Cbr>foobar text “foo” |  |\n| $ cut-d: -f5 /etc/passwd get 5th field\u003Cbr>Steve Parker delimited by colon |  |\n| \u003Cbr>$ cmd1 || cmd2 run cmd1; if fails,\u003Cbr>run cmd2 |  |\n| $ cmd1 && cmd2 run cmd1; if it\u003Cbr>works, run cmd2 |  |\n| case $foo ina) | act upon the value of a |\n| |  |\n| myvar=`ls` | get output of\u003Cbr>ls into variable |\n| doubleit() {\u003Cbr>expr $1 \\* 2\u003Cbr>}\u003Cbr>doubleit 3 \\# returns 6 | function\u003Cbr>declaration\u003Cbr>and syntax\u003Cbr>for calling it |\n\nConditional Execution  \nFiles  \n\n| mv /src /dest | move /src into /dest |\n| --- | --- |\n| ls a* | list files beginning with “a” |\n| ls *a | list files ending with “a” |\n| ls-ltr | list oldest first, newest last |\n| ls-lSr | list smallest first, biggest last |\n| ls-a | list all files, including hidden |\n| find /src-print \\ | copy /src into current |\n| | cpio-pudvm | directory, preserving\u003Cbr>links, special devices, etc. |\n\nPreset Variables  \nGenerally Useful Commands  \nMisc Useful Commands and Tools  \n\n| egrep “(foo|bar)” file | find “foo” or\u003Cbr>“bar” in file |\n| --- | --- |\n| awk '{ print $5 }' file | print the 5th word\u003Cbr>of each line |\n| cal 3 1973 | March 1973 |\n| df-h | show disk mounts |\n| three=`expr 1 + 2` | simple maths |\n| echo \"scale = 5 ; \\ 5121 / 1024\" | bc | better maths\u003Cbr>(5.00097) |\n| time cmd | stopwatch on cmd |\n| touch file | create blank file |\n| alias ll='ls-l' | alias for ls-l |\n| unalias ls | unset existing alias |\n\n\n| find . -size 10k-print | files over 10Kb |\n| --- | --- |\n| find . -name “*.txt” -print | find text files |\n| find /foo-type d-ls | list all directories under /foo |\n| less file | display file page by page |\n| sed s/foo/bar/g file\u003Cbr>sed-i s/foo/bar/g file | replace “foo” with “bar”\u003Cbr>in file (-i: update file) |\n| strace-tfp PID | trace system calls for PID |\n| tar cvf archive.tar file1 file 2 file3 | create tar archive |\n| ssh user@host | log in to host as user |\n| scp file.txt user@host: | copy file.txt to host as user |\n| scp user@host:/tmp/file.txt /var/tmp | copy /tmp/file.txt from user at host to /var/tmp locally |\n| cd- | return to previous directory |","cbCaiqcjwzfB8Sn6","https://ap.wps.com/l/cbCaiqcjwzfB8Sn6","pdf",48672,"English","# Common Constructs\n## Conditional Execution\n## Files\n## Generally Useful Commands\n## Misc Useful Commands and Tools","[{\"question\":\"What test syntax and operators are shown for conditional checks?\",\"answer\":\"It shows using an if statement with test brackets like if [ “$x” -lt “$y” ]; then ... fi to compare values before running commands.\"},{\"question\":\"How can logical conditional execution be performed?\",\"answer\":\"The sheet uses operators such as cmd1 || cmd2 to run cmd2 only if cmd1 fails, and cmd1 \\u0026\\u0026 cmd2 to run cmd2 only if cmd1 succeeds.\"},{\"question\":\"Which tools are listed for searching and text processing?\",\"answer\":\"It includes grep/egrep for matching patterns, awk for printing a specific word field, sed for replacing text in files, and find for locating files by name or type.\"}]","Shell Scripting Cheat Sheet for Unix and Linux - v1.3 - quick reference | PDF",1791938001]