Unix notes

From 22126
Revision as of 15:40, 14 November 2024 by Gabre (talk | contribs) (Created page with "Certainly! Here's a Markdown version of the UNIX instructions from the provided PDF: # Using UNIX UNIX primarily operates through a command-line interface, allowing users to execute commands directly. While this may initially seem less intuitive than graphical interfaces, its power becomes evident with experience. ## Obtaining UNIX There are various methods to access UNIX: - **Windows**: Download and install [MobaXTerm](https://mobaxterm.mobatek.net/). - **Mac**: ma...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Certainly! Here's a Markdown version of the UNIX instructions from the provided PDF:

  1. Using UNIX

UNIX primarily operates through a command-line interface, allowing users to execute commands directly. While this may initially seem less intuitive than graphical interfaces, its power becomes evident with experience.

    1. Obtaining UNIX

There are various methods to access UNIX:

- **Windows**: Download and install [MobaXTerm](https://mobaxterm.mobatek.net/). - **Mac**: macOS is built on UNIX. Use the built-in Terminal application. - **Linux**: Linux distributions are UNIX-based; the terminal is readily available.

Launching the terminal opens the shell, the command-line interface awaiting your input.

    1. The Shell

The shell is the command-line interface where you input commands. The prompt, which varies across systems, indicates readiness for your input. Examples include:

- `aix4(s010178) $` - `interaction[pws]:/home/people/pws>` - `pws@antros:~$`

Different shells and operating systems may present unique prompts and behaviors.

    1. The File System

In this guide, placeholders like `<something>` indicate where you should input specific text. For example, `<filename>` should be replaced with the actual file name, such as `MyFile.txt`.

    • Naming Conventions**:

- Avoid spaces and special characters in file and directory names. Stick to:

 - `abcdefghijklmnopqrstuvwxyz`
 - `ABCDEFGHIJKLMNOPQRSTUVWXYZ`
 - `0123456789.-_`

- UNIX is case-sensitive: `MyFile.txt` and `myfile.txt` are distinct files. - While file extensions (e.g., `.doc`, `.txt`) aren't mandatory in UNIX, using them helps identify file types.

    • File Permissions**:

UNIX employs a permission system to control access:

- Three user categories:

 - **User**: The file owner.
 - **Group**: Users in the file's group.
 - **Others**: All other users.

- Each category has three permissions:

 - **Read (`r`)**: View the file's contents.
 - **Write (`w`)**: Modify the file.
 - **Execute (`x`)**: Run the file as a program.

For example, the command `ls -l` might display:

``` -rwxr--r-- 1 root sys 113520 Sep 5 14:15 good_program ```

This indicates:

- `good_program` is a file with:

 - User (`root`): Read, write, and execute permissions.
 - Group (`sys`): Read permission.
 - Others: Read permission.

For directories, a leading `d` denotes a directory:

``` drwxr-xr-x 6 gorm user 72 Jun 26 23:50 gorm_directory ```

Here:

- `gorm_directory` is a directory with:

 - User (`gorm`): Read, write, and execute permissions.
 - Group (`user`): Read and execute permissions.
 - Others: Read and execute permissions.

In directories:

- **Write (`w`)**: Allows creating or deleting files within the directory. - **Execute (`x`)**: Permits listing the directory's contents. Without execute permission, the directory appears empty when listed.

    1. Common UNIX Commands

UNIX commands often have options that modify their behavior. Use the `man` command to access manual pages for detailed information:

``` man <command> ```

For example, `man ls` provides details about the `ls` command.

    • Note**: Many commands can be terminated with `Ctrl + C`. Commands like `less` and `man` display information and await further input; press `q` to exit these commands.

For a comprehensive list of common UNIX commands and their descriptions, refer to the [UNIX Commands Summary](https://teaching.healthtech.dtu.dk/unix/index.php/Commands_summary).

This guide offers a foundational understanding of UNIX. As you become more familiar with the command-line interface, you'll discover its efficiency and versatility.