Skip to content

Mayank1224/linux-xenonstack-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Certainly, here's a README.md file for the project:

# internsctl - Custom Linux Command

## Overview

`internsctl` is a specialized Linux command crafted to offer diverse features for system administrators and interns alike. This command enables users to retrieve details about the CPU, memory, and files on their server. It also facilitates the creation of new users and provides a list of existing users, including those with sudo privileges.

## Installation

1. Clone or download the repository to the local system.

2. Make the `internsctl` script executable using the following command:

   ```bash
   chmod +x internsctl
  1. Move the internsctl script to the directory that is in your system's PATH so that you can run it from anywhere.

  2. Make sure you have the required permissions to execute the script.

Usage

General Usage

  • Display help and usage information:

    internsctl --help
  • Display the version of internsctl:

    internsctl --version
  • Greet the interns:

    internsctl -g
  • Generate an intern report (custom logic can be added in the script):

    internsctl -r

CPU and Memory Information

  • Get CPU information similar to the lscpu command:

    internsctl cpu getinfo
  • Get memory information similar to the free command:

    internsctl memory getinfo

User Management

  • Create a new user with the provided username:

    internsctl user create <username>
  • List all regular users:

    internsctl user list
  • List users with sudo permissions:

    internsctl user list --sudo-only

File Information

  • Get information about a file, including size, permissions, owner, or last modified time:

    internsctl file getinfo <file-name>
    • To get the size of the specified file:

      internsctl file getinfo --size <file-name>
    • To get the permissions of the specified file:

      internsctl file getinfo --permissions <file-name>
    • To get the owner of the specified file:

      internsctl file getinfo --owner <file-name>
    • To get the last modified time of the specified file:

      internsctl file getinfo --last-modified <file-name>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages