-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
samirm00
committed
Mar 1, 2024
1 parent
4428e1d
commit db6b308
Showing
5 changed files
with
80 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Author: Samir M. | ||
# Date: 2024-02-29 | ||
# Modified: 2024-02-29 | ||
# Description: A simple Bash script to demonstrate file and directory operations. | ||
# Usage: ./2.sh | ||
|
||
# File and Directory Operations | ||
# e flag is used to enable interpretation of backslash escapes | ||
echo -e "\n2. File and Directory Operations:" | ||
|
||
# Create a directory | ||
mkdir my_directory | ||
echo " Created 'my_directory'" | ||
|
||
# Change to the directory | ||
cd my_directory | ||
echo " Current Directory: $(pwd)" | ||
|
||
# Create a new file | ||
touch my_file.txt | ||
echo " Created 'my_file.txt'" | ||
|
||
# Display file content | ||
echo -e "\n Content of 'my_file.txt':" | ||
cat my_file.txt | ||
|
||
# Delete the file | ||
rm my_file.txt | ||
echo " Deleted 'my_file.txt'" | ||
|
||
# Delete the directory | ||
cd .. | ||
rm -r my_directory | ||
echo " Deleted 'my_directory'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
# Author: Samir M. | ||
# Date: 2024-02-29 | ||
# Modified: 2024-02-29 | ||
# Description: A simple Bash script to print process information. | ||
# Usage: ./3.sh | ||
|
||
|
||
# Process Information | ||
echo -e "\n3. Process Information:" | ||
# Display process information | ||
echo " List of processes:" | ||
|
||
# ps aux command is used to display all the running processes | ||
ps aux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# Author: Samir M. | ||
# Date: 2024-02-29 | ||
# Modified: 2024-02-29 | ||
# Description: A simple Bash script to demonstrate user input. | ||
# Usage: ./4.sh | ||
|
||
# User Input | ||
echo -e "\n4. User Input:" | ||
|
||
# Prompt for user input | ||
read -p "Enter your name: " user_name | ||
|
||
echo "Hello, $user_name! Welcome to Bash scripting." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
# Author: Samir M. | ||
# Date: 2024-02-29 | ||
# Modified: 2024-02-29 | ||
# Description: A simple Bash script to make the script executable. | ||
# Usage: ./5.sh | ||
|
||
# Make the script executable | ||
# To calculate the permission, we use the following webiste: https://chmod-calculator.com/ | ||
# chmod 744 1.sh | ||
|