{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreiebdox5qux6udrg54n4oy7hf5u4nfhnqhr735lsedczjfbs3sic5y",
    "uri": "at://did:plc:25rdn5elo5izoxrmtis34zuk/app.bsky.feed.post/3morny6mmkhl2"
  },
  "coverImage": {
    "$type": "blob",
    "ref": {
      "$link": "bafkreigylffyactleybqaf5fbjhfzf4rmyeeebzbsfavseegpdqdrhlrqy"
    },
    "mimeType": "image/webp",
    "size": 59762
  },
  "path": "/dharam_in/i-thought-i-knew-linux-then-i-actually-learned-it-week-1-2ep9",
  "publishedAt": "2026-06-21T05:10:22.000Z",
  "site": "https://dev.to",
  "textContent": "##  The Big Picture\n\n> Before you read this doc you must know english is my second language and this doc is have completely my own words not any AI, translator etc.\n\n###  What an OS really is\n\nAn Operating System is software that manage every system resources and it also manage - Hardware, Kernel, and User space.\n\n###  Kernel mode and User mode\n\nKernel mode handle every hardware related work and this is only thing that manage hardware. User mode is just showing us to running programs like right now you are in User mode, you never touch any hardware related things.\n\n###  The Kernel's 4 Jobs\n\n  1. Process Management - Kernel manage every running process.\n  2. Memory Management - Kernel decides which process get how much memory.\n  3. Device Drivers - This is important job of kernel to manage devices(hardware, virtual).\n  4. System Calls - A system call is a how a program asks the kernel to do something fot it.\n\n\n\n###  Users\n\nUsers are very important part of the OS bcz it create wall of processes and a single server can manage multiple users.\n\n###  UID\n\nEvery user gets a UID so the kernel identify the user.\n\n###  root\n\nThis is the BOSS of the system he can do anything in the system without any confirmation model and one more thing the root can do anything but it doesn't mean root have kernel mode this is steel in the user mode.\n\n###  Groups\n\nEvery user have a group and we can manage the permissions on the group so we easily add/remove users from group.\n\n##  The Shell & Basic Commands\n\n###  What the shell actually is\n\nThe shell is a program where we run commands. shell is a interface between kernel and users.\n\n###  Commands Structure\n\nprogram + options + argument. ls -l /home\nls - program\n-l - option\n/home - argument\n\n##  Core Commands\n\nls - list the data(files & Directories)\ncat - View the inside file\necho - print something\ntouch - create a file\ncp - copy anything\nmv - move anything\nrm - remove anything(you only remove files & directories that access you have)\n\n###  Navigation\n\npwd - present working directory\ncd - change directory\nmkdir - create directory\nrmdir - remove empty directory\n\n###  Absolute & Relative Path\n\nAbsolute path mean full path of the file for example:- /home/user/directory/test.txt\n\nRelative path mean only current folder path for example:- directory/test.txt\n\n###  Wildcards(globbing)\n\n  * - ls *.txt(now * mean find only .txt files) ? - ls filen?ame.txt(it mean now the ? find only one single letter)\n\n\n\n##  Intermediate Commands\n\n###  Searching/Viewing\n\ngrep - this cmds grep the exact line what we want(grep \"findme\" file.txt). -i(case insensitive) and -v(this exclude lines that containing findme) is options of this cmd.\nsort - sort lines alphabetically.\nhead - bydefault print 10 top lines(head filename.txt)\ntail - bydefault print 10 bottom lines(tail filename.txt)\nless - not print everything in single time it wait for your keys(up, down, q etc.)\n\n###  Finding/inspecting\n\nfind - this find in the subfolders also(but ls find only on the current directory)\nlocate - quickly find files and direcotries\ndiff - check differences between two files\nfile - details of any file\n\n##  Variables & PATH\n\n###  Shell Variables & Environment Variables\n\nShell variable are the private variables of the shell we can't use them in child programs but environment variable can do but before it we need to export that.\n\n###  How shell finds commands\n\nshell find cmds on the $PATH not in the whole system if sometime the program is installed but the shell throe error like (command not find) it mean that cmd is not in the $PATH\n\n##  Editing, Help, Input/Output & Errors\n\n###  Editing in the terminal\n\nvi, vim, nano, these are the terminal editors.(vim filename.txt)\nGetting Help: man, man -k, --help. (-k mean search keyword)\nRedirection & Pipes: >(> mean overwrite the content), >>(>> mean append the text), | (| mean get output preview cmd)\n\n##  Processes\n\n###  What is process\n\nProcess is a running instance of the program and every process have a PID(we can kill the process by their PID)\n\n###  Process Commands\n\nps: Show running Processes\nps aux: Show running processes with details\nkill : kill process by their PID\nkill -9 : forcefully kill the process\ncmd &: & used for run process in background\nctrl c: stop running process from screen that running right now on screen\n\n##  File Permissions\n\nWhen we run the ls -l command you see something like this:-\n-rwx-w-rw- 1 username groupname so on....\nBreakdown of this:-\n\n  * -> -(hyphen) mean this is a file rwx - r stand for read, w stand for write, x stand for execute. first 3 letter for owner, then 3 letter for group, and last three letter for others(other users). in our output(-rwx-w-rw-) you see -(hyphen) it mean this is file. then you see rwx it mean owner have read,write,execute permission. then you see (-w-) it mean group have only write permission not read not execute. and last 3(rw-) it mean others have read and write permission not execute.\n\n\n\n###  Change the permission\n\nchmod - it mean change mode so you can change the permissions like chmod 747. each permission have a number:-\nread - 4\nwrite - 2\nexecute - 1\nif we want read(4) and write(2) permission to owner just run this command chmod 600. 00 mean no permission to group and other.\nand we use something like chmod u+x, u+r. it mean please add execute and read permission for user(owner).\n\n###  Symbolic Links\n\nSymbolic link just like shortcut in window and alias in mac.\nCommands for linux:-\nln -s target linkname\nthe -s stand for symbolic link OR soft link.\n\n##  Archiving\n\n###  tar command\n\ntar mean bundle of the files & directories.\nif you want to create a bundle just run this cmd:- tar -czf filename.tar yourstuffs\nOptions of the cmd:-\n-czf - mean create\n-tzf - mean show the list inside bundle\n-xzf - mean extract the bundle\n\n###  gzip command\n\ngzip mean compress the file size of the bundle. it only used for create bundle + compress the size.\n.tar.gz\n\n##  Filesystem in Linux\n\nIn linux root you see this directories:-\netc, home, var, usr, tmp etc.\n\n###  etc\n\nThis directory have only configuration related data.\n\n###  home\n\nThis is only for users. how many users with there personal data.\n\n###  var\n\nThis directory for the logs of the system and logs are inside /var/log\n\n###  usr\n\nThis directory have most installed programs and /usr/bin have linux commands.\n\n###  tmp\n\nThis directory have temporary data as it name.\n\n##  Running Commands as super user(sudo)\n\nEvery linux user should know about this topic. coz it is very important to know. in linux you can't delete,view,run anything without permission and every user have permissions to what to do or not. some users have sudo access it mean they can install, delete anything in system without any permission bcz they have root access sudo stand for super user.",
  "title": "I Thought I Knew Linux — Then I Actually Learned It (Week 1)"
}