https://github.com/kh-suleiman99/system-information-bash-script-and-others
Some of simple Bash scripts, I wrote them while studying The Linux command line reference.
https://github.com/kh-suleiman99/system-information-bash-script-and-others
bash-script linux shell
Last synced: about 2 months ago
JSON representation
Some of simple Bash scripts, I wrote them while studying The Linux command line reference.
- Host: GitHub
- URL: https://github.com/kh-suleiman99/system-information-bash-script-and-others
- Owner: kh-Suleiman99
- Created: 2024-05-20T07:31:54.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-20T08:23:29.000Z (about 2 years ago)
- Last Synced: 2025-01-16T16:24:04.817Z (over 1 year ago)
- Topics: bash-script, linux, shell
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# System-Information-bash-script-and-others
This repository contains Some of simple Bash scripts, I wrote them while studying The Linux command line reference.
# Table of Contents
* [Hello World](#hello_world.sh)
* [File Status](#file_status.sh)
* [Hours](#hours.sh)
* [System Information](#sys_info.sh)
* [Trap Demo](#trap_demo.sh)
# Hello World
This is our first script
**Example Usage:**
```shell
$ ./hello_world.sh "
Hello, World
```
# File Status
a script that Evaluate the status of a file. It demonstrates some of the file expressions.
**Example Usage:**
```shell
$ ./file_status.sh "
Enter the file name: /home/khaled
/home/khaled is a directory.
/home/khaled is readable.
/home/khaled is writable.
/home/khaled is executable/searchable.
```
# Hours
script to count files by modification time.
**Example Usage:**
```shell
$ ./hours.sh /bin "
Hour Files Hour Files
==== ===== ==== =====
00 39 12 54
01 28 13 36
02 70 14 103
03 10 15 110
04 3 16 162
05 12 17 187
06 2 18 102
07 9 19 57
08 30 20 143
09 16 21 118
10 8 22 100
11 118 23 49
=============================
Total files = 1566
```
# System Information
Program to output system information to an html page.
**Example Usage:**
```shell
$ sudo ./sys_info.sh -f sys_info_page.html "
```
# Trap Demo
simple signal handling demo. will execute an echo command each time either the SIGINT or SIGTERM signal is received while the script is running.
**Example Usage:**
```shell
$ ./trap_demo.sh
Iteration 1 of 5
^C
I am ignoring you.
Iteration 2 of 5
Iteration 3 of 5
^C
I am ignoring you.
Iteration 4 of 5
Iteration 5 of 5
```