Intro To 'arch' Command In Linux
2023-06-07 - By Robert Elder
I use the 'arch' command to print out the current machine hardware name:
arch
x86_64
The 'arch' Command Is Just The 'uname' Command
The output of the 'arch' command is identical to the output of the 'uname' command with the '-m' flag:
uname -m
x86_64
And that's literally all this command does.
This command only has two flags, one of which prints the executable version:
arch --version
arch (GNU coreutils) 8.30
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie and Karel Zak.
and the other prints out a help page that helpfully indicates how to print this help page and also the version:
arch --help
Usage: arch [OPTION]...
Print machine architecture.
--help display this help and exit
--version output version information and exit
GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Full documentation at: <https://www.gnu.org/software/coreutils/arch>
or available locally via: info '(coreutils) arch invocation'
If you view the source code for the 'arch' command you'll see that it's basically just the same executable as the 'uname' command. The only difference is a hard-coded global variable that identifies what the 'uname' command should output.
And that's why the 'arch' command is my favourite Linux command.
Intro To 'stty' Command In Linux
Published 2023-10-04 |
$1.00 CAD |
Intro To 'nproc' Command In Linux
Published 2023-07-15 |
Intro To 'comm' Command In Linux
Published 2023-09-06 |
How To Force The 'true' Command To Return 'false'
Published 2023-07-09 |
A Surprisingly Common Mistake Involving Wildcards & The Find Command
Published 2020-01-21 |
A Guide to Recording 660FPS Video On A $6 Raspberry Pi Camera
Published 2019-08-01 |
Intro To 'chroot' Command In Linux
Published 2023-06-23 |
Join My Mailing List Privacy Policy |
Why Bother Subscribing?
|