[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-571632-105":53,"doc-detail-571632-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","linux-cheat-sheet","Linux Cheat Sheet","","Linux Cheat Sheet consolidates essential command-line knowledge for everyday system use. It covers working with files and directories, common path shortcuts, symbolic and hard links, searching files and content, and practical redirection and piping. The sheet also includes text-processing utilities, sorting and filtering workflows, archive and compression commands, glob patterns, brace expansion, shell environment variables, command-line shortcuts, privilege escalation, and permission and ownership management.",{"@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/linux-cheat-sheet/571632/",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/linux-cheat-sheet/571632.png","ImageObject",442,249,{"name":88,"@type":89},"pixelkiddo","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-25","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":101},"InteractionCounter",{"@type":100},"ViewAction",7,{"@type":103,"mainEntity":104},"FAQPage",[105,111,115],{"name":106,"@type":107,"acceptedAnswer":108},"How do I view a file’s contents or paginate it?","Question",{"text":109,"@type":110},"Use cat \u003Cfile> to print file contents, or less \u003Cfile> to page through them. Use head \u003Cfile> and tail \u003Cfile> to show the first or last lines.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"How can I search for text inside files or within a directory?",{"text":114,"@type":110},"Use grep \u003Cpattern> \u003Cfile> for a single file and grep -r \u003Cpattern> \u003Cdir> to search recursively in a directory. Options like -i enable case-insensitive search, and -n prints matching line numbers.",{"name":116,"@type":107,"acceptedAnswer":117},"How do I redirect output and connect commands with pipes?",{"text":118,"@type":110},"Redirect stdout with > \u003Cfile> or append with >> \u003Cfile>, and redirect stdin with \u003C \u003Cfile>. Combine commands using | to pipe stdout, and note that &> and |& are bash/zsh extensions for redirecting both streams.","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},571632,1792083955,{"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":76,"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":9},962090883892,"https://ap-avatar.wpscdn.com/avatar/e00115db34f3e0f11b?x-image-process=image/resize,m_fixed,w_180,h_180&k=1790152879550218658","Linux Cheat Sheet  \n| Working with ﬁles |  |\n| --- | --- |\n| Command | Description |\n| cat \u003Cfile> | Print ﬁle contents |\n| less \u003Cfile> | Page through ﬁle contents |\n| touch \u003Cfile> | Create ﬁle (or update timestamp) |\n| cp \u003Csrc> \u003Cdest> | Copy a ﬁle |\n| mv \u003Csrc> \u003Cdest> | Move / rename a ﬁle |\n| rm \u003Cfile> | Remove ﬁle |\n| head \u003Cfile> | Print ﬁrst 10 lines of ﬁle |\n| tail \u003Cfile> | Print last 10 lines of ﬁle |\n| tail -f \u003Cfile> | Follow the ﬁle as it grows |\n|  |  |\n| Working with directories |  |\n| Command | Description |\n| ls | List ﬁles in this directory |\n| ls -l | List ﬁles with details |\n| ls -al | List all ﬁles with details |\n| pwd | Print the working directory |\n| cd \u003Cdir> | Change to \u003Cdir> |\n| cd .. | Go up one directory |\n| mkdir \u003Cdir> | Create directory |\n| mkdir -p \u003Cdir> | Create directory, with parents |\n| cp -r \u003Csrc> \u003Cdest> | Copy directory and contents |\n| rmdir \u003Cdir> | Remove an empty directory |\n| rm -r \u003Cdir> | Remove directory and contents |\n|  |  |\n| Path shorthands |  |\n| Path | Refers to |\n| . | Current directory |\n| .. | Parent directory |\n| ~ | Home directory |\n\n\n| Symbolic and hard links |  |  |  |  |  |  |\n| --- | --- | --- | --- | --- | --- | --- |\n| Command |  |  |  |  |  | Description |\n| ln -s \u003Ctarget> \u003Clink> |  |  |  |  |  | Create symbolic link |\n| ln \u003Ctarget> \u003Clink> |  |  |  |  |  | Create hard link |\n| realpath \u003Cfile> |  |  |  |  |  | Print absolute path of ﬁle |\n|  |  |  |  |  |  |  |\n| Searching ﬁles and content |  |  |  |  |  |  |\n| Command |  |  |  |  |  | Description |\n| grep | \u003Cpattern> \u003Cfile> |  |  |  |  | Search for pattern in ﬁle(s) |\n| grep | -r \u003Cpattern> \u003Cdir> |  |  |  |  | Search recursively in a directory |\n| grep -i \u003Cpattern> \u003Cfile> Search case-insensitively |  |  |  |  |  |  |\n| grep -v \u003Cpattern> \u003Cfile> Show lines not matching pattern |  |  |  |  |  |  |\n| grep -n \u003Cpattern> \u003Cfile> Search and print line numbers |  |  |  |  |  |  |\n| find \u003Cdir> -name'\u003Cpattern>' |  |  |  |  |  | Find by name (quote the pattern) |\n| find | \u003Cdir> |  |  | -type | f | Find regular ﬁles |\n| find | \u003Cdir> |  |  | -type | d | Find directories |\n| Redirecting input and output |  |  |  |  |  |  |\n| Command |  |  |  |  | Description |  |\n| \u003Ccmd> |  | > \u003Cfile> |  |  | \u003Cbr>Write output to ﬁle (overwrite) |  |\n| \u003Ccmd> |  | >> \u003Cfile> |  |  | Append output to ﬁle |  |\n| \u003Ccmd> |  | \u003C \u003Cfile> |  |  | \u003Cbr>Redirect input from ﬁle |  |\n| \u003Ccmd> |  | 2> \u003Cfile> |  |  | Redirect stderr to ﬁle |  |\n| \u003Ccmd> |  | &> \u003Cfile> |  |  | \u003Cbr>Redirect stdout and stderr |  |\n|  |  |  |  |  |  |  |\n| Pipes |  |  |  |  |  |  |\n| Command |  |  |  |  | Description |  |\n| \u003Ccmd1> |  |  | | \u003Ccmd2> |  | \u003Cbr>Pipe stdout to next cmd |  |\n| \u003Ccmd1> |  |  | |& \u003Ccmd2> |  | Pipe stdout and stderr onward |  |\n\n&> and |& are bash/zsh extensions. In POSIX sh, use > \u003Cfile> 2>&1 and 2>&1 |.  \n\n| Processing text |  |\n| --- | --- |\n| Command | Description |\n| sort | Sort lines alphabetically |\n| sort -u | Sort lines and remove duplicates |\n| uniq -c | Count repeated adjacent lines |\n| wc -l | Count lines |\n| cut -d: -f1 | Print ﬁrst colon-separated ﬁeld |\n| sed 's/\u003Cold>/\u003Cnew>/g' | Replace \u003Cold> with \u003Cnew> |\n| awk '{print $1}' | Print the ﬁrst ﬁeld |\n| tee \u003Cfile> | Write stdout to ﬁle and screen |\n| xargs \u003Ccmd> | Build a command from stdin |\n|  |  |\n| Archives and compression |  |\n| Command | Description |\n| tar -czf \u003Carchive> \u003Cdir> Create a gzipped tar archive |  |\n| tar -xzf \u003Carchive> | Extract a gzipped tar archive |\n| gzip \u003Cfile> | Compress a ﬁle |\n| gunzip \u003Cfile.gz> | Decompress a ﬁle |\n| zless \u003Cfile.gz> | Read without decompressing |\n| zip -r \u003Carchive> \u003Cdir> | Create a zip archive |\n| unzip \u003Carchive> | Extract a zip archive |\n|  |  |\n| Glob patterns |  |\n| Pattern | Matches |\n| * | Any number of characters |\n| ? | Exactly one character |\n| [abc] | One character from the set |\n| [!abc] | One character not in the set |\n\nQuote them ( '* .txt') to stop the shell expanding them.  \n© Nth Root Software Consultancy. Licensed under CC BY-ND 4.0  — Version: August 12, ","cbCaiijTjXqHmwUR","https://ap.wps.com/l/cbCaiijTjXqHmwUR","pdf",93982,"English","# Working with files\n# Working with directories\n# Path shorthands\n# Symbolic and hard links\n# Searching files and content\n# Redirecting input and output\n# Pipes\n# Processing text\n# Archives and compression\n# Glob patterns\n# Chaining commands\n# Brace expansion (bash/zsh)\n# Shell environment\n# Command line shortcuts\n# Privilege escalation\n# Changing permissions and ownership","[{\"question\":\"How do I view a file’s contents or paginate it?\",\"answer\":\"Use cat \\u003cfile\\u003e to print file contents, or less \\u003cfile\\u003e to page through them. Use head \\u003cfile\\u003e and tail \\u003cfile\\u003e to show the first or last lines.\"},{\"question\":\"How can I search for text inside files or within a directory?\",\"answer\":\"Use grep \\u003cpattern\\u003e \\u003cfile\\u003e for a single file and grep -r \\u003cpattern\\u003e \\u003cdir\\u003e to search recursively in a directory. Options like -i enable case-insensitive search, and -n prints matching line numbers.\"},{\"question\":\"How do I redirect output and connect commands with pipes?\",\"answer\":\"Redirect stdout with \\u003e \\u003cfile\\u003e or append with \\u003e\\u003e \\u003cfile\\u003e, and redirect stdin with \\u003c \\u003cfile\\u003e. Combine commands using | to pipe stdout, and note that \\u0026\\u003e and |\\u0026 are bash/zsh extensions for redirecting both streams.\"}]","Linux Cheat Sheet | PDF",1791922839]