uname icon

uname For Linux

  n/a
GPL    

uname is a special version of uname.. #Kernel version  #System version  #Linux information  #Uname  #Kernel  #Version  

Description

Free Download

uname is a special version of uname. Supports -a, -s, -r, -n, -v, -m options.

USAGE: uname [options]

-s Print the kernel name -v Print the kernel version -r Print the kernel release -n Print the network node hostname -m Print the machine hardware name -a Print all of the above

Without options, uname acts like uname -s

#include < unistd.h > #include < sys/utsname.h > #include < stdio.h > #include < stdlib.h > #include < string.h >

void print_usage(void);

int main( int argc, char *argv[] ) { int c; extern char *optarg; extern int optind, optopt; int a_flag = 0, s_flag = 0, n_flag = 0, r_flag = 0, v_flag = 0, m_flag = 0; int errflag=0; char host[256]; struct utsname uts;

if ( gethostname( host, 255 ) != 0 || uname( &uts ) < 0 ) { fprintf( stderr, "Unable to get host informationn" ); exit( 1 ); }

/* if no options, then just print sysname */ if ( argc == 1 ) { s_flag = 1; } else { while ( ( c = getopt( argc, argv, "asnrvm" ) ) != -1 ) { switch ( c ) { case 'a': a_flag = 1; break; case 's': s_flag = 1; break; case 'n': n_flag = 1; break; case 'r': r_flag = 1; break; case 'v': v_flag = 1; break; case 'm': m_flag = 1; break; case '?': errflag++; break; } } }

/* Must have been one or more erroneous options passed - print usage info and exit */ if ( errflag != 0 ) { print_usage(); exit( 1 ); }

char *sysname, *machine, *nodename, *release, *version;

sysname=uts.sysname; machine=uts.machine; nodename=uts.nodename; release=uts.release; version=uts.version;

if ( a_flag == 1 ) { printf( "%s %s %s %s %sn", sysname, nodename, release, version, machine ); } else { char *printstring; /* allocate enough space for all eventualities....*/ printstring = (char *)malloc(strlen(sysname)+ strlen(version)+ strlen(release)+ strlen(nodename)+ strlen(machine)+6); strcpy( printstring , "");

if ( s_flag == 1 ) { strcat( printstring, sysname ); strcat( printstring, " "); } if ( n_flag == 1 ) { strcat( printstring, nodename ); strcat( printstring, " "); } if ( r_flag == 1 ) { strcat( printstring, release ); strcat( printstring, " "); } if ( v_flag == 1 ) { strcat( printstring, version ); strcat( printstring, " "); } if ( m_flag == 1 ) { strcat( printstring, machine ); strcat( printstring, " "); } puts( printstring ); free( printstring ); } return 0; }

void print_usage(void) { char *usage[] = { "uname - (C) 2004 Kevin Waldron", "Distributed under the terms of the GNU General Public Licence", "USAGE:", "uname [options]", " -s Print the kernel name", " -v Print the kernel version", " -r Print the kernel release", " -n Print the network node hostname", " -m Print the machine hardware name", " -a Print all of the above", " ", "Without options, uname acts like uname -s" };

int i = 0; for ( i = 0 ; i < 12 ; i++ ) { printf( "%sn", *(usage+i) ); } }

uname 0.1

add to watchlist add to download basket send us an update REPORT
  runs on:
Linux
  filename:
uname.tar.gz
  main category:
Utilities
  developer:
  visit homepage

4k Video Downloader 1.5.3.0080 Plus / 4.30.0.5655

Export your favorite YouTube videos and playlists with this intuitive, lightweight program, built to facilitate downloading clips from the popular website
4k Video Downloader

IrfanView 4.67

With support for a long list of plugins, this minimalistic utility helps you view images, as well as edit and convert them using a built-in batch mode
IrfanView

Context Menu Manager 3.3.3.1

Customize Windows’ original right-click context menu using this free, portable and open-source utility meant to enhance your workflow
Context Menu Manager

Bitdefender Antivirus Free 27.0.35.146

Feather-light and free antivirus solution from renowned developer that keeps the PC protected at all times from malware without requiring user configuration
Bitdefender Antivirus Free

Zoom Client 6.0.3.37634

The official desktop client for Zoom, the popular video conferencing and collaboration tool used by millions of people worldwide
Zoom Client

Windows Sandbox Launcher 1.0.0

Set up the Windows Sandbox parameters to your specific requirements, with this dedicated launcher that features advanced parametrization
Windows Sandbox Launcher

calibre 7.9.0

Effortlessly keep your e-book library thoroughly organized with the help of the numerous features offered by this efficient and capable manager
calibre

ShareX 16.0.1

Capture your screen, create GIFs, and record videos through this versatile solution that includes various other amenities: an OCR scanner, image uploader, URL shortener, and much more
ShareX

7-Zip 23.01 / 24.04 Beta

An intuitive application with a very good compression ratio that can help you not only create and extract archives, but also test them for errors
7-Zip

Microsoft Teams 24060.3102.2733.5911 Home / 1.7.00.7956 Work

Effortlessly chat, collaborate on projects, and transfer files within a business-like environment by employing this Microsoft-vetted application
Microsoft Teams

% discount
ShareX
  • ShareX
  • 7-Zip
  • Microsoft Teams
  • 4k Video Downloader
  • IrfanView
  • Context Menu Manager
  • Bitdefender Antivirus Free
  • Zoom Client
  • Windows Sandbox Launcher
  • calibre
essentials


Click to load comments
This enables Disqus, Inc. to process some of your data. Disqus privacy policy