0% found this document useful (0 votes)
4 views

Unix Programing

Uploaded by

hepsi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Unix Programing

Uploaded by

hepsi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

UNIX PROGRAMING

Q1. What is unix,features,architecture,advantages,disadvantages?(1)


Advantages of UNIX
Stability: UNIX is known for its stability and reliability. It can run for long
periods of time without requiring a reboot, which makes it ideal for critical
systems that need to run continuously.
Security: UNIX has a robust security model that includes file permissions, user
accounts, and network security features. This makes it a popular choice for
systems that require high levels of security.
Scalability: UNIX can be scaled up to handle large workloads and can be used
on a variety of hardware platforms.
Flexibility: UNIX is highly customizable and can be configured to suit a wide
range of needs. It can be used for everything from simple desktop systems to
complex server environments.
Command-line interface: UNIX’s command-line interface allows for powerful
and efficient interaction with the system.
Disadvantages of UNIX
Complexity: UNIX can be complex and difficult to learn for users who are used
to graphical user interfaces (GUIs).
Cost: Some UNIX systems can be expensive, especially when compared to
open-source alternatives like Linux.
Lack of standardization: There are many different versions of UNIX, which can
make it difficult to ensure compatibility between different systems.
Limited software availability: Some specialized software may not be available
for UNIX systems.
Steep learning curve: UNIX requires a certain level of technical knowledge and
expertise, which can make it challenging for novice users.
Q2)unix commands?(3)

File System Navigation Unix Command


Command Description Example

cd Changes the current working directory. cd Documents

Lists files and directories in the current


ls
ls directory.

pwd Prints the current working directory. pwd

mkdir Creates a new directory. mkdir new_folder

rmdir Removes an empty directory. rmdir empty_folder

mv file1.txt
Moves files or directories.
mv Documents/

File Manipulation Unix Command


Command Description Example

Creates an empty file or updates the


touch new_file.txt
touch access and modification times.

cp file1.txt
Copies files or directories.
cp file2.txt

mv file1.txt
Moves files or directories.
mv Documents

rm Remove files or directories. rm old_file.txt

Changes the permissions of a file or


chmod 644 file.txt
chmod directory.
Process Management Unix Command
Command Description Example

Displays information about active processes, ps aux


ps including their status and IDs.

Displays a dynamic real-time view of system top


top processes and their resource usage.

Terminates processes using their process IDs kill <pid>


kill (PIDs).

Sends signals to processes based on name or pkill -9


pkill other attributes. firefox

killall -9
killall Terminates processes by name. firefox

Text Processing Unix Command


Command Description Example

Searches for patterns in text grep "error" logfile.txt


grep files.

sed
Processes and transforms 's/old_string/new_string/g'
sed text streams. file.txt

Processes and analyzes text


files using a pattern awk '{print $1, $3}' data.csv
scanning and processing
awk language.
Q3) what are types of file system in unix ?
Types of Unix Files
The UNIX files system contains several different types of filesTypes of
UNIX Files.

Special Files
Used to represent a real physical device such as a printer, tape drive
or terminal, used for Input/Output (I/O) operations. Device or special
files are used for device Input/Output(I/O) on UNIX and Linux
systems. They appear in a file system just like an ordinary file or a
directory. On UNIX systems there are two flavors of special files for
each device, character special files and block special files :
Pipes
UNIX allows you to link commands together using a pipe. The pipe
acts a temporary file which only exists to hold data from one
command until it is read by another.A Unix pipe provides a one-way
flow of data.The output or result of the first command sequence is
used as the input to the second command sequence. To make a pipe,
put a vertical bar (|) on the command line between two
commands.For example: who | wc -l In long-format output of ls –l ,
named pipes are marked by the “p” symbol.
Symbolic Link
Symbolic link is used for referencing some other file of the file
system.Symbolic link is also known as Soft link. It contains a text form
of the path to the file it references. To an end user, symbolic link will
appear to have its own name, but when you try reading or writing data
to this file, it will instead reference these operations to the file it points
to. If we delete the soft link itself , the data file would still be there.If we
delete the source file or move it to a different location, symbolic file will
not function properly. In long-format output of ls –l , Symbolic link are
marked by the “l” symbol (that’s a lower case L).
Advantages of the Unix file System
Hierarchical organization: The hierarchical structure of the Unix file
system makes it easy to organize and navigate files and directories.
Robustness: The Unix file system is known for its stability and
reliability. It can handle large amounts of data without becoming
unstable or crashing.
Security: The Unix file system uses a set of permissions that allows
administrators to control who has access to files and directories.
Compatibility: The Unix file system is widely used and supported,
which means that files can be easily transferred between different
Unix-based systems.
Disadvantages of the Unix file System
Complexity: The Unix file system can be complex to understand and
manage, especially for users who are not familiar with the command
line interface.
Steep Learning Curve: Users who are not familiar with Unix-based
systems may find it difficult to learn how to use the Unix file system.
Lack of User-Friendly Interface: The Unix file system is primarily
managed through the command line interface, which may not be as
user-friendly as a graphical user interface.
Limited Support for Certain File Systems: While the Unix file system
is compatible with many file systems, there are some file systems
that are not fully supported

You might also like