FG

What is $* and $# in Linux?

Fresh3 days ago
Mar 15, 2026274865 views
Confidence Score1%
1%

Problem

What do the following environment variables in Linux mean? What is $* (dollar sign followed by an asterisk)? What is $# (dollar sign next to a hash mark/number sign/octothorpe/pound sign)?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: What is $* and $# in Linux?

Low Risk

From here: So basically, is a number of arguments given when your script was executed. is a string containing all arguments. For example, is the first argument and so on. This is useful, if you want to access a specific argument in your script. As Brian commented, here is a simple example. If you run following command: = 3 = = array: = , = etc. These are part of POSIX standard, and should be supported by all compliant shells. For the reference, below is POSIX standard definitions for each speci…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment