--- title: Computer systems L+Pr tags: - IP-18fSZGREG - BSc - CS - ELTE date: 2026-01-22T01:46:00 --- # Computer systems L+Pr ## DarthDemono's Notes for Computer Systems L+Pr / IP-18fSZGREG ### Network Fundamentals Networks evolved from ARPANET → TCP/IP (1983). **SSH replaces insecure telnet/FTP** (unencrypted). Command: ```bash ssh {username}@server ``` ### ComSys Server Access 1. SSH ```bash 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): ```bash vim file.sh # i=insert, esc=:wq=save&quit, :q!=quit no save, dd=delete line, yy=copy line, p=paste ``` **nano** (beginner-friendly): ```bash nano file.sh # Ctrl+O=save, Ctrl+X=exit ``` `man vim`, `man nano` for help. ### Linux Commands from Lectures | Command | Purpose | Examples | | :------------------------ | :----------------------------------------- | :--------------------------------------------------------------------------------------------------------------------- | | `ls` | List directory (`-l`=details, `-a`=hidden) | `ls -la` (lists all files (including hidden) with details and permissions) | | `pwd` | Print working directory | `pwd` → `/afs/inf.elte.hu/user/L/LS/LS1234/` | | `cd` / `mkdir` / `rmdir` | Navigate / create / remove dirs | `cd ..`, `mkdir comsys`, `rmdir empty` | | `cp` / `mv` / `rm` / `ln` | Copy / move / delete / link | `cp file1 file2`, `mv old new`, `rm -r dir`, `ln source target` | | `chmod` | Change permissions (rwx, 644=owner rw) | `chmod +x script.sh` (makes file exexutable), `chmod 755 file` (grants the owner read, write, and execute permissions) | | `chown` / `chgrp` | Change owner/group | `sudo chown user:group file` | | `passwd` | Change password | `passwd` | | `who` / `whoami` | Logged-in users / current user | `who`, `whoami` → `LS1234` | | `ps` | Processes | `ps aux` -> Lists all active processes | | `top` | Live processes/priorities | `top` (q=quit) | | `find` | Search files | `find . -name "*.sh"` | | `cat` / `head` / `tail` | View files | `cat file` (shows file), `head -5 file` (shows first 5 lines), `tail -5 file` (shows last 5 lines) | | `grep` | Filter lines (regex) | `grep "error" file`, `grep -r "TODO" .` | | `wc` | Word/line/char count | `wc -l file` (shows file lined count) | | `man` | Shows command details | `man nano` (shows details about nano) | ### Running Executables 1. **`chmod`** 1. **Make executable**: ```bash chmod +x myscript.sh # makes any files 'executable' ``` 2. **Run**: ```bash ./myscript.sh # './' -> current directory ``` 2. **`Source`** ```bash source myscript.sh ``` ### File Operations **Zip/Compress**: ```bash zip -r homework.zip homework/ # ZIP format tar czvf homework.tar.gz homework/ # GZipped TAR gzip file.txt # .txt → .txt.gz ``` **Move**: ```bash mv source dest/ # Rename/move file/dir mv file1 file2 dir/ # Multiple files ``` **Remove**: ```bash rm file # File (no recycle bin!) rm -r dir/ # Recursive directory rm -rf dir/ # Force, no prompt (dangerous!) ``` ### Exam Samples #### [[Computer systems L+Pr/Midterm/index\|Midterm]] #### [[Computer systems L+Pr/Endterm/index\|Endterm]] ### Course command usage examples 1. **list→filter→transform→aggregate**: ```bash ls -l *.sh | grep "May" | awk '{print $9}' | wc -l ``` **PowerShell equivalent**: ```powershell ls *.ps1 | Where { $_.LastWriteTime.Month -eq 5 } | Select Name | Measure ```