[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-571661-105":53,"doc-detail-571661-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","cheatsheet-sec301-401-terminal-command-line-basics-tools-and-tips","Cheatsheet SEC301-401 - Terminal & Command Line Basics - Tools and Tips","","Cheatsheet SEC301-401 for Windows and Linux terminal usage, focusing on practical command-line tasks. Covers working directories, listing and copying or deleting files, viewing and editing text output, and combining file contents. Explains authentication context with whoami, handling command errors, locating files, and checking environment variables such as PATH. Includes process and system inspection commands (ports, tasks, startup services, hostname) and common host scanning and connectivity tools (nmap, ping, nc), plus getting help for commands.",{"@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":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/cheatsheet-sec301-401-terminal-command-line-basics-tools-and-tips/571661/",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/cheatsheet-sec301-401-terminal-command-line-basics-tools-and-tips/571661.png","ImageObject",442,249,{"name":88,"@type":89},"dabgoudw","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-22","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":101},"InteractionCounter",{"@type":100},"ViewAction",8,{"@type":103,"mainEntity":104},"FAQPage",[105,111,115],{"name":106,"@type":107,"acceptedAnswer":108},"How do I distinguish Windows, Linux, and privileged Linux commands in this cheatsheet?","Question",{"text":109,"@type":110},"The cheatsheet uses c:\\> for Windows cmd.exe commands, user$ for Linux commands, and root\\# for Linux commands requiring privileged execution as the root user.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"What commands help me navigate and manage files from the terminal?",{"text":114,"@type":110},"Use cd to change directory and pwd to show the current directory, dir/ls-l to list files, copy/cp to copy, erase/rm to delete, and type/cat (with more/less) to view contents.",{"name":116,"@type":107,"acceptedAnswer":117},"How can I scan for open ports and identify what a host exposes?",{"text":118,"@type":110},"Use nmap to scan a specific host, a subnet range, or all 65,536 ports; then use nc to connect to a port such as 25 to see the banner it returns.","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},571661,1792014482,{"code":4,"msg":5,"data":128},{"doc_id":125,"user_id":129,"nickname":88,"user_avatar":130,"doc_module":9,"category_id":8,"category_name":11,"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":73,"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},3985747860484,"https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c","Windows and Linux  \nTerminals & Command Lines  \nTools and Tips for SEC301 and SEC401  \nGetting started:  \n• c:\\> denotes a command to be run from Windows’cmd.exe  \n• user$ is for a Linux command  \n• root\\# means the Linux command needs to be run asa privileged, root user  \n• Linux commands are generally casesensitive; Windows commands are generally not  \n• Mac terminals will, in most ways, act like Linux/Bash  \nterminals  \n What directory am I in?   \nc:\\> cd user$ pwd  \n What files are in this directory?   \nc:\\> dir user$ ls-l  \nCopy a file  \nc:\\> copy file.txt copy.txt user$ cp file.txt copy.txt  \nErase a file  \nc:\\> erase file.txt user$ rm file.txt  \nPrint the contents of a file to the screen  \nc:\\> type file.txt  \nuser$ cat file.txt (Just dump the raw file) user$ strings file.txt (Dump only the readable characters)  \nSee one screen at a time  \nc:\\> type file.txt | more user$ cat file.txt | more  \nuser$ more file.txt (Same, just shorter) user$ less file.txt (Same, but you can go up and down; q to quit)  \nPut text into a file  \nc:\\> echo “Four score” > 1.txt user$ echo “Four score” > 1.txt  \nAdd text to a file  \nc:\\> echo “and seven years” >> 1.txt user$ echo “and seven years” >> 1.txt  \nCombine two files  \nc:\\> type 1.txt 2.txt > 3.txt user$ cat 1.txt 2.txt > 3.txt  \n Check who you’re logged in as   \nc:\\> whoami user$ whoami  \nHide command error messages  \nc:\\> YOUR COMMAND 2>nul  \nuser$ YOUR COMMAND 2>/dev/null  \n Find files in a filesystem   \nc:\\> dir c:\\ /b/s | find “password”user$ find / -name *password*  \nuser$ locate password (same, but faster) root\\# updatedb (update the database for locate by indexing everything in the drive)  \nView all environment variables  \nc:\\> set user$ env  \nView one environment variable  \nc:\\> set Path  \nc:\\> echo %Path% user$ env | grep PATH user$ echo $PATH  \nWhat are environment variables?  \nThey give your terminal context for running certain commands. For example, the PATH variable, in most operation systems, tells your terminal which directories to look in for programs when you type one in.  \nNote: the current directory, . (period), isin the Windows path by default-but not in Linux. So in Linux, we must be explicit when running something in our current working directory:  \nRun john when it’s in your directory  \nc:\\> john.exe user$ ./john  \nSee which ports the computer is listening for connections on  \nc:\\> netstat-nao  \nc:\\> netstat-naob (Same, but lists process name; requires Administrator)  \nuser$ netstat-ant  \nroot\\# netstat-pant (Same, but lists pid and name; requires root)  \nLook for lines containing specific text, e.g. 9999  \nc:\\> netstat-naob | find 9999  \nroot\\# user$ netstat-pant | grep 9999  \n See what tasks are running   \nc:\\> tasklist  \nc:\\> wmic process list full (Same, more info) user$ ps-aux  \nGet more info about a specific process id, e.g. 45  \nc:\\> wmic process where ProcessID=45 user$ ps-Flww-p 45  \n Check the system’s hostname   \nc:\\> hostname user$ hostname  \nList processes that run at startup  \nc:\\> wmic startup full list user$ ls-l /etc/init.d  \nuser$ crontab-l  \nuser$ systemctl list-unit-files | grep enabled  \nuser$ less /home/user/. bashrc  \n(There are other places where startup tasks can be stored in Linux, but these are the most common)  \nScan a host to look for open ports, e.g. [192.168.1.100](192.168.1.100)  \nc:\\> nmap [192.168.1.100](192.168.1.100)[ ](192.168.1.100)user$ nmap [192.168.1.100](192.168.1.100)  \nScan a subnet of hosts and see what is really running on open ports  \nc:\\> nmap [192.168.1.1](192.168.1.1)-254-sV user$ nmap [192.168.1.1](192.168.1.1)-254-sV  \n Scan all 65,536 ports on a given host   \nc:\\> nmap [192.168.1.100](192.168.1.100)-p0-65535 user$ nmap [192.168.1.100](192.168.1.100)-p0-65535  \nPing another host four times  \nc:\\> ping [192.168.1.200](192.168.1.200)[ ](192.168.1.200)user$ ping-c4 [192.168.1.200](192.168.1.200)  \nConnect to port 25 to see what banner it sends back,  \ne.g. SMTP or 25/TCP  \nc:\\> nc.exe [192.168.1.100](192.168.1.100) ","cbCairDDTmEDIHk3","https://ap.wps.com/l/cbCairDDTmEDIHk3","pdf",979471,"English","# Getting started\n## Windows cmd vs Linux terminal conventions\n# Directories and files\n## Current directory, listing, copy, erase\n## Viewing and editing file contents\n## Pipes and pagers (more/less)\n# Identity, errors, environment\n## whoami and command error redirection\n## Environment variables and PATH\n# System and process inspection\n## Ports, tasks, processes, hostname\n## Startup services and run-at-startup entries\n# Host discovery and networking\n## find open ports, scan subnets, scan all ports\n## Ping and service banner grabbing\n## Command help and executable paths","[{\"question\":\"How do I distinguish Windows, Linux, and privileged Linux commands in this cheatsheet?\",\"answer\":\"The cheatsheet uses c:\\\\\\u003e for Windows cmd.exe commands, user$ for Linux commands, and root\\\\# for Linux commands requiring privileged execution as the root user.\"},{\"question\":\"What commands help me navigate and manage files from the terminal?\",\"answer\":\"Use cd to change directory and pwd to show the current directory, dir/ls-l to list files, copy/cp to copy, erase/rm to delete, and type/cat (with more/less) to view contents.\"},{\"question\":\"How can I scan for open ports and identify what a host exposes?\",\"answer\":\"Use nmap to scan a specific host, a subnet range, or all 65,536 ports; then use nc to connect to a port such as 25 to see the banner it returns.\"}]","Cheatsheet SEC301-401 - Terminal & Command Line Basics - Tools and Tips | PDF",1791923019]