forked from Fascinated/docs
add linux basics
This commit is contained in:
parent
5874a51b36
commit
18c94ad885
@ -8,5 +8,52 @@ editor: markdown
|
||||
dateCreated: 2023-06-27T07:54:18.672Z
|
||||
---
|
||||
|
||||
# Header
|
||||
Your content here
|
||||
# Linux Basics
|
||||
|
||||
This guide provides a brief introduction to Linux, including basic commands and concepts.
|
||||
|
||||
## Navigating the filesystem
|
||||
|
||||
- Change a directory: `cd <directory>`
|
||||
- List files in a directory: `ls`
|
||||
- List files in a directory (including hidden files): `ls -a`
|
||||
- Getting the current directory: `pwd`
|
||||
- Going back a directory: `cd ..`
|
||||
|
||||
## Managing Files and Directories
|
||||
|
||||
- Create a new directory: `mkdir <directory>`
|
||||
- Create a new file: `touch <file>`
|
||||
- Copy a file: `cp <file> <new-file>`
|
||||
- Remove a file: `rm <file>`
|
||||
- Remove a directory: `rm -r <directory>`
|
||||
|
||||
## File Permissions
|
||||
|
||||
- Change file permissions: `chmod <permissions> <file>`
|
||||
- Change file ownership: `chown <user> <file>`
|
||||
- Change file ownership (recursively): `chown -R <user> <directory>`
|
||||
- View file permissions: `ls -l <file>`
|
||||
|
||||
## Text Processing
|
||||
|
||||
- View a file: `cat <file>`
|
||||
- View a file (with line numbers): `cat -n <file>`
|
||||
- Get the beginning of a file: `head <file>`
|
||||
- Get the end of a file: `tail <file>`
|
||||
|
||||
## Package Management (Ubuntu)
|
||||
|
||||
- Update package lists: `sudo apt update`
|
||||
- Install a package: `sudo apt install <package>`
|
||||
- Purge a package: `sudo apt purge <package>`
|
||||
- Remove a package: `sudo apt remove <package>`
|
||||
- Search for a package: `apt search <package>`
|
||||
- Upgrade packages: `sudo apt upgrade`
|
||||
|
||||
## File Compression and Archiving
|
||||
|
||||
- Create a tar archive: `tar -cvf <archive.tar> <file>`
|
||||
- Extract a tar archive: `tar -xvf <archive.tar>`
|
||||
- Create a zip archive: `zip <archive.zip> <file>`
|
||||
- Extract a zip archive: `unzip <archive.zip>`
|
||||
|
Loading…
Reference in New Issue
Block a user