DarthDemono’s Notes for Computer Systems L+Pr / IP-18fSZGREG

How Computers Work

CPU Cycle

Storage hierarchy

Network Fundamentals

Networks evolved from ARPANET → TCP/IP (1983). SSH replaces insecure telnet/FTP (unencrypted). Command:

ssh {username}@server

ComSys Server Access

  1. SSH
    ssh {neptun}@comsys.inf.elte.hu
    (e.g., ssh LS1234@comsys.inf.elte.hu)
  2. Password: your Neptun password
  3. You’re in /afs/inf.elte.hu/user/L/LS/LS1234/.
  4. cd public to access your documents which are also publicly available

Essential Editors

vim (powerful, modal):

vim file.sh     # i=insert, esc=:wq=save&quit, :q!=quit no save, dd=delete line, yy=copy line, p=paste

nano (beginner-friendly):

nano file.sh    # Ctrl+O=save, Ctrl+X=exit

man vim, man nano for help.

Linux Commands from Lectures

CommandPurposeExamples
lsList directory (-l=details, -a=hidden)ls -la (lists all files (including hidden) with details and permissions)
pwdPrint working directorypwd/afs/inf.elte.hu/user/L/LS/LS1234/
cd / mkdir / rmdirNavigate / create / remove dirscd .., mkdir comsys, rmdir empty
cp / mv / rm / lnCopy / move / delete / linkcp file1 file2, mv old new, rm -r dir, ln source target
chmodChange permissions (rwx, 644=owner rw)chmod +x script.sh (makes file exexutable), chmod 755 file (grants the owner read, write, and execute permissions)
chown / chgrpChange owner/groupsudo chown user:group file
passwdChange passwordpasswd
who / whoamiLogged-in users / current userwho, whoamiLS1234
psProcessesps aux Lists all active processes
topLive processes/prioritiestop (q=quit)
findSearch filesfind . -name "*.sh"
cat / head / tailView filescat file (shows file), head -5 file (shows first 5 lines), tail -5 file (shows last 5 lines)
grepFilter lines (regex)grep "error" file, grep -r "TODO" .
wcWord/line/char countwc -l file (shows file lined count)
manShows command detailsman nano (shows details about nano)

Running Executables

  1. chmod
    1. Make executable:
      chmod +x myscript.sh
      # makes any files 'executable'
    2. Run:
      ./myscript.sh
      # './' -> current directory
  2. Source
    source myscript.sh

File Operations

Zip/Compress:

zip -r homework.zip homework/    # ZIP format
tar czvf homework.tar.gz homework/  # GZipped TAR
gzip file.txt                    # .txt → .txt.gz

Move:

mv source dest/          # Rename/move file/dir
mv file1 file2 dir/      # Multiple files

Remove:

rm file                  # File (no recycle bin!)
rm -r dir/               # Recursive directory
rm -rf dir/              # Force, no prompt (dangerous!)

Exam Samples

Midterm

Endterm

Course command usage examples

  1. list→filter→transform→aggregate:
    ls -l *.sh | grep "May" | awk '{print $9}' | wc -l
    PowerShell equivalent:
    ls *.ps1 | Where { $_.LastWriteTime.Month -eq 5 } | Select Name | Measure