← Linux & Sunucu

Mastering Linux – From Zero to Production

Kategori: Linux & Sunucu · Sayfa: 32

Mastering Linux – From Zero to Production başlıklı kaynağın profesyonel teknik özetidir. Aşağıda belgenin ana başlık ve içerik yapısı Türkçe açıklamalarla sunulmuştur.

🐧What is Linux?Linuxis an Operating System (OS)—like Windows or macOS.•But unlike them, Linux is open-source, meaning it's free and its code is publicly available.•Linux is used in servers, cloud computing, mobile (Android), embedded systems, and DevOps tools.•🧱Basic Components of Linux OSComponentExplanationKernelThe core part of Linux that talks to hardware (like CPU, RAM, disks).ShellA program that lets you interact with the OS via commands.File SystemOrganizes and stores data. Everything in Linux is treated as a file(even devices).GUIOptional —Linux can have graphical interfaces like GNOME...

or KDE, but often used via terminal.📁Linux Directory StructureLinux starts with root (/) directory. Below it, there are folders with fixed purposes:DirectoryPurpose/Root of the file system/homeUser folders (like C:\Users)/binEssential command binaries (like ls, cp, mv)/etcSystem config files/varVariable files (like logs)/tmpTemporary files/usrUser programs and libraries/rootHome directory of the root (admin) user/devDevice files (like USB, hard disks)/procSystem and process info (virtual folder)💻Basic Linux CommandsCommandUsepwdShow current directorylsList files and folderscdChange directorym...

kdirMake a directorytouchCreate an empty filecpCopy files/folders LINUX01 July 2025 13:34 Basic info Page 1 mvMove or rename filesrmDelete filescatShow file contentsclearClear the terminalexitClose the terminal or shell👤User and PermissionsLinux is multi-user. Every file and folder has permissionsand ownership.Users:root: Superuser (admin)•Normal users: Limited access•Permissions:Each file has 3 types of permissions for:Owner○Group○Others○•Permission types:r → read•w → write•x → execute•Example:-rwxr-xr--1 user group 1234 Jul 1 file.shBreakdown:-rwxr-xr--rwx (owner): full permission○r-x (group...

): read & execute○r--(others): read only○•🧠Package Management (Installing Software)Ubuntu/Debian-based:apt-get install ○•Red Hat/CentOS:yum install or dnf install○•Others: May use pacman, zypper, snap, flatpak•🔍Processes and System MonitoringCommandDescriptionpsShow running processestopLive view of system usage (CPU, memory)killStop a processhtopBetter version of top (if installed)🧰File Compression and ArchivingCommandDescriptiontar -cvfCreate archive Basic info Page 2 tar -cvfCreate archivetar -xvfExtract archivegzip, gunzipCompress and decompress files🔑Important ...

ConceptsConceptMeaningShell ScriptA file with commands you can execute like a program (.sh)Cron JobSchedule a task to run automaticallyLog filesLocated in /var/log, useful for troubleshootingSSHRemote login to a Linux machine (ssh user@ip)SudoTemporarily run commands as root user (sudo )⚙ How It Helps in DevOpsLinux is the foundationof:Cloud servers(AWS EC2, GCP, Azure)•CI/CD pipelines•Docker & Kubernetes•Automation tools like Ansible, Terraform•📘What Are CRUD Operations?CRUD stands for:C–Create•R–Read•U–Update•D–Delete•In Linux, CRUD operations can be performed on:Files•Directories•F...

ile content•System records (like user data or processes)•🟩C – CREATE Operations in Linux➤Create a Filetouch filename.txtExample:touch notes.txt➤Create a File with Contentecho "Hello, Linux!" > hello.txtORcat > data.txtType your contentPress Ctrl+D to save➤Create a Directory (Folder)mkdir foldernameExample: Basic info Page 3 Example:mkdir projects➤Create Nested Directoriesmkdir -p devops/scripts/yaml🟦R – READ Operations in Linux➤View File Contentcat filename.txtless filename.txt # Scrollablemore filename.txt # Page-wise output➤View First or Last Lineshead filename.txt # First 10 linestail filen...

ame.txt # Last 10 lines➤Read a Directoryls # List filesls -l # Detailed viewls -a # Show hidden files➤Read a Specific Line (Using sed or awk)sed -n '3p' filename.txt # Show 3rd lineawk 'NR==3' filename.txt # Another method🟨U – UPDATE Operations in Linux➤Append to Fileecho "New line" >> file.txt➤Edit File (Using Editors)nano filename.txt –beginner-friendly terminal editor•vim filename.txt –powerful but advanced editor•➤Replace Text in Filesed -i 's/oldtext/newtext/g' filename.txtExample:sed -i 's/Devops/Linux DevOps/g' notes.txt➤Rename File or Foldermv oldname.txt newname.txt➤Move File to Diffe...

rent Locationmv file.txt /home/user/docs/🟥D – DELETE Operations in Linux➤Delete a Filerm filename.txt➤Delete a Directoryrm -r foldername➤Force Deleterm -rf foldername⚠ Basic info Page 4 ⚠ Be careful with rm -rf / — it can wipe out the enƟre OS.🛠 Bonus: Real-Time DevOps Use Cases of CRUD in LinuxTaskLinux CommandCreate a config filetouch nginx.confRead server logsless /var/log/syslogUpdate YAML for deploymentnano deployment.yamlDelete temporary filesrm -rf /tmp/*Move backupmv backup.tar.gz /mnt/backup/🧪Sample Exercise to Practice# Step 1: Create a directory and filemkdir devops_practicecd devop...

s_practicetouch inventory.txt# Step 2: Add dataecho "Server1: 192.168.1.1" >> inventory.txtecho "Server2: 192.168.1.2" >> inventory.txt# Step 3: Read and editcat inventory.txtsed -i 's/192.168.1.2/10.0.0.2/' inventory.txt# Step 4: Delete the filerm inventory.txt 🧠VIM Editor in Linux — Complete Notes with Modes & Editing Operations🔹 Basic info Page 5 🔹What is Vim?Vim (Vi IMproved)is a modal text editorin Linux.•Used for editing config files, shell scripts, YAML, Docker, Terraform, and more —especially in headless serversand DevOpsworkflows.•Runs in the terminal and is lightweight, powerful, and...

scriptable.•🎮Vim Has 3 Primary ModesMode NamePurposeEnter ModeExit Mode1. Normal ModeDefault mode —for navigation, deleting, copyingOpen Vim or press EscPress i, v, or :2. Insert ModeTyping text (like in Notepad)Press i, I, a, A, o, OPress Esc3. Command-Line ModeSave, exit, search, run commandsPress : from Normal ModePress Enter or Esc🔵1. NORMAL MODE – The Control Hub✅Actions in Normal Mode:ActionKeyMove cursorh (left), l (right), j (down), k (up)Word jumpw (next word), b (previous word)Start of line0End of line$Top of fileggBottom of fileGDelete lineddCopy (yank) lineyyPastepUndouRedoCtrl + ...

r🟡2. INSERT MODE – For Writing or Editing Text✅Enter Insert Mode:KeyFunctioniInsert before cursorIInsert at start of lineaInsert after cursorAInsert at end of lineoOpen a new line belowOOpen a new line aboveOnce in insert mode, you type normally like any text editor.✅ Basic info Page 6 ✅Exit Insert Mode:Press Esc to go back to Normal Mode.•🟣3. COMMAND-LINE MODE – For Save, Quit, Search✅Enter Command Mode:From Normal Mode, press : (colon)•✅Common Commands:CommandMeaning:wSave file:qQuit:wq or ZZSave and quit:q!Force quit without saving:xSave and exit (if changes made):set nuShow line numbers:se...

t nonuHide line numbers✏ EdiƟng OperaƟons in Vim (DevOps Oriented)📁File & Config Editing:vim /etc/nginx/nginx.confNavigate to the line using arrow keys or j/k.1.Press i to enter insert mode.2.Make changes.3.Press Esc, then type :wq to save and exit.4.🔍Searching and ReplacingSearch for a word:/nginxThen press n (next match) or N (previous match)•Replace all occurrences in file::%s/oldtext/newtext/g•📋Copy, Cut, Paste (Yank, Delete, Put)ActionKeyCopy (line)yyCopy (3 lines)3yyDelete (cut) lineddDelete 5 lines5ddPaste belowpPaste aboveP📑 Basic info Page 7 📑Line and Block EditingVisual Mode(v): Sele...

Belge toplam 15 paragraf içermektedir; tam metin /root/pdf klasöründeki kaynak dosyasında mevcuttur.

← Kategoriye dön