Skip to Content
Linux Shell Scripting Cookbook - Third Edition
book

Linux Shell Scripting Cookbook - Third Edition

by Clif Flynt, Sarath Lakshman, Shantanu Tushar
May 2017
Beginner
552 pages
28h 47m
English
Packt Publishing
Content preview from Linux Shell Scripting Cookbook - Third Edition

How to do it...

  1. The hostname and uname commands print the hostname of the current system:
        $ hostname

Alternatively, they print the following:

        $ uname -n
        server.example.com
  1. The -a option to uname prints details about the Linux kernel version, hardware architecture, and more:
        $ uname -a
        server.example.com 2.6.32-642.11.1.e16.x86_64 #1 SMP Fri Nov 18   
        19:25:05 UTC 2016 x86_64 x86_64 GNU/Linux
  1. The -r option limits the report to the kernel release:
        $ uname -r
        2.6.32-642.11.1.e16.x86_64
  1. The -m option prints the machine type:
        $ uname -m
        x86_64
  1. The /proc/ directory holds information about the system, modules, and running processes. /proc/cpuinfo contains CPU details:
        $ cat /proc/cpuinfo
        processor     : 0
 vendor_id : GenuineIntel ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux Shell Scripting - Second Edition

Mastering Linux Shell Scripting - Second Edition

Mokhtar Ebrahim, Andrew Mallett

Publisher Resources

ISBN: 9781785881985