[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-571883-105":53,"doc-detail-571883-en":127},{"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":120,"head_meta":122,"extra_data":124,"updated_unix":126},105,"en","bash-cheat-sheet-quick-command-line-shortcuts","Bash Cheat Sheet - Quick command line shortcuts","","Bash Cheat Sheet compiles practical command line shortcuts for faster, more accurate shell use. It covers history navigation (reverse search, rerun commands, and argument reuse), file and directory operations, and terminal comfort features like colored output and grep/less highlighting. It also explains common redirections, examples for network checks, and key keyboard shortcuts for editing and cursor movement. Useful for Linux shell users seeking efficient workflows.",{"@graph":63,"@context":119},[64,80,102],{"@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":51,"@type":70,"position":76},"https://docshare.wps.com/template/general/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/bash-cheat-sheet-quick-command-line-shortcuts/571883/",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/bash-cheat-sheet-quick-command-line-shortcuts/571883.png","ImageObject",442,249,{"name":88,"@type":89},"Angel","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-24","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":101},"InteractionCounter",{"@type":100},"ViewAction",9,{"@type":103,"mainEntity":104},"FAQPage",[105,111,115],{"name":106,"@type":107,"acceptedAnswer":108},"How do you quickly rerun the last command in Bash?","Question",{"text":109,"@type":110},"Use `!!` to rerun the last command.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"How can you reuse arguments from a previous command?",{"text":114,"@type":110},"Use `!*` for all arguments, `!$` for the last argument, or `!:2` for the nth argument.",{"name":116,"@type":107,"acceptedAnswer":117},"How do you redirect both stdout and stderr to a file in Bash?",{"text":118,"@type":110},"Use `2>&1` when redirecting output to a file.","https://schema.org",{"og:url":78,"og:type":121,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":123,"canonical":78},"index,follow",{"doc_id":125,"site_id":56},571883,1792086996,{"code":4,"msg":5,"data":128},{"doc_id":125,"user_id":129,"nickname":88,"user_avatar":130,"doc_module":9,"category_id":50,"category_name":51,"doc_title":59,"doc_description":61,"doc_content":131,"file_id":132,"file_url":133,"file_type":134,"file_size":135,"view_count":101,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":9,"language":136,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":137,"faqs":138,"seo_title":139,"seo_description":61,"update_tm":140,"read_time":4},687207412472,"https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d","[Opensource.com](Opensource.com: Bash Cheat Sheet)[:](Opensource.com: Bash Cheat Sheet)[ Bash Cheat Sheet](Opensource.com: Bash Cheat Sheet) By Steve OvenS and Ian MIell  \nBecome more efficient at the command line with these handy Bash shortcuts.  \nHistory  \nReverse search: ctrl + r  \nRerun last command: !!  \nReuse arguments from previous command: !*  \nUse last argument of last command: !$  \nnth argument: !:2  \nAll the arguments: !:1-$  \nLast but n: !-2:$  \nGet the folder: !$:h  \nThe current line: !\\#:1  \nSearch and replace: !!:gs  \nAllow multiple terminals to write to the history file: shopt-s histappend  \nList the most used history commands: history | awk 'BEGIN {FS=\"[ \\t]+|\\\\|\"} {print $3}' | sort | uniq-c | sort-nr | head  \nFile and navigation  \ncp /home/foo/realllylongname.cpp{,-old}  \ncd  \nrename 's/text_to_find/been_renamed/' * .txt  \nexport CDPATH= '/var/log:~' (variable is used with the cd built-in.)  \ncolourize basH  \nEnable colors  \neval \" `dircolors-b`\"  \nForce ls to always use color and type indicators alias ls='ls-hF--color=auto'  \nMake the dir command work kinda like in windows (long format) alias dir='ls--color=auto--format=long'  \nMake grep highlight results using color export GREP_OPTIONS='--color=auto'  \nexport LESS_TERMCAP_mb=$'\\E[01;31m'  \nexport LESS_TERMCAP_md=$'\\E[01;33m'  \nexport LESS_TERMCAP_me=$ '\\E[0m'  \nexport LESS_TERMCAP_se=$ '\\E[0m' \\# end the info box  \nexport LESS_TERMCAP_so=$ '\\E[01;42;30m' \\# begin the info box  \nexport LESS_TERMCAP_ue=$ '\\E[0m'  \nexport LESS_TERMCAP_us=$ '\\E[01;36m'  \nrunning commands in sequence  \nRun second command if the first is successful: &&  \nRun second command regardless of success of first one: ;  \nredirecting i/o  \nRedirect stdout and stderr to a file: 2>&1  \ncHeck For open ports  \necho > /dev/tcp/\u003Cserver ip>/\u003Cport>`` (use back ticks to shell out)  \nkeyboard sHortcuts  \nCorrects typoos: shopt-s cdspell  \nUndo: ctrl + _  \nMove forward a word: ctrl + arrow  \nMove cursor to start: ctrl + a  \nMove cursor to end: ctrl + e  \nCuts everything after the cursor: ctrl + k  \nClears screen: ctrl + l  \nResume command that is in the foreground: ctrl + q  \nPause a long running command in the foreground: ctrl + s  \nSwap two characters: ctrl + t  \nCuts everything before the cursor: ctrl + u  \nOpens the command string in an editor so that you can edit it before it runs: ctrl + x + ctrl + e  \nExpand glob/star: ctrl + x + *  \nMove to the opposite end of the line: ctrl + xx  \nPastes from the buffer: ctrl + y  \nCopy/paste into terminal: ctrl + shift + c/v  \nexamine executable  \nwhich \u003Ccommand>  \nfile \u003Cpath/to/file>  \ncommand-V \u003Csome command binary> (tells you whether \u003Csome binary> is a built-in, binary or alias)  \nTopics LinuxBash  \ninFo  \n[1] [https://opensource.com/article/18/5/bash-tricks](https://opensource.com/article/18/5/bash-tricks)  \n[2] [https://opensource.com/article/19/10/bash-history-shortcuts](https://opensource.com/article/19/10/bash-history-shortcuts)  \n[opensource.com](opensource.com) [Twitter](Twitter @opensourceway | facebook.com/opensourceway | CC)[ @](Twitter @opensourceway | facebook.com/opensourceway | CC)[opensourceway](Twitter @opensourceway | facebook.com/opensourceway | CC)[ |](Twitter @opensourceway | facebook.com/opensourceway | CC)[ facebook.com/opensourceway](Twitter @opensourceway | facebook.com/opensourceway | CC)[ |](Twitter @opensourceway | facebook.com/opensourceway | CC)[ CC](Twitter @opensourceway | facebook.com/opensourceway | CC) BY-SA 4.0","cbCaisBBOLxp6YDK","https://ap.wps.com/l/cbCaisBBOLxp6YDK","pdf",113791,"English","# History\n## File and navigation\n# Running commands and I/O redirection\n# Keyboard shortcuts","[{\"question\":\"How do you quickly rerun the last command in Bash?\",\"answer\":\"Use `!!` to rerun the last command.\"},{\"question\":\"How can you reuse arguments from a previous command?\",\"answer\":\"Use `!*` for all arguments, `!$` for the last argument, or `!:2` for the nth argument.\"},{\"question\":\"How do you redirect both stdout and stderr to a file in Bash?\",\"answer\":\"Use `2\\u003e\\u00261` when redirecting output to a file.\"}]","Bash Cheat Sheet - Quick command line shortcuts | PDF",1791924227]