{"id":18656470,"url":"https://github.com/manusoft/linux-documentation","last_synced_at":"2025-11-05T21:30:20.283Z","repository":{"id":211231629,"uuid":"728562817","full_name":"manusoft/linux-documentation","owner":"manusoft","description":"his comprehensive guide provides an overview of essential Ubuntu commands along with practical examples to help users navigate and manage their Ubuntu Linux systems effectively.","archived":false,"fork":false,"pushed_at":"2023-12-07T08:26:28.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-27T14:44:28.813Z","etag":null,"topics":["commands","linux","linux-ubuntu"],"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/manusoft.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}},"created_at":"2023-12-07T07:57:00.000Z","updated_at":"2024-02-03T14:56:47.000Z","dependencies_parsed_at":"2023-12-07T08:44:17.878Z","dependency_job_id":null,"html_url":"https://github.com/manusoft/linux-documentation","commit_stats":null,"previous_names":["manusoft/linux","manusoft/linux-documentation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manusoft%2Flinux-documentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manusoft%2Flinux-documentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manusoft%2Flinux-documentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manusoft%2Flinux-documentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manusoft","download_url":"https://codeload.github.com/manusoft/linux-documentation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239471689,"owners_count":19644364,"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":["commands","linux","linux-ubuntu"],"created_at":"2024-11-07T07:23:39.447Z","updated_at":"2025-11-05T21:30:20.116Z","avatar_url":"https://github.com/manusoft.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linux\n\n# Ubuntu Commands Documentation\n\nThis comprehensive guide provides an overview of essential Ubuntu commands along with practical examples to help users navigate and manage their Ubuntu Linux systems effectively.\n\n## Table of Contents\n\n1. [Navigation Commands](#navigation-commands)\n2. [File and Directory Operations](#file-and-directory-operations)\n3. [System Information](#system-information)\n4. [Package Management](#package-management)\n5. [User and Group Management](#user-and-group-management)\n6. [Process Management](#process-management)\n7. [Network Commands](#network-commands)\n8. [File Editing](#file-editing)\n9. [System Services](#system-services)\n10. [Permissions](#permissions)\n11. [Archiving and Compression](#archiving-and-compression)\n12. [Search Commands](#search-commands)\n\n# Navigation Commands\n\nNavigation commands are fundamental for moving around the file system and managing directories.\n\n## 1. `pwd` - Print Working Directory\n\nPrint the current working directory.\n\n```bash\npwd\n```\n\n**Example:**\n```bash\n/home/user/documents\n```\n\n## 2. `cd` - Change Directory\n\nChange the current directory.\n\n```bash\ncd /path/to/directory\n```\n\n**Example:**\n```bash\ncd /home/user/documents\n```\n\n## 3. `ls` - List Files and Directories\n\nList files and directories in the current directory.\n\n```bash\nls\nls -l\nls -a\n```\n\n**Examples:**\n```bash\n# Basic listing\nls\n\n# Detailed listing\nls -l\n\n# Show hidden files\nls -a\n```\n\nThese commands help you navigate through directories, understand your current location, and inspect the contents of a directory.\n\n# File and Directory Operations\n\nFile and directory operations are essential for managing files, copying, moving, and removing them.\n\n## 1. `cp` - Copy\n\nCopy files or directories.\n\n```bash\ncp source_file destination\ncp -r source_directory destination\n```\n\n**Examples:**\n```bash\n# Copy a file to a destination\ncp file.txt /path/to/destination\n\n# Copy a directory and its contents to a destination\ncp -r directory /path/to/destination\n```\n\n## 2. `mv` - Move/Rename\n\nMove or rename files or directories.\n\n```bash\nmv source destination\nmv oldname.txt newname.txt\n```\n\n**Examples:**\n```bash\n# Move a file to a destination\nmv file.txt /path/to/destination\n\n# Rename a file\nmv oldname.txt newname.txt\n```\n\n## 3. `rm` - Remove\n\nRemove files or directories.\n\n```bash\nrm file.txt\nrm -r directory\n```\n\n**Examples:**\n```bash\n# Remove a file\nrm file.txt\n\n# Remove a directory and its contents\nrm -r directory\n```\n\n## 4. `mkdir` - Make Directory\n\nCreate a new directory.\n\n```bash\nmkdir new_directory\n```\n\n**Example:**\n```bash\n# Create a new directory\nmkdir documents\n```\n\nThese commands enable you to manage files and directories, whether you're copying them, moving them to a different location, renaming them, or deleting them. Use them with caution, especially when dealing with the rm command, as it permanently deletes files.\n\n# System Information\n\nSystem information commands provide details about the operating system and its configuration.\n\n## 1. `uname` - Print System Information\n\nPrint system information.\n\n```bash\nuname -a\n```\n\n**Example:**\n```bash\nLinux hostname 5.4.0-104-generic #127-Ubuntu SMP Thu Apr 29 14:20:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux\n```\n\n## 2. `lsb_release` - Display LSB Information\n\nDisplay Linux Standard Base (LSB) information.\n\n```bash\nlsb_release -a\n```\n\n**Example:**\n```bash\nDistributor ID: Ubuntu\nDescription:    Ubuntu 20.04.2 LTS\nRelease:        20.04\nCodename:       focal\n```\n\n## 3. `df` - Show Disk Space Usage\n\nShow disk space usage.\n\n```bash\ndf -h\n```\n\n**Example:**\n```bash\nFilesystem      Size  Used Avail Use% Mounted on\n/dev/sda1        20G   8.2G   11G  44% /\n```\n\nThese commands help you understand the system environment, kernel version, and disk space utilization, providing crucial information for system administration and troubleshooting.\n\n# Package Management\n\nPackage management commands are used to install, upgrade, and remove software packages on Ubuntu.\n\n## 1. `apt` - Advanced Package Tool\n\nThe `apt` command is the primary package management tool for Ubuntu.\n\n### Update Package List\n\nUpdate the local package database.\n\n```bash\nsudo apt update\n```\n\n### Upgrade Packages\n\nUpgrade installed packages to their latest versions.\n\n```bash\nsudo apt upgrade\n```\n\n### Install Package\n\nInstall a new package.\n\n```bash\nsudo apt install package_name\n```\n\n### Remove Package\n\nRemove a package.\n\n```bash\nsudo apt remove package_name\n```\n\n**Examples:**\n```bash\n# Update package list\nsudo apt update\n\n# Upgrade installed packages\nsudo apt upgrade\n\n# Install a new package\nsudo apt install htop\n\n# Remove a package\nsudo apt remove firefox\n```\n\nThese commands facilitate the installation, upgrade, and removal of software packages on your Ubuntu system. The apt tool ensures proper dependency management and simplifies package-related tasks.\n\n# User and Group Management\n\nUser and group management commands are essential for handling user accounts and associated groups on Ubuntu.\n\n## 1. `useradd` - Add a New User\n\nCreate a new user account.\n\n```bash\nsudo useradd username\n```\n\n**Example:**\n```bash\nsudo useradd john_doe\n```\n\n## 2. `passwd` - Change User Password\n\nChange the password for a user.\n\n```bash\nsudo passwd username\n```\n\n**Example:**\n```bash\nsudo passwd john_doe\n```\n\n## 3. `usermod` - Modify User Properties\n\nModify user properties, such as group membership.\n\n```bash\nsudo usermod -aG groupname username\n```\n\n**Example:**\n```bash\nsudo usermod -aG sudo john_doe\n```\n\nThese commands allow you to manage user accounts by creating new users, updating their passwords, and modifying their group memberships. Proper user and group management are crucial for controlling access and permissions on a system.\n\n# Process Management\n\nProcess management commands are used to monitor and control running processes on Ubuntu.\n\n## 1. `ps` - Display Information about Processes\n\nDisplay information about running processes.\n\n```bash\nps aux\n```\n\n**Example:**\n```bash\nUSER       PID  %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\nuser      1234  0.0  0.1 123456  7890 ?        Ss   Dec01   0:00 /usr/bin/example\n```\n\n## 2. `top` - Display and Manage Processes\n\nDisplay and manage processes in real-time.\n\n```bash\ntop\n```\n\n**Example:**\n```bash\ntop - 14:28:35 up  1:24,  1 user,  load average: 0.00, 0.01, 0.05\nTasks: 123 total,   1 running, 122 sleeping,   0 stopped,   0 zombie\n%Cpu(s):  2.0 us,  1.0 sy,  0.0 ni, 96.8 id,  0.2 wa,  0.0 hi,  0.0 si,  0.0 st\nMiB Mem :   7862.2 total,   1234.5 free,   4567.8 used,   1059.9 buff/cache\nMiB Swap:   1024.0 total,    842.5 free,    181.5 used.   2787.2 avail Mem\n\n  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND\n 1234 user      20   0 123456  7890  5678 S   0.0   0.1   0:00.01 example\n```\n\n## 3. `kill` - Terminate a Process\n\nTerminate a process by sending a signal.\n\n```bash\nkill process_id\n```\n\n**Example:**\n```bash\nkill 1234\n```\n\nThese commands provide insights into running processes, their resource usage, and allow you to manage them effectively. Use caution when terminating processes to avoid unintended consequences.\n\n# Network Commands\n\nNetwork commands on Ubuntu are crucial for configuring network interfaces, checking connectivity, and monitoring network-related information.\n\n## 1. `ifconfig` - Configure Network Interfaces\n\nConfigure network interfaces and display their configuration.\n\n```bash\nifconfig\n```\n\n**Example:**\n```bash\nenp0s3: flags=4163\u003cUP,BROADCAST,RUNNING,MULTICAST\u003e  mtu 1500\n        inet 192.168.1.2  netmask 255.255.255.0  broadcast 192.168.1.255\n        inet6 fe80::a00:27ff:fe51:bd4c  prefixlen 64  scopeid 0x20\u003clink\u003e\n        ether 08:00:27:51:bd:4c  txqueuelen 1000  (Ethernet)\n        RX packets 12345  bytes 6789012 (6.7 MB)\n        RX errors 0  dropped 0  overruns 0  frame 0\n        TX packets 56789  bytes 12345678 (12.3 MB)\n        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0\n```\n\n## 2. `ping` - Check Network Connectivity\n\nCheck network connectivity to a host.\n\n```bash\nping example.com\n```\n\n**Example:**\n```bash\nPING example.com (93.184.216.34) 56(84) bytes of data.\n64 bytes from 93.184.216.34: icmp_seq=1 ttl=56 time=11.1 ms\n```\n\n## 3. `netstat` - Display Network Connections\n\nDisplay information about network connections, routing tables, and interface statistics.\n\n```bash\nnetstat -a\n```\n\n**Example:**\n```bash\nProto Recv-Q Send-Q Local Address           Foreign Address         State\ntcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN\nudp        0      0 0.0.0.0:5353            0.0.0.0:*\n```\n\nThese commands are essential for managing network configurations, checking connectivity, and troubleshooting network-related issues. The examples provided offer insights into current network configurations and connectivity checks.\n\n## File Editing\n\nFile editing commands are used to create, view, and modify text files directly from the command line.\n\n## 1. `nano` - Text Editor for the Command Line\n\nOpen a text file for editing using the `nano` text editor.\n\n```bash\nnano filename\n```\n\n**Example:**\n```bash\nnano document.txt\n```\n\nUse the arrow keys to navigate, and press `Ctrl + X` to exit (followed by `Y` to confirm changes and `Enter`).\n\n## 2. `vim` - Highly Configurable Text Editor\n\nOpen a text file for editing using the `vim` text editor.\n\n```bash\nvim filename\n```\n\n**Example:**\n```bash\nvim document.txt\n```\n\nIn `vim`, press `i` to enter insert mode, make changes, and press `Esc` to exit insert mode. To save changes and exit, type `:wq` and press `Enter`.\n\nThese commands provide basic text editing capabilities directly from the command line. Choose between `nano` for a simple interface or `vim` for a more powerful and feature-rich text editor.\n\n# System Services\n\nSystem services on Ubuntu are controlled using the `systemctl` command. This allows for starting, stopping, restarting, and checking the status of services.\n\n## 1. `systemctl` - Control System Services\n\nControl system services using the `systemctl` command.\n\n### Start a Service\n\n```bash\nsudo systemctl start service_name\n```\n\n**Example:**\n```bash\nsudo systemctl start apache2\n```\n\n### Stop a Service\n\n```bash\nsudo systemctl stop service_name\n```\n\n**Example:**\n```bash\nsudo systemctl stop apache2\n```\n\n### Restart a Service\n\n```bash\nsudo systemctl restart service_name\n```\n\n**Example:**\n```bash\nsudo systemctl restart apache2\n```\n\n### Check Status of a Service\n\n```bash\nsudo systemctl status service_name\n```\n\n**Example:**\n```bash\nsudo systemctl status apache2\n```\n\nThese commands provide a way to manage system services, such as web servers, databases, or other background processes. Use them to ensure that services are running as expected and to troubleshoot any issues.\n\n# Permissions\n\nPermissions in Linux determine who can access files and directories and what actions they can perform. The `chmod` and `chown` commands are used to modify file and directory permissions.\n\n## 1. `chmod` - Change File Permissions\n\nChange the permissions of a file or directory.\n\n### Symbolic Notation\n\n```bash\nchmod permissions filename\n```\n\n**Example:**\n```bash\nchmod +x script.sh\n```\n\n### Octal Notation\n\n```bash\nchmod 755 filename\n```\n\n**Example:**\n```bash\nchmod 644 document.txt\n```\n\n## 2. `chown` - Change File Owner\n\nChange the owner of a file or directory.\n\n```bash\nchown new_owner:new_group filename\n```\n\n**Example:**\n```bash\nchown john:users document.txt\n```\n\nThese commands are crucial for controlling access to files and directories. The `chmod` command modifies permissions, specifying who can read, write, or execute a file, while the `chown` command changes the owner of a file, allowing specific users or groups to have control over it. Use these commands with caution to maintain a secure and well-managed file system.\n\n# Archiving and Compression\n\nArchiving and compression commands in Ubuntu are used to bundle files and reduce their size for efficient storage and transfer.\n\n## 1. `tar` - Archive Files and Directories\n\nCreate and extract archive files using the `tar` command.\n\n### Create a Tar Archive\n\n```bash\ntar -cvf archive.tar file1 file2\n```\n\n**Example:**\n```bash\ntar -cvf backup.tar /home/user/documents\n```\n\n### Extract a Tar Archive\n\n```bash\ntar -xvf archive.tar\n```\n\n**Example:**\n```bash\ntar -xvf backup.tar\n```\n\n## 2. `gzip` - Compress Files\n\nCompress files using the `gzip` command.\n\n### Compress a File\n\n```bash\ngzip filename\n```\n\n**Example:**\n```bash\ngzip document.txt\n```\n\n### Decompress a File\n\n```bash\ngzip -d filename.gz\n```\n\n**Example:**\n```bash\ngzip -d document.txt.gz\n```\n\nThese commands allow you to create archives of multiple files or directories and compress individual files to save space. The combination of `tar` and `gzip` is commonly used for creating compressed archives on Ubuntu systems.\n\n# Search Commands\n\nSearch commands in Ubuntu help locate files, directories, and content within files.\n\n## 1. `find` - Search for Files and Directories\n\nSearch for files and directories based on various criteria.\n\n```bash\nfind /path/to/search -name \"filename\"\n```\n\n**Example:**\n```bash\nfind /home/user/documents -name \"*.txt\"\n```\n\n## 2. `grep` - Search for Patterns in Files\n\nSearch for patterns within files.\n\n```bash\ngrep \"pattern\" filename\n```\n\n**Example:**\n```bash\ngrep \"error\" log.txt\n```\n\nThese commands are essential for locating files and content within them. The `find` command is versatile and allows for complex search criteria, while `grep` is powerful for searching within the content of files. These tools are invaluable for system administration and troubleshooting.\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanusoft%2Flinux-documentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanusoft%2Flinux-documentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanusoft%2Flinux-documentation/lists"}