argv0(1)
π argv0(1) β the glow-up π
okay bestie, welcome to argv0, a lil cutie from the General Commands Manual section 1, and honestly? she's serving. this is the page that teaches you how to run a program with a specified 0th argument, which sounds nerdy but is lowkey iconic once you get it. iykyk π
β¨ NAME β¨
argv0 β runs a program with a specified 0th argument. that's the whole vibe. short, sweet, powerful. periodt.
πΈ SYNOPSIS πΈ
argv0 realname zero args
three things, bestie: a real name, a zero, and then however many args your heart desires π«Ά
π¦ DESCRIPTION π¦
okay so listen up, here's the tea β
realnameis one argument. just one. don't be greedy.zerois one argument. also just one.argsis any number of arguments. go wild, go feral, bring the whole group chat.
and then argv0 does its main character thing: it runs the program stored as realname on disk, with zero as the 0th argument (rather than realname) and args as the remaining arguments. literally switching up the identity of the program before it even wakes up. the way that it just does that π
π APPLICATIONS π
so why do we even care? because some programs pay special attention to the 0th argument, and argv0 makes these programs usable from shell scripts. it's giving β¨adaptableβ¨
for example, this:
argv0 /bin/csh -csh
runs /bin/csh with a 0th argument of -csh. and /bin/csh will think it is a login shell and behave accordingly. like bestie just put on a costume and fully committed to the role π
as another example, the command:
tcpserver 0 ftp argv0 tcpd ftpd -l -A
has a similar effect to the line:
ftp stream tcp nowait root tcpd ftpd -l -A
in /etc/inetd.conf. the tcpd program is run with 0th argument ftpd and remaining arguments -l -A. no cap.
β οΈ note thattcpdcan and should be replaced by the-xoption oftcpserver(1)β bestie said don't do the old way, do this instead:
tcpserver -x ftp.tcp 0 ftp ftpd -l -A
slay. upgrade your life. π
π SEE ALSO π
the whole friend group, gather round π«Ά:
tcpserver(1)tcprules(1)tcprulescheck(1)fixcrio(1)recordio(1)rblsmtpd(1)tcpclient(1)who@(1)date@(1)finger@(1)http@(1)tcpcat(1)mconnect(1)tcp-environ(5)
and if you wanna go down the rabbit hole (and you should, bestie):
http://cr.yp.to/ucspi-tcp.html
and that's the whole page, mwah π this was argv0(1) from the General Commands Manual β that's the title card and the lil sign-off footer, same name top and bottom like a lil signature. no date or version was listed, so we keep it mysterious. stay iconic, go run some programs with fake 0th arguments, and remember: the 0th argument is the moment before the plot twist π
π¦ where this page comes from
- debian bookworm: ucspi-tcp 1:0.88-7 Β· LicenseRef-public-domain
- debian trixie: ucspi-tcp 1:0.88-13 Β· LicenseRef-public-domain
- nixos 26.05: ucspi-tcp 0.88
- nixpkgs unstable: ucspi-tcp 0.88
- ubuntu jammy: ucspi-tcp 1:0.88-6 Β· LicenseRef-public-domain
- ubuntu noble: ucspi-tcp 1:0.88-8ubuntu1 Β· LicenseRef-public-domain
- ubuntu resolute: ucspi-tcp 1:0.88-13ubuntu1 Β· LicenseRef-public-domain
- ubuntu stonking: ucspi-tcp 1:0.88-13ubuntu1 Β· LicenseRef-public-domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms