Command
Prompt
joshua_babelo
nia
Information System
Operational and
Basic
Maintenance:
Command
Prompt
Introduction to Basic
Scripting
What is Scripting?
• A script is a sequence of commands run automatically by the computer.
• It works like a set of instructions the computer follows.
Why Businesses Should Care:
• Automates repetitive tasks and improves efficiency
• Helps manage files and data accurately
• Reduces human errors and boosts productivity
• Supports business operations involving computers or servers
• Scales easily as business data and customers grow
• Lowers operational costs by reducing manual work
• Provides data insights for better decision-making
Think of a script as a digital SOP — a task list the computer performs
perfectly, instantly, and consistently.
Command
Prompt
Why they use Linux?
Linux is widely used in:
• Banks, hospitals, airlines, corporations, and government
• Stable, secure, reliable — ideal for business systems
• Most servers powering websites and apps run on Linux
• Basic Linux skills help future managers understand
operations
It is stable, secure, and preferred for business servers.
Knowing Linux gives you a strong advantage even in
business fields.
Command
Prompt
Learning Objectives
By the end of this topic, students should be able to:
• Understand and perform basic text editing in Linux
• Create and run Basic Shell Scripts
• Demonstrate foundational Linux scripting skills
Recognize how scripting helps in business operations and
automation
Command
Prompt
Basic Text Editing in Linux
What is Text Editing?
• Editing simple text files such as:
[Link] files
[Link] files
c. Scripts
[Link] files
[Link] settings
Why It Matters for Business:
• Most system files are text-based
• Editing configurations = adjusting how systems behave
• Essential for troubleshooting and operations
Command
Prompt
Introduction to Basic
Scripting
What is Scripting?
• A script is a sequence of commands run automatically by the computer.
• It works like a set of instructions the computer follows.
Why Businesses Should Care:
• Automates repetitive tasks and improves efficiency
• Helps manage files and data accurately
• Reduces human errors and boosts productivity
• Supports business operations involving computers or servers
• Scales easily as business data and customers grow
• Lowers operational costs by reducing manual work
• Provides data insights for better decision-making
Think of a script as a digital SOP — a task list the computer performs
perfectly, instantly, and consistently.
Command
Prompt
The Tools: nano, vim,
gedit
1. nano (beginner-friendly)
• Easy to use, helpful shortcuts
• Great for quick edits
2. vim / vi (advanced)
• Powerful, used in almost all servers
• Requires practice
• Ideal for IT operations
3. gedit
• GUI (Graphical) editor
• For desktop Linux users
Basic Commands:
nano [Link] # open or create a file
vi [Link] # open file using vi
Command
Prompt
Using nano (Simple Editor)
nano business_report.sh# Create/edit a file
Common Commands (Displayed On-Screen):
• nano [Link] — open file
• Ctrl + O — Save
• Ctrl + X — Exit
• Ctrl + K — Cut
• Ctrl + U — Paste
Student Task:
1. Create a file:
nano [Link]
2. Type: Hello, Business Management
Students!
3. Save and exit.
Command
Prompt
Using vim (Advanced
Why Learn vi/vim?
Editor)
• Available on EVERY Linux/Unix system
• Required for advanced system
administration
• Extremely powerful for large file editing
Mode Purpose Key Commands
Command Mode (default) Navigation, commands :w (save), :q (quit)
Insert Mode Text editing i (insert), Esc (return)
Visual Mode Text selection v (visual select)
Basic Commands:
• i — insert • :q — quit
• :wq — save & quit
• Esc — exit to command mode
• :w — save • :q! — quit without saving
Command
Prompt
Essential Workflow of
vi/vim
Essential Workflow:
[Link] business_config.txt → Open file
2.i → Enter Insert Mode
[Link] your content
[Link] → Return to Command Mode
5.:wq → Save and quit
• Advantages it enables management of remote business
systems anywhere
• Most real servers use vi/vim only, so basic familiarity is
beneficial., Explain that many IT teams require vim
knowledge.
Command
Prompt
What Is Shell Scripting?
• A shell script is a text file containing Linux Examples:
commands. • Daily backup of sales data
• When executed, the computer runs these • Organizing business documen
commands automatically. • Generating daily reports
•Core Components:
It’s like a automating a repetitive business task.
[Link] Shebang: #!/bin/bash
⚬ The first line of a script
⚬ It tells the system which interpreter (e.g., bash) to use to run the script.
[Link]: # Business daily report script
⚬ Lines starting with #. They are notes for humans and are ignored by the
computer.
[Link]: Actual instructions to execute, or the same Linux commands you
type manually.
⚬ echo "Starting the backup process..."
⚬ cp /data/[Link] /backup/
Command
Prompt
Example: backup_script.sh
bash
#!/bin/bash
# A simple backup script for sales data
echo "=== Starting Sales Data Backup ==="
cp /home/user/sales_data.csv
/home/user/backups/sales_data_backup.csv
echo "Backup completed successfully!"
SCRIPT BREAKDOWN
• #!/bin/bash → Use Bash shell
• # comments → Documentation
• echo → User communication
• cp → Business data protection
• $(date +%Y-%m-%d) → Dynamic naming
Command
Prompt
Why Shell Scripting Matters in
Business?
• Automates routine and daily business tasks
• Reduces labor costs and prevents human errors
• Organizes files and manages backups
• Generates reports and supports inventory and sales
processes
• Runs business operations on schedule and speeds them
up
• Ensures consistency in systems and configurations
• Helps managers effectively monitor business systems
Command
Prompt
Creating Your First Shell Script
1. Create a file: 3. Add commands: 4. Save the file.
nano [Link]
echo "Backing up sales report..."
2. Add this inside: cp [Link]
#!/bin/bash backup/sales_backup.csv
echo "Backup completed!"
Problem: A new text file isn't allowed to run as a program.
Solution: The chmod command (Change Mode)
• chmod +x backup_script.sh
• This grants "execute" permission to the file.
Running the Script:
• ./backup_script.sh
• The ./ tells the shell to look for the script in the current
Command
Prompt
Making a Script Executable &
Running It
1. Create a file:
nano [Link]
2. Add this inside:
#!/bin/bash
3. Add commands:
echo "Hellow World"
cp [Link]
backup/sales_backup.csv
echo "Backup completed!"
4. Make it executable:
chmod +x [Link]
Command
Prompt
Another demonstration
Example Script: Backup Files
#!/bin/bash
# Simple backup script
cp /home/user/documents/* /home/user/backup/
echo "Backup completed!"
Explanation:
• Copies all files from documents folder to backup folder.
• Prints a confirmation message when done.
Key Takeaways:
• Text editors are essential for creating and editing files in Linux.
• Shell scripts automate tasks and improve efficiency.
• Basic knowledge of scripting is crucial for system operation and
maintenance.
Command
Prompt
Basic Commands Used in Scripts
These form the foundation of automation.
Command Purpose
echo Prints text/output
ls Lists files
pwd Shows current directory
cd Moves between folders
cp Copies files
mv Moves/renames files
rm Deletes files
mkdir Creates folders
Command
Prompt
Business Automation Example
Daily Inventory Backup Script
#!/bin/bash
echo "Copying inventory data..."
cp /data/[Link] /data/archive/inventory_$(date +
%F).csv
echo "Done!"
What it does:
• Copies daily inventory
• Automatically names file with date
• Logs progress
Command
Prompt
Business Automation Example
Basic Script for Organizing Files
#!/bin/bash
mkdir reports
mv *.pdf reports/
echo "All PDF reports moved to
Another Example: Organize Reports
the reports folder."
#!/bin/bash
Useful for:
mkdir reports
• Organizing customer
mv *.pdf reports/
documents
echo "All PDF reports moved to the
• Sorting downloaded files
reports folder."
• Cleaning clutter
Command
Prompt
Business Automation Example
Basic Script for Backup Sales
#!/bin/bash
echo "Backing up sales report..."
cp [Link] backup/sales_backup.csv
echo "Backup completed!"
This script:
• Copies sales file → backup folder
• Shows completion message
Command
Prompt
Key Linux Commands for Scripting
• echo "text": Prints text to the screen.
• cat [Link]: Displays the contents of a file.
• grep "pattern" [Link]: Searches for text
patterns within a file. (Extremely powerful for
data analysis!)
• wc -l [Link]: Counts the number of lines in a
file.
• cp source destination: Copies a file.
• mv source destination: Moves or renames a file.
• > [Link]: Redirects output to a file, overwriting
Command
Prompt
Skills That Should Demonstrate
By the end of the lesson, students should be
able to: 4. Use basic Linux commands
[Link] text files using nano or vim
5. Automate simple business
[Link] simple shell scripts tasks
[Link] Time
Demonstration scripts on a Linux system
• Live Demo:
[Link] a Linux terminal (or online emulator).
[Link] nano to create the daily_report.sh script.
c. Save the file and exit.
[Link] chmod +x daily_report.sh to make it executable.
[Link] it with ./daily_report.sh.
f. Use cat daily_report.txt to view the generated "report".
• Emphasize: The entire business reporting process was automated with a few
Command
Prompt
Essential Business Commands for
Scripting
Building
Command
Blocks of Automation
Business Use Example
echo "Report generation
echo "text" User communication
starting..."
cp source dest Data backup cp [Link] backup/
mv source dest File organization mv *.pdf archives/
grep "pattern" Data analysis grep "error" [Link]
wc -l file Count records wc -l customer_list.csv
> file Create reports echo "Report" > [Link]
>> file Append data echo "New data" >> [Link]
Command
Prompt
Real Business Use Cases
Shell scripting is used for:
• Auto-backup of sales or HR data • Cleaning unwanted files from
• Generating daily or weekly systems
reports • Monitoring logs for security
• Managing customer files • Sorting invoices or digital receipts
Department Scripting Application Business Benefit
Sales Daily sales report Faster decision making
generation
Operations System health monitoring Reduced downtime
Finance Data backup and archiving Compliance and audit readiness
Marketing Customer data processing Improved campaign targeting
HR User account management Faster employee onboarding
Command
Prompt
Business Scenario: Automating a Daily Report
• Task: Every morning, you need a summary of the previous day's
logins and a list of new user registrations.
• Manual Process: Log in, find the log files, run grep commands,
copy-paste results.
• Automated Script: daily_report.sh
...
bash
echo "1. Total User Logins Yesterday:" >>
#!/bin/bash
daily_report.txt
# Business Management Daily System Report
grep "login" /var/log/[Link] | wc -l >>
# Created by: [Student Name]
daily_report.txt
REPORT_DATE=$(date +"%Y-%m-%d")
echo "2. New User Registrations:" >>
echo "=== DAILY BUSINESS SYSTEM REPORT -
daily_report.txt
$REPORT_DATE ===" > daily_report.txt
grep "new user" /var/log/[Link] >>
echo "----------------------------------------" >>
daily_report.txt
daily_report.txt
Command
Prompt
Live Demonstration (From Zero to Automation)
Step-by-Step Business Automation:
1. Create the Script: 4. Execute:
bash bash
nano business_automation.sh ./
2. Build the Script: business_automation.sh
bash 5. Verify Results:
#!/bin/bash bash
# Business Data Processing cat
Automation /processing/file_count.txt
Expected Output:
echo "Starting business data
text
processing..."
Starting business data processing...
cp /data/sales/*.csv /processing/
Files ready for analysis: 15
echo "Files ready for analysis: $(ls
Process completed at: Mon Dec 11
/processing/*.csv | wc -l)"
14:30:00 UTC 2023
echo "Process completed at: $(date)"
3. Make Executable:
Command
Prompt
SUMMARY
• Scripting = automation
• Text editing = modifying important files
• Shell scripting helps businesses work faster
• Linux skills are essential in modern companies
• Text Editing (nano) is the essential skill for creating and maintaining
system files and scripts.
• Shell Scripting is about combining simple commands into powerful,
automated workflows.
• The core script structure is: Shebang -> Comments -> Commands.
• Use chmod +x to give a script permission to run.
• You don't need to be an expert coder, but understanding the principles
allows you to identify automation opportunities and communicate
effectively with your IT team.
Command
Prompt
ACTIVITY TIME
Command
Prompt
ACTIVITY #1 for Finals
Basic Linux Scripting
Output: 1 working shell script +
screenshots
Submission: Google Drive folder (PNG/JPG)
Filename format: LASTNAME_FIRSTNAME.png
You’ll will create a basic shell script using nano, insert their
name, favorite color, favorite food, hobbies, and what it
feels to learn basic scripting, run the script successfully,
and document the process through screenshots.
This ensures students understand: ✔ how to use chmod
✔ the shebang line ✔ how to run a script
✔ how to edit using nano ✔ basic echo commands
Command
Prompt
Example of Ouput for Basic Scripting
Activity
Command
Prompt
Example of Modifying Script
Command
Prompt
Expected output:
Combine Output,
and nano view in 1
picture (JPEG, PNG)
Command
Prompt
~/ THANK YOU FOR LISTENING
CRTL + X to EXIT