Video: Helper video for the first assignment. There will not be a helper video for the other assignments
You will create a structured project folder, organize files, manipulate content, and ensure correct file management practices using terminal commands.
Open your terminal and navigate to your home directory (cd ~
).
Create a new directory named Assignment1
:
mkdir Assignment1
Inside Assignment1
, create three subdirectories: src
, docs
, and data
:
mkdir src docs data
In the src
directory, create a file named main.py
using the touch
command:
touch src/main.py
Use gedit
to open main.py
and write a basic Python script that prints "Hello, World!"
:
print("Hello, World!")
In the docs
directory, create (touch
) a Markdown file named README.md
and add the following content (gedit
):
# Assignment 1
This project contains Python code and related data files. You can print `Hello, World!` by running the `main.py` in the `src` directory.
In the data
directory, create two text files named input.txt
and output.txt
:
touch data/input.txt data/output.txt
In data/input.txt
, write three lines of data using the echo
command:
echo "First line of data" > data/input.txt
echo "Second line of data" >> data/input.txt
echo "Third line of data" >> data/input.txt
Use the cat
command to display the content of input.txt
and redirect it to output.txt
:
cat data/input.txt > data/output.txt
README.md
file for Your Assignment 1:Create a README.md
file in the Assignment1/
directory and write details of your assignment in it in Markdown language.
# Assignment 1: Organising and Managing Files using Ubuntu Terminal
## Objective
This assignment is to create a structured project folder, organize files, manipulate content, and ensure correct file management practices using terminal commands.
There are three folders here:
1. `src`
This folder contains a Python code printing "Hello, World!".
2. `docs`
THis folder contains documentation of this repository.
3. `data`
This folder contains data files.
Submit your assignment carefully following How to Submit Assignments? documentation.
If you have already made your initial Ubuntu settings, and signed up for GitLab, you can continue following instructions below to submit your Assignment 1.
Download this script on the ~/Downloads
folder and run the commands below.
sudo mkdir -p /opt/soscfd/lib
sudo mv ~/Downloads/submitAssignment.sh /opt/soscfd/lib
sudo chmod +x /opt/soscfd/lib/submitAssignment.sh
Then you are ready to submit your assignment. On the directory you prepared your assignment, run the following. Later, follow the explanations of the script on the terminal.
submitAssignment.sh