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

# Basic Linux Commands

> Essential Linux commands for navigating, managing files, and inspecting your VPS.

A quick reference for the commands you'll use most often on your CrazyNode VPS.

## Navigation

```bash theme={null}
pwd              # print current directory
ls -lah          # list files with details
cd /var/www      # change directory
cd ~             # go to home directory
cd -             # go to previous directory
```

## Files and directories

```bash theme={null}
touch file.txt          # create empty file
mkdir -p path/to/dir    # create nested directories
cp source dest          # copy files
mv old new              # move or rename
rm file.txt             # delete file
rm -rf directory        # delete directory (careful!)
cat file.txt            # print file contents
less file.txt           # scroll through a file
tail -f log.txt         # follow a log file in real time
```

## Editing files

```bash theme={null}
nano file.txt           # beginner-friendly editor
vim file.txt            # advanced editor
```

## Permissions

```bash theme={null}
chmod 644 file.txt      # rw for owner, r for others
chmod 755 script.sh     # rwx for owner, rx for others
chown user:group file   # change ownership
```

## Users and sudo

```bash theme={null}
whoami                  # who am I
su - username           # switch user
sudo command            # run as root
passwd                  # change your password
```

## System information

```bash theme={null}
uname -a                # kernel info
lsb_release -a          # OS version
df -h                   # disk usage
free -h                 # memory usage
top                     # live process view (q to quit)
htop                    # nicer top (install with apt install htop)
uptime                  # how long the server has been up
```

## Networking

```bash theme={null}
ip addr                 # network interfaces and IPs
ping google.com         # test connectivity
curl https://example.com  # make HTTP request
ss -tulpn               # list open ports
```

## Package management

<CodeGroup>
  ```bash Ubuntu/Debian theme={null}
  apt update && apt upgrade -y
  apt install nginx
  apt remove nginx
  ```

  ```bash AlmaLinux/Rocky theme={null}
  dnf update -y
  dnf install nginx
  dnf remove nginx
  ```
</CodeGroup>

## Services

```bash theme={null}
systemctl start nginx
systemctl stop nginx
systemctl restart nginx
systemctl status nginx
systemctl enable nginx   # start on boot
```
