j.gillis
j.gillis

Reputation: 225

What format are command line arguments stored in linux

I know that environment variables are stored in the processes memory but what format are command line arguments stored in?

Upvotes: 0

Views: 169

Answers (2)

Yash Lele
Yash Lele

Reputation: 11

In Linux, command line arguments are pushed on the stack with the count of arguments being on top of the stack. If you write an assembly language program, then you can read the command line arguments by popping them from the stack.

Upvotes: 1

Davis Herring
Davis Herring

Reputation: 39838

They're just stored with the environment as (more) null-terminated strings. Some software has been known to write to them (among other techniques) to display status information via ps(1).

Upvotes: 0

Related Questions