ShellSpells
  • 🧙‍♂️Welcome!
    • ShellSpells
    • FAQs
    • License & Disclaimer
  • 🐧Linux
    • System Ops
      • Transcripts
      • Help
      • System Info
        • Date/Time
        • System Details
        • Patches & Updates
        • Init System Identification
        • Hostname / Host ID
        • Variables
        • Hardware & Resources
      • Filesystem
        • Traverse & Enumerate
        • Drives & Partitions
        • Shares
        • Packages
        • Connected Devices
        • Kernel Modules (Drivers)
      • Users & Groups
        • Enumerate
        • Modify
      • Network
        • Enumerate
        • Modify
      • Scheduled Jobs
        • Enumerate
        • Modify
      • Processes
        • Enumerate
        • Modify
        • Custom Script and Shared Object
        • Process I/O Redirection
      • Services
        • Enumerate
        • Modify
        • Create a Service
      • Startup/Boot Scripts
        • Enumerate
        • Modify
      • Security
        • Antivirus
        • Firewall
        • SSH Keys
      • History & Logs
        • History
        • Logs
    • File Ops
      • Search
        • Filename
        • Content
        • Users (Owners)
        • Time
        • Size
        • Permission
        • Hidden Files
        • Inode
        • Find + Exec
        • Notes
      • Enumerate Metadata
      • Modify Metadata
      • Read Content
      • Modify Content
      • Extract Content
      • Sort / Compare / Count
      • Move
      • Copy
      • Execute
      • Hash
      • Encode/Decode
      • Compress/Decompress
      • Working With Weird Filenames
    • Terminal Ops
      • Keyboard Shortcuts
      • Tmux Shortcuts
  • 🪟Windows
    • System Ops
      • Transcripts
      • Help
      • System Info
        • One-liners
        • Date/Time
        • System Details
        • Hotfixes
        • Domain or Workgroup
        • Data Execution Prevention
        • Variables
        • Hardware & Resources
      • Filesystem
        • Traverse & Enumerate
        • Drives & Partitions
        • Installed Software
        • Drivers
        • Shares
      • Registry
        • Enumerate
        • Modify
        • Forensically Relevant Keys
      • Users & Groups
        • Enumerate
        • Modify
      • Network
        • Enumerate
        • Modify
      • Scheduled Tasks
      • Processes
        • Enumerate
        • Modify
      • Services
        • Enumerate
        • Modify
      • Autorun / Startup
        • Enumerate
        • Modify
      • Security
        • Permissions
          • Enumerate
          • Page
        • Antivirus
        • Firewall
          • Enumerate
          • Modify
        • Audit Policies
        • Remoting
          • Enumerate
          • Modify
          • Registry Locations
        • Stored Credentials
      • Remote Command Execution
      • Active Directory
        • Enumerate
        • Modify
      • History & Logs
        • History
        • Logs
      • PowerShell Config
      • Scripting
      • WMIC Notes
    • File Ops
      • Search
        • Filename
        • Time
        • Size
        • Permissions
        • Attributes
        • Wildcarding
      • Enumerate Metadata
        • One Liners
        • Users (Owners)
        • Timestamps
        • Size
        • Permissions
        • Attributes
      • Modify Metadata
        • Change Owner
        • Timestamps
        • Size
        • Attributes
      • Read Content
      • Modify Content
        • Overwrite
        • Insert
        • Append
        • Replace / Remove
        • Convert Case
        • Alternate Data Streams
      • Extract Content
      • Sort / Compare / Count
        • Sort
        • Count
        • Compare
      • Move
      • Copy
      • Execute
      • Hash
      • Encode/Decode
      • Compress/Decompress
      • Working With Weird Filenames
      • Output Formatting / Filtering
      • File Formatting
      • Operators
  • ⛓️Network
    • Traffic Manipulation
      • iptables
        • Option List
        • General Commands
        • Filter Tables
        • NAT
        • Mangle
        • Filter for SSH Traffic (Example)
      • nftables
    • Packet Capture
      • Syntax
      • TCPDump Examples
    • Packet Analysis
      • Wireshark
  • 🚗Maneuver
    • SSH
    • Control Sockets
    • RDP
    • Windows Port Proxy
  • 🛩️Data Transfer
    • SCP
    • FTP
    • Netcat
      • Netcat Relays
    • Server Interactions
    • Alternate Methods
  • 🪄REGEX
    • Examples
Powered by GitBook
On this page
  • Enumerate
  • Modify
  • Sourcing files
  • Environment Variables
  • File Locations

Was this helpful?

  1. Linux
  2. System Ops
  3. System Info

Variables

Enumerate

env

Displays environment variables.

printenv

Similar to env, also lists environment variables.

set

Lists shell variables and functions (bash-specific).

declare -p

Lists shell variables with their attributes (bash-specific).

export

Displays exported variables (visible to child processes).

Modify

export VAR_NAME=VALUE

Sets an environment variable for the current shell and child processes.

VAR_NAME=VALUE

Sets a variable for the current shell only (not inherited by child processes).

Sourcing files

Use source filename or . filename to import variables from a file into the current shell environment.

Environment Variables

PATH

Contains a colon-separated list of directories where executable files are located.

HOME

Stores the absolute path to the user's home directory.

USER (or LOGNAME)

Contains the username of the currently logged-in user.

SHELL

Specifies the default shell for the user.

PS1

Defines the primary shell prompt.

PS2

Defines the secondary prompt used when entering multi-line commands.

PS3

Specifies the prompt for the select loop in shell scripts.

PS4

Specifies the prompt for debugging shell scripts with the -x option.

PWD

Holds the current working directory.

OLDPWD

Contains the previous working directory.

TZ

Specifies the system's timezone.

IFS

Defines the Internal Field Separator, which is used to separate words in shell commands.

TERM

Specifies the type of terminal or terminal emulator being used.

EDITOR

Sets the default text editor used by some command-line utilities.

VISUAL

Specifies the default visual (graphical) editor used by some utilities.

LANG

Specifies the default system language and localization settings.

LC_*

A family of variables used for localization and character encoding settings.

MAIL

Points to the location of the user's mailbox or mail spool file.

MAILCHECK

Specifies how often to check for new mail.

MAILPATH

Contains a list of files to check for new mail.

LD_LIBRARY_PATH

Lists directories where the dynamic linker/loader searches for shared libraries.

LD_PRELOAD

Specifies shared libraries to be loaded before all others when a program is run.

MANPATH

Defines the path to the directory containing manual pages (man pages).

File Locations

Environment Variables

Often set in startup scripts like .bashrc, .bash_profile, or system-wide configuration files.

User Environment Variables

Typically set in the user's shell initialization files (e.g., .bashrc, .bash_profile, .profile) or by using the export command in the shell.

System Environment Variables

System-wide environment variables can be set in system-wide initialization scripts, such as /etc/environment on some Linux distributions.

Global System Variables

Some system-level variables are stored in system configuration files or directories. These can include variables related to network configuration, system parameters, and system behavior. These variables are often stored in files located in /etc or other system directories.

User-Specific Configuration Files

User-specific configuration files may store variables related to a specific user's environment and preferences. For example, the ~/.bashrc or ~/.bash_profile files can contain user-specific variables and configurations.

PreviousHostname / Host IDNextHardware & Resources

Last updated 1 year ago

Was this helpful?

🐧