TCM Security Academy Notes - by syselement
🏠 Home BlogGitHub📚 Buy Me a Book
  • TCM Security Academy Notes
  • Courses
    • TCM - Linux 101
      • 1. Introduction
        • Linux Distributions
        • Installing Linux
      • 2. Command Line
        • Intro to Command Line
        • Getting help on the Command Line
        • Command Line Arguments and Options
        • Reading Text Files
      • 3. File System
        • Filesystem Hierarchy Standard
        • Devices, Partitions and Mounting
        • Absolute and Relative Paths
        • Files and Directories
        • Paths, Filenames and Text Files
        • Filesystem Links
        • Archiving and Searching Files
      • 4. Users and Groups
        • Working with Users and Groups
        • File and Directory Permissions
        • Changing Users and Passwords
      • 5. Installing Software
        • Package Management
      • 6. Shells
        • Common Command Line Shells
        • Environment Variables & Startup Files
        • Input/Output Redirection
        • Command History & Substitution
      • 7. Utilities and File Editors
        • Searching and Processing Text
        • Networking at the Command Line
        • File Transfer
        • Text Editors and Converters
      • 8. Process Management
        • Process Information
        • Foreground and Background Processes
        • Managing Processes
        • Scheduling Processes
      • 9. Regular Expressions
        • Regular Expressions, Searching, Replacing, Building
      • 10. Bash Scripting
        • Bash Scripting Basics, Control Structures, Loops
      • 🌐Linux101 References
    • TCM - Mobile Application Penetration Testing
      • 1. Introduction & Mobile Pentesting
      • 2. Android Security
      • 3. Android Lab Setup
      • 4. Android Static Analysis
      • 5. Android Dynamic Analysis
      • 6. Android Bug Bounty
      • 7. iOS Security
      • 8. iOS Lab Setup
      • 9. iOS Static Analysis
      • 10. iOS Dynamic Analysis
      • 11. iOS Bug Bounty
      • 🌐MAPT References
    • TCM - Practical Ethical Hacking
      • 1. Introduction & Networking
      • 2. Lab Set Up, Linux & Python
        • Intro to Kali Linux
        • Intro to Python
      • 3. The Ethical Hacker Methodology
        • Information Gathering
        • Scanning & Enumeration
        • Vulnerability Scanning with Nessus
        • Exploitation Basics
        • Capstone Practical Labs
      • 4. Active Directory
        • Active Directory Lab
        • AD - Initial Attack Vectors
        • AD - Post-Compromise Enumeration
        • AD - Post-Compromise Attacks
        • AD - Additional Attacks
        • AD - Case Studies
      • 5. Post Exploitation
      • 6. Web Application
        • Web App Lab Setup
        • Web App - SQL Injection
        • Web App - XSS
        • Web App - Command Injection
        • Web App - Insecure File Upload
        • Web App - Authentication Attacks
        • Web App - XXE
        • Web App - IDOR
        • Web App - Capstone Practical Lab
      • 7. Wireless Attacks
      • 8. Legal Documentation & Report Writing
      • 🌐PEH References
  • 🏠syselement's Blog Home
Powered by GitBook
On this page
  • Help Commands
  • man
  • info
  • command --help
  • Explain Shell

Was this helpful?

Edit on GitHub
  1. Courses
  2. TCM - Linux 101
  3. 2. Command Line

Getting help on the Command Line

Help Commands

man

  • man - Manual page for commands

  • Content is organized in different sections (Name, Synopsis, Description of the arguments, Examples)

  • Press q to exit the man page.

man ls
# man page for the ls command
	LS(1)                                   User Commands                                   LS(1)
	NAME
	       ls - list directory contents
	SYNOPSIS
	       ls [OPTION]... [FILE]...
	DESCRIPTION
	       List information about the FILEs (the current directory by default).  Sort entries
	       alphabetically if none of -cftuvSUX nor --sort is specified.
	       Mandatory arguments to long options are mandatory for short options too.
	       -a, --all
	              do not ignore entries starting with .
	       -A, --almost-all
	              do not list implied . and ..
	       --author
	              with -l, print the author of each file
	       -b, --escape
	              print C-style escapes for nongraphic characters
	       --block-size=SIZE
	              with -l, scale sizes by SIZE when printing them;  e.g.,  '--block-size=M';  see
	              SIZE format below
	       -B, --ignore-backups
	              do not list implied entries ending with ~
	       -c     with  -lt:  sort  by, and show, ctime (time of last modification of file status
	              information); with -l: show ctime and sort by name; otherwise: sort  by  ctime,
	              newest first
	       -C     list entries by columns
	       --color[=WHEN]
	              colorize  the  output;  WHEN  can  be 'always' (default if omitted), 'auto', or
	              'never'; more info below
	       -d, --directory
	              list directories themselves, not their contents
	[...]

info

  • info - a document-like structured replacement for man pages. More in depth information about the command.

info ls
	# Next: dir invocation,  Up: Directory listing
	# 
	# 10.1 ‘ls’: List directory contents
	# ==================================
	# 
	# The ‘ls’ program lists information about files (of any type, including
	# directories).  Options and file arguments can be intermixed arbitrarily,
	# as usual.
	# 
	#    For non-option command-line arguments that are directories, by
	# default ‘ls’ lists the contents of directories, not recursively, and
	# omitting files with names beginning with ‘.’.  For other non-option
	# arguments, by default ‘ls’ lists just the file name.  If no non-option
	# argument is specified, ‘ls’ operates on the current directory, acting as
	# if it had been invoked with a single argument of ‘.’.
	# 
	#    By default, the output is sorted alphabetically, according to the
	# locale settings in effect.(1)  If standard output is a terminal, the
	# output is in columns (sorted vertically) and control characters are
	# output as question marks; otherwise, the output is listed one per line
	# and control characters are output as-is.
	# 
	#    Because ‘ls’ is such a fundamental program, it has accumulated many
	# options over the years.  They are described in the subsections below;
	# within each section, options are listed alphabetically (ignoring case).
	# The division of options into the subsections is not absolute, since some
	# options affect more than one aspect of ‘ls’’s operation.
	# [...]

command --help

  • Documentation built into the command, reformated and abbreviated, with specific options usage.

ls --help
	Usage: ls [OPTION]... [FILE]...
	List information about the FILEs (the current directory by default).
	Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.
	
	Mandatory arguments to long options are mandatory for short options too.
	  -a, --all                  do not ignore entries starting with .
	  -A, --almost-all           do not list implied . and ..
	      --author               with -l, print the author of each file
	  -b, --escape               print C-style escapes for nongraphic characters
	      --block-size=SIZE      with -l, scale sizes by SIZE when printing them;
	                               e.g., '--block-size=M'; see SIZE format below
	  -B, --ignore-backups       do not list implied entries ending with ~
	  -c                         with -lt: sort by, and show, ctime (time of last
	                               modification of file status information);
	                               with -l: show ctime and sort by name;
	                               otherwise: sort by ctime, newest first
	  -C                         list entries by columns
	      --color[=WHEN]         colorize the output; WHEN can be 'always' (default
	                               if omitted), 'auto', or 'never'; more info below
	  -d, --directory            list directories themselves, not their contents
	  -D, --dired                generate output designed for Emacs' dired mode
	  -f                         do not sort, enable -aU, disable -ls --color
	  -F, --classify             append indicator (one of */=>@|) to entries
	      --file-type            likewise, except do not append '*'
	      --format=WORD          across -x, commas -m, horizontal -x, long -l,
	                               single-column -1, verbose -l, vertical -C
	      --full-time            like -l --time-style=full-iso
	  -g                         like -l, but do not list owner
	      --group-directories-first
	                             group directories before files;
	                               can be augmented with a --sort option, but any
	                               use of --sort=none (-U) disables grouping
	  -G, --no-group             in a long listing, don't print group names
	[...]

Explain Shell


PreviousIntro to Command LineNextCommand Line Arguments and Options

Last updated 2 years ago

Was this helpful?

📌 Get more information and explanation of complex shell commands at and .

explainshell.com
shell.how