> ## Documentation Index
> Fetch the complete documentation index at: https://docs.americ.io.vn/llms.txt
> Use this file to discover all available pages before exploring further.

# Folder/File Manipulation

> Common cases when create/move/copy/delete folders or files.

#### List files (ls) with detail

```shell theme={null}
ls -l -d1 */
ls -hla
ls -R
```

#### Copy (can add new name)

```shell theme={null}
cp old-path new-path
```

#### Move (can rename)

```shell theme={null}
mv old-path new-path
```

#### Delete (empty folder and contents)

```shell theme={null}
rm -rf path-to-folder/-or-file
```

#### Create a folder

```shell theme={null}
mkdir path-to-new-folder
```

#### Create path

```shell theme={null}
mkdir -p path/to/new/folder
```

#### Set folder permission for user (not change ownership)

```shell theme={null}
sudo apt-get update
sudo apt-get install -y acl
setfacl -R -m u:deploy:rwx $TARGET_FOLDER
setfacl -R -d -m u:deploy:rwx $TARGET_FOLDER
```

#### Change ownership folder recursively

```shell theme={null}
sudo chown -R $USER:$GROUP $TARGET_FOLDER
```

#### Install .deb

```shell theme={null}
sudo dpkg -i software.deb
```

#### Extract tar

```shell theme={null}
sudo tar -C /usr/local -xzf test.tar.gz
```

#### Compress tar

```shell theme={null}
tar -czvf archive-name.tar.gz foldername/
```

#### Shortcut location

> /usr/share/applications/ \
> /var/lib/flatpak/app/ \
> /current/active/export/share/applications/ \
> /home/americio/.local/share/applications/
