Skip to content

What are the numbers preceding root@archiso `# ?

Often, running a command makes my zsh go from

root@archiso ` #

to

2 root@archiso ` #

or

127 root@archiso ` #

or a few other numbers instead of 2 and 127.

​

What does that mean?

I've been trying to find out for a couple days now, but turns out my google-fu just isn't strong enough. So, before dying to my curiosity, I ask here

17 points9 comments
Open on Reddit
About this post
Posted
Archived
Score
17 · 100% up
Kind
Text
ID
bl55hd

Author

1
posts
8
comments
0
media
View profile

10 comments

I believe it is the return code of the last command executed (?) echo $PS1 to see how the prompt is built up

9 points

To add on some further explanation to what other people have said, when you run a command, it returns with an exit status. An exit status of 0 indicates success, and anything other than 0 indicates failure. The number before the rest of your prompt is the exit status of the command you just executed.

4 points

An exit status of 0 indicates success, and anything other than 0 indicates failure.

Generally. Not a rule, but the standard practice
(though offhand I can't remember anything that doesn't follow the rule, that isn't a program specific to counting things)

(you ain't wrong, just clarifying for the youngin's in the crowd)

4 points
unknown author

Deleted before we saved it.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.