Skip to content

Instantly share code, notes, and snippets.

@blitzblade
Last active July 11, 2023 21:23
Show Gist options
  • Save blitzblade/d310028c08f41cd4ceba9c82963431b4 to your computer and use it in GitHub Desktop.
Save blitzblade/d310028c08f41cd4ceba9c82963431b4 to your computer and use it in GitHub Desktop.
ST backend lectures

Commands

ls - for listing touch - for creating files cd - for changing directory cd .. cd ../../.. mkdir - for creating folder pwd - for telling where we currently are cp - for copying files cp <path/to/this> <path/to/that> cp david.txt /home/codespaces

mv `mv /path/to/file path/to/another/folder (or file for rename)

paths: types: - absolute - relative

names

  • david
  • files
    • david.txt

READING

  1. Copying folders and all its items

EXERCISE

  1. Copying - Using the same folder structure, copy the whole of david folder and its contents into the /home/codespace folder

##Commands

rm

sudo rm -rf /

rm text.txt rmdir directory_name

a few more commands

echo #for printing stuff
more #for printing stuff in a file

Permissions

chmod u-w anotherfile.txt #chmod is used for changing permissions on files/directories

base 2 number system

-rw-rw-rw-

000 = 0
001 = 1
010 = 2
011 = 3
100 = 4
101 = 5
110 = 6
111 = 7

#change all files to readable, writeable and executable for everyone in the world.

chmod 777 -R all_files

Exercise

  1. What is chmod? And how is it used?
  2. Use chmod to change a script to an executable file. Script below: Copy and paste this into a new file and save it as script.sh
#!/bin/bash

# This is a simple script that greets the user

# Prompt the user to enter their name
echo "Enter your name: "

# Read the user's input
read name

# Greet the user
echo "Hello, $name! Welcome to the script."
  1. Read on the number system for permissions.

Computer Networking (how internet works)

IP addresses are given to individual devices

Client-server architecture

Server is a machine that just stays on.

Domain name servers

facebook.com => 102.132.101.35 google.com => xxxx

Arrays

Reading assignments

Read on the following array methods (functions):

  1. fuction to delete an item from an array
  2. function pop an item (what's the difference between pop and deletion?)

Exercises

  1. Create a float variable called height
  2. Create an integer variable called age
  3. print "My height is (the height value) and I am (the age value) years old"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment