{"id":23440730,"url":"https://github.com/s4nkalp/linux-cheat-sheet","last_synced_at":"2025-10-19T15:42:53.549Z","repository":{"id":152159195,"uuid":"604681226","full_name":"S4NKALP/linux-cheat-sheet","owner":"S4NKALP","description":"A list of essential LINUX information and commands every users should know","archived":false,"fork":false,"pushed_at":"2023-02-21T15:15:16.000Z","size":3,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T12:47:50.227Z","etag":null,"topics":["cheat-sheat","cheatsheet","linux"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/S4NKALP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-21T15:14:25.000Z","updated_at":"2024-12-26T01:19:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"f1a8222a-2202-4fae-954a-131ce5e7e640","html_url":"https://github.com/S4NKALP/linux-cheat-sheet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S4NKALP%2Flinux-cheat-sheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S4NKALP%2Flinux-cheat-sheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S4NKALP%2Flinux-cheat-sheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S4NKALP%2Flinux-cheat-sheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/S4NKALP","download_url":"https://codeload.github.com/S4NKALP/linux-cheat-sheet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248108811,"owners_count":21049205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cheat-sheat","cheatsheet","linux"],"created_at":"2024-12-23T16:18:24.776Z","updated_at":"2025-10-19T15:42:48.500Z","avatar_url":"https://github.com/S4NKALP.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003eLinux Cheat Sheet\u003c/h1\u003e\n\u003cp\u003eA curated list of essential Linux information and commands every user should know\u003c/p\u003e\n\n![OS-Linux-icon](https://icons.iconarchive.com/icons/dakirby309/simply-styled/128/OS-Linux-icon.png)\n\u003c/div\u003e\n\n# Index\n**File Management** :file_folder:  \n\u0026emsp;• [Change Directories](#change-directories)  \n\u0026emsp;• [List Files](#list-files)  \n\u0026emsp;• [Current Directory](#current-directory)  \n\u0026emsp;• [File Contents](#file-contents)  \n\u0026emsp;• [File Creation](#file-creation)  \n\u0026emsp;• [File Deletion](#file-deletion)  \n\u0026emsp;• [Copy Files](#copy-files)  \n\u0026emsp;• [Move Files](#move-files)  \n\u0026emsp;• [Compare Files](#compare-files)  \n\u0026emsp;• [Symbolic Links](#symbolic-links)  \n**Permission Manipulation** :briefcase:  \n\u0026emsp;• [Accessors](#accessors)  \n\u0026emsp;• [Permissions](#permissions)  \n\u0026emsp;• [Symbolic vs Absolute](#symbolic-vs-absolute)  \n\u0026emsp;• [Change Ownership](#change-ownership)  \n\u0026emsp;• [Set Permissions](#set-permissions)  \n**Packaging** :package:  \n\u0026emsp;• [Sync Package List](#sync-package-list)  \n\u0026emsp;• [Query Packages](#query-packages)  \n\u0026emsp;• [Install Packages](#install-packages)  \n\u0026emsp;• [Delete Packages](#delete-packages)  \n\u0026emsp;• [List Packages](#list-packages)  \n\u0026emsp;• [Package Information](#package-information)   \n**Source Control** :octocat:  \n\u0026emsp;• [Clone Repositories](#clone-repositories)  \n\u0026emsp;• [Stage Files](#stage-files)  \n\u0026emsp;• [Commit Files](#commit-files)  \n\u0026emsp;• [Upload Files](#upload-files)\n\n## Legend\n\u0026ensp;• angle brackets `\u003crequired argument\u003e`  \n\u0026ensp;• square brackets `[optional option]`  \n\u0026ensp;• curly braces `{default values}`  \n\u0026ensp;• parenthesis `(miscellaneous info)`  \n\u0026ensp;• hastag `# comment`\n\n\u003cdetails open\u003e\u003csummary\u003e\u003ch3\u003e:file_folder: File Management\u003c/h3\u003e\u003c/summary\u003e\n\nIn Linux everything is a file. Directories are just a list of files and for that reason, many programs such as `ls` and `mv` don't disctriminate\n## Change Directories\nchange to a directory (home)\n```bash\ncd [dirPath]\n```\n\n## List Files\nlist all files in a directory (current)\n```bash\nls [dirPath]\n# including hidden\nls -A [dirPath]\n```\n\n## Current Directory\nreturn path to working directory\n```bash\npwd\n```\n\n## File Contents\noutput file content to terminal\n```bash\ncat \u003cfilePath\u003e\n# first \u003cN\u003e lines\nhead \u003cN\u003e \u003cfilePath\u003e\n# last \u003cN\u003e lines\ntail \u003cN\u003e \u003cfilePath\u003e\n```\n\n## File Creation\nmake file\n```bash\ncat [someText] \u003e \u003cfilePath\u003e\n# join two files into a new file\ncat \u003cfilePath\u003e \u003cfilePath\u003e \u003e \u003cfilePath\u003e\n# make directory\nmkdir \u003cdirPath\u003e\n```\n\n## File Deletion\n```bash\nrm \u003cfilePath\u003e\n# and directories\nrm -r \u003cdirPath\u003e\n# recursive force (without confirmation)\nrm -fr \u003cdirPath\u003e\n```\n\n## Copy Files\ncopy files to a destination directory\n```bash\ncp \u003cfilePath\u003e \u003cdirPath\u003e\n# and directories\ncp -r \u003cdirPath\u003e \u003cdirPath\u003e\n```\n\n## Move Files\nmove files/directories to a destination\n```bash\nmv \u003cfilePath\u003e \u003cdirPath\u003e\n# rename a file\nmv \u003cfileName\u003e \u003cnewFileName\u003e\n```\n\n## Compare Files\ncheck the difference between two files\n```bash\ndiff \u003cfilePath\u003e \u003cfilePath\u003e\n```\n\n## Symbolic Links\ncreate a link pointing to target file (shortcut)\n```bash\nln -s \u003cfilePath\u003e \u003clinkName\u003e\n```\n\n---\n\u003c/details\u003e\n\u003cdetails open\u003e\u003csummary\u003e\u003ch3\u003e:briefcase: Permission Manipulation\u003c/h3\u003e\u003c/summary\u003e\n\nEvery file on a Linux system has read, write \u0026 execute permissions defined per user, group \u0026 other\n## Accessors\n[`u`]ser — who created the file  \n[`g`]roup — set of users with common permissions  \n[`o`]ther — anyone who isn't user or in groups  \n[`a`]ll — all of the above (`ugo`)\n\n## Permissions\n[`r`]ead — view file contents  \n[`w`]rite — edit/modify file  \ne[`x`]ecute — run executable or view directory  \nnone - no rights (`-`)\n\n## Symbolic vs Absolute\nsymbolic ｜ absolute, read, write \u0026 execute per user, group \u0026 other command sequence table\n\n• | u | g | o | ug | uo | go | a\n--- | --- | --- | --- | --- | --- | --- | ---\n**r** | `u=r`｜`400` | `g=r`｜`040` | `o=r`｜`004` | `ug=r`｜`440` | `uo=r`｜`404` | `go=r`｜`044` | `a=r`｜`444`\n**w** | `u=w`｜`200` | `g=w`｜`020` | `o=w`｜`002` | `ug=w`｜`220` | `uo=w`｜`202` | `go=w`｜`022` | `a=w`｜`222`\n**x** | `u=x`｜`100` | `g=x`｜`010` | `o=x`｜`001` | `ug=x`｜`110` | `uo=x`｜`101` | `go=x`｜`011` | `a=x`｜`111`\n**rw** | `u=rw`｜`600` | `g=rw`｜`060` | `o=rw`｜`006` | `ug=rw`｜`660` | `uo=rw`｜`606` | `go=rw`｜`066` | `a=rw`｜`666`\n**rx** | `u=rx`｜`500` | `g=rx`｜`050` | `o=rx`｜`005` | `ug=rx`｜`550` | `uo=rx`｜`505` | `go=rx`｜`055` | `a=rx`｜`555`\n**wx** | `u=wx`｜`300` | `g=wx`｜`030` | `o=wx`｜`003` | `ug=wx`｜`330` | `uo=wx`｜`303` | `go=wx`｜`033` | `a=wx`｜`333`\n**rwx** | `u=rwx`｜`700` | `g=rwx`｜`070` | `o=rwx`｜`007` | `ug=rwx`｜`770` | `uo=rwx`｜`707` | `go=rwx`｜`007` | `a=rwx`｜`777`\n\n## Change Ownership\nset a user (and group) to a file\n```bash\nchown \u003cuser\u003e[:group] \u003cfilePath\u003e\n```\n\n## Set Permissions\ndefine permissions per user, group \u0026 other of file\n```bash\nchmod \u003cpermissions\u003e \u003cfilePath\u003e\n```\n\n\u003c/details\u003e\n\u003cdetails open\u003e\u003csummary\u003e\u003ch3\u003e:package: Packaging\u003c/h3\u003e\u003c/summary\u003e\n\nInstalling programs in Linux is a bit different than on Windows. When you need a specific program, it's best to use your system's package manager to install software. Package managers handle dependencies, upgrading, querying, installing, removing, listing packages and much more. They severly reduce the complexity of installing software for the end-user \n## Sync Package List\nupgrade packages \u0026 sync repositories\n```bash\n# arch linux\npacman -Syu\n# debian\napt update \u0026\u0026 apt upgrade\n```\n\n## Query Packages\nsearch for a package\n```bash\n# arch linux\npacman -Ss [package]\n# debian\napt search [package]\n```\n\n## Install Packages\ninstall a package\n```bash\n# arch linux\npacman -S \u003cpackage\u003e\n# debian\napt install \u003cpackage\u003e\n```\n\n## Delete Packages\nuninstall a package\n```bash\n# arch linux\npacman -Runss \u003cpackage\u003e\n# debian\napt purge \u003cpackage\u003e\n```\n\n## List Installed\nlist installed packages\n```bash\n# arch linux\npacman -Qe\n# debian\napt list --installed\n```\n\n## Package Information\n```bash\n# arch linux\npacman -Si \u003cpackage\u003e\n# debian\napt info \u003cpackage\u003e\n```\n\n\u003c/details\u003e\n\u003cdetails open\u003e\u003csummary\u003e\u003ch3\u003e:octocat: Source Control\u003c/h3\u003e\u003c/summary\u003e\n\nUsing below methods to clone an existing (empty) repository, means we can skip several unecessary, over-complicated commands\n## Clone Repositories\ndownload a repositories contents (\u0026 .git)\n```bash\ngit clone https://github.com/\u003cuser\u003e/\u003crepository\u003e\n# or a specific branch\ngit clone -b \u003cbranch\u003e --single-branch https://github.com/\u003cuser\u003e/\u003crepository\u003e\n```\n\n﹡ _although this command uses github as a refrence, any suitable version control software should work as intended_\n\n## Stage Files\nadd new or changed files to the staging area\n```bash\ngit add .\n```\n\n## Commit Files\nsnapshot staged files with a message\n```bash\ngit commit -m 'initial commit'\n```\n\n## Upload Files\nupload staged files\n```bash\ngit push\n```\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs4nkalp%2Flinux-cheat-sheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs4nkalp%2Flinux-cheat-sheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs4nkalp%2Flinux-cheat-sheet/lists"}