0% found this document useful (0 votes)
5 views8 pages

Unix Important Questions 2

The document outlines the POSIX standards for ensuring application portability across UNIX-like operating systems and describes the Single User Specification for system maintenance. It details the features of UNIX, including its file system structure and key directories, as well as attributes of files and directories. Additionally, it covers shell creation steps, the responsibilities of a UNIX system administrator, and user account management processes.

Uploaded by

bca.friends69
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views8 pages

Unix Important Questions 2

The document outlines the POSIX standards for ensuring application portability across UNIX-like operating systems and describes the Single User Specification for system maintenance. It details the features of UNIX, including its file system structure and key directories, as well as attributes of files and directories. Additionally, it covers shell creation steps, the responsibilities of a UNIX system administrator, and user account management processes.

Uploaded by

bca.friends69
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

POSIX and Single User Specification

• POSIX (Portable Operating System Interface):


o A family of standards specified by IEEE (Institute ofElectrical and Electronics
Engineers) to ensure portability of applications across different UNIX-like
operating systems.
o Defines a standard set of system calls, libraries, and utilities that compliant
operating systems should provide.
o The goal is to allow developers to write applications that can be easily ported
from one POSIX-compliant system to another with minimal changes.
o Many modern UNIX-like systems, including Linux and macOS, strive for POSIX
compliance.
• Single User Specification:
o Refers to a system state where only one user has access to the system. This
mode is often used for system administration tasks, such as repairing file
systems or performing critical maintenance, without interference from other
users or processes.
o In single-user mode, network services are usually disabled, and a minimal set
of processes are running.
o It's a low-level maintenance mode that provides direct access to the system.

Features of UNIX
• Portability: Designed to be easily adapted to new hardware architectures.
• Multi-user and Multitasking: Allows multiple users to run multiple programs
concurrently, improving system efficiency.
• Hierarchical File System: Provides a logical and organized way to store and
manage data.
• Command-Line Interface: Offers powerful and efficient control over the
system through text-based commands.
• Shell Scripting: Enables automation of tasks and creation of powerful utilities
using shell programming.
• Pipes and Redirection: Allows for flexible manipulation of input and output
between commands.
o Pipe (|): Sends the output of one command as the input to another
command.
Important file system of unix
1. /bin (Binary):
• Contains essential command binaries used by all users.
• Examples: ls, cp, mv, rm, etc.

2. /usr/bin:
• Contains non-essential user command binaries.
• Used by regular users for general-purpose applications.
• Examples: python, gcc, firefox

3. /sbin:
• Contains system binaries used by the system administrator.
• Examples: ifconfig, reboot, fdisk

4. /usr/sbin:
• Contains non-essential system binaries for administrative tasks.
• Examples: apache2, named, sshd

5. /etc:
• Contains system configuration files.
• Examples: /etc/passwd, /etc/fstab, /etc/hostname

6. /dev:
• Contains device files that represent hardware devices.
• Examples: /dev/sda, /dev/tty, /dev/null

7. /lib:
• Contains essential shared libraries needed by programs in /bin and
/sbin.
• Also includes kernel modules.

8. /usr/lib:
• Contains libraries for binaries in /usr/bin and /usr/sbin.

9. /usr/include:
• Contains header files used for C/C++ development.
• Example: standard headers like stdio.h, stdlib.h

10. /usr/share/man:
• Contains manual (man) pages for commands.
• Used by man command for documentation.

11. /temp (usually /tmp):


• Temporary file storage.
• Files here may be deleted automatically on reboot.

12. /var:
• Contains variable data like logs, mail, spool files.
• Example: /var/log, /var/spool
13. /home:
• Contains user home directories.
• Example: /home/alice, /home/bob
File and directory attribute
Attribute: Description
File Type: Identifies if it's a file (-), directory (d), link (l), etc.
Permissions: Read (r), Write (w), Execute (x) rights for User, Group, Others
Owner: Username of the file/directory owner
Group: Group that owns the file/directory
Size: File size in bytes (directory shows space metadata occupies)
Timestamp: Last Modified Time (mtime), Access Time (atime), Change Time
(ctime)
Inode: Unique identifier for each file in the filesystem
Pattern Matching (Globbing)
• The shell uses special characters to match patterns in filenames:
o
*: Matches any sequence of characters (including an empty sequence).
o ?: Matches any single character.
o [ ]: Matches any single character within the brackets. You can specify a range
(e.g., [a-z], [0-9]).
o [! ] or [^ ]: Matches any single character not within the brackets.
• Examples:
o ls *.txt: Lists all files ending in .txt.
o rm file?.txt: Removes files named file followed by any single character and
.txt (e.g., file1.txt filea.txt).
o ls [abc]*.txt: Lists files starting with a, b, or c and ending in .txt.
o ls [!0-9]*.txt: Lists files not starting with a digit and ending in .txt.
Shell Creation Steps in UNIX – Short Answer
When a shell (like bash, sh, etc.) is created or started in UNIX, the following
steps occur:

1. User Logs In
• Login can be through terminal, GUI, or remote session (e.g., SSH).

2. Authentication
• The system checks the username and password against /etc/passwd and
/etc/shadow.

3. Shell is Assigned
• Based on user entry in /etc/passwd, the system launches the default
shell (e.g., /bin/bash).

4. Shell Initialization Scripts Execute


• Shell reads configuration files:
o For login shells: /etc/profile, ~/.bash_profile, ~/.profile
o For non-login shells: ~/.bashrc

5. Environment Setup
• Shell sets environment variables like PATH, HOME, USER, etc.
• Custom aliases, prompt settings, and functions are also loaded.

6. Shell Prompt Appears


• The shell displays a prompt (e.g., $ or #) ready to accept user commands.
Essential Duties of a UNIX System Administrator – Short Answer
A UNIX system administrator is responsible for maintaining, configuring, and
ensuring reliable operation of UNIX-based systems. Their duties are crucial for
smooth and secure system performance.

Key Responsibilities:
1. User Account Management
o Create, delete, and manage user accounts and groups
o Set passwords, assign permissions, and monitor usage
2. File System Management
o Monitor disk space
o Mount/unmount file systems
o Perform backups and recovery
3. Process and Resource Management
o Monitor and control system processes
o Manage CPU and memory usage
o Schedule jobs using cron or at
4. Software Installation and Updates
o Install and configure software packages
o Apply patches and updates regularly
5. Security Administration
o Set file permissions
o Configure firewalls
o Monitor system logs for suspicious activity
6. Network Configuration
o Set up and maintain network interfaces
o Configure IP, DNS, routing, and NFS/FTP services
7. System Performance Monitoring
o Analyze logs and resource usage
o Tune system performance
8. Startup and Shutdown Procedures
o Manage system boot process (BIOS, GRUB, init/systemd)
o Define services to run at different runlevels
9. Backup and Disaster Recovery
o Schedule and test backups
o Restore data during failures
10.Documentation and Support
• Maintain system documentation
• Provide technical support to users
Brief Idea About User Account Management in UNIX – Short Answer
User account management in UNIX involves creating, maintaining, and
controlling user access to ensure security, resource allocation, and system
integrity.

Key Elements of a User Account:

Component: Description

Username: Unique name to identify a user (e.g., john)

Password: Secures the account; stored (encrypted) in /etc/shadow

User ID (UID): Numerical ID assigned to each user

Group ID (GID): Defines user’s primary group

Home Directory: Personal space (e.g., /home/john) to store files

Shell: Default command-line interface (e.g., /bin/bash)

Terminal: Interface for user interaction (e.g., tty, pts)

Disk Quota: Limits disk usage per user to prevent overuse

Important Files:
• /etc/passwd – Stores user account info
• /etc/shadow – Stores encrypted passwords
• /etc/group – Stores group details

Common Commands:
• adduser / useradd – Add a new user
• passwd – Set/change password
• usermod – Modify user account
• deluser / userdel – Delete user account
• quota – Check disk quota

Purpose of User Management:


• Secure system access
• Provide personalized environments
• Allocate system resources properly

You might also like