Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Uptime Formated

Posted on May 9, 2017 By David Kittell

If you simply want uptime formatted this small script will help.

uptime | awk -F'( |,|:)+' '{print $6,$7",",$8,"hours,",$9,"minutes."}'

Uptime by itself will display similar to:
20:25:48 up 3 days, 8:14, 1 user, load average: 2.07, 2.17, 2.35

Formatted using the code above will display similar to:
3 days, 8 hours, 15 minutes.

All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

CentOS Code Fedora Red Hat Ubuntu UNIX UNIX Shell Scripts

Post navigation

Previous post
Next post

Related Posts

Count All Rows In All Tables

Posted on May 27, 2014October 26, 2015

There are a few ways to count all of the rows in all of your tables in a database. The “Fastest Option” actually pulls the information from the database where the numbers are stored rather than taking time to count rows. SELECT t.NAME AS table_name ,i.rows FROM sys.tables AS t…

Read More

Concatenate Address Columns In One Column

Posted on August 7, 2015October 17, 2021

In many databases the address is properly separated into various columns but in a report you want to concatenate them. This simple script will pull them together in one column without causing extra spaces SELECT ltrim(isnull([address], ”) + ‘ ‘ + isnull([address2], ”) + ‘ ‘ + isnull([city], ”) +…

Read More

Ubuntu Supported Distros

Posted on November 5, 2015

cp /etc/apt/sources.list /etc/apt/sources.list-orig echo ‘deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted’ > /etc/apt/sources.list echo ‘deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted’ >> /etc/apt/sources.list echo ‘deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted’ >> /etc/apt/sources.list echo ‘deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted’ >> /etc/apt/sources.list echo ‘deb http://security.ubuntu.com/ubuntu trusty-security main restricted’ >> /etc/apt/sources.list echo ‘deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted’ >>…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories
  • Raspberry Pi - Remove Default Apps
  • PowerShell - Change Windows CD/DVD Drive Letter
©2025 David Kittell | WordPress Theme by SuperbThemes