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
  • Commands
  • more
  • less
  • cat

Was this helpful?

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

Reading Text Files

Commands

more

  • more - look at the content of a text file page by page, by only moving forward in a file. Press q to quit.

less

  • less - look at the content of a text file, with more options than the more command, like line by line, up and down navigation, moving, searching, jumping.

    • Search is possible by using the slash - /word_to_search

    • Press q to quit.

# Some "less" Commands and Actions
Down arrow, Enter, e, or j - Move forward one line.
Up arrow,y or k	- Move backward one line.
Space bar or f - Move Forward one page.
b - Move Backward one page.
/pattern - Search forward for matching patterns.
?pattern - Search backward for matching patterns.
n - Repeat previous search.
N - Repeat previous search in reverse direction.
g - Go to the first line in the file.
Ng - Go to the N-th line in the file.
G - Go to the last line in the file.
p - Go to the beginning of fthe ile.
Np - Go to N percent into file.
h - Display help.
q - Exit less.

cat

  • cat - Concatenate or link the content of different files to standard output.

    • Useful when combined with redirection of the output.

cat --help
	Usage: cat [OPTION]... [FILE]...
	Concatenate FILE(s) to standard output.
	With no FILE, or when FILE is -, read standard input.
	  -A, --show-all           equivalent to -vET
	  -b, --number-nonblank    number nonempty output lines, overrides -n
	  -e                       equivalent to -vE
	  -E, --show-ends          display $ at end of each line
	  -n, --number             number all output lines
	  -s, --squeeze-blank      suppress repeated empty output lines
	  -t                       equivalent to -vT
	  -T, --show-tabs          display TAB characters as ^I
	  -u                       (ignored)
	  -v, --show-nonprinting   use ^ and M- notation, except for LFD and TAB
	      --help     display this help and exit
	      --version  output version information and exit
	Examples:
	  cat f - g  Output f's contents, then standard input, then g's contents.
	  cat        Copy standard input to standard output.
	  
	  # Send the content of more files to a new file
	  cat file1.txt file2.txt file3.txt > combined.txt
	  cat combined.txt
  • Display file contents:

cat /etc/os-release
	PRETTY_NAME="Ubuntu 22.04 LTS"
	NAME="Ubuntu"
	VERSION_ID="22.04"
	VERSION="22.04 LTS (Jammy Jellyfish)"
	VERSION_CODENAME=jammy
	ID=ubuntu
	ID_LIKE=debian
	HOME_URL="https://www.ubuntu.com/"
	SUPPORT_URL="https://help.ubuntu.com/"
	BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
	PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
	UBUNTU_CODENAME=jammy

PreviousCommand Line Arguments and OptionsNext3. File System

Last updated 2 years ago

Was this helpful?