Amazon Ad

Featured Post

Thursday, December 20, 2018

Display the return code of a command


Use:
echo $?

[john@moon 15:14:28 work]$ echo $?
0
[john@moon 15:14:30 work]$ ls /z
ls: cannot access /z: No such file or directory
[john@moon 15:14:34 work]$ echo $?
2

No comments: