Explain about file systems in Unix/Linux ?

FileSystem in UNIX is all about file IO operations open a file, read a file, write a file, and so on. Most file IO on a UNIX system can be performed using only five functions: open, read, write, lseek, and close. We then examine the effect of various buffer sizes on the read and write functions.


JNTU       JNTU Kakinada       B.TECH      


Write a c program (receiver.c) that receives the messages (from the above message queue) & display them.

#include< stdio.h >
#include< systypes.h >
#include< sysipc.h >

JNTU       JNTU Anathapur       B.TECH      


Write a c program(sender.c) to create a message queue with read and write permissions to write 3 messages to it with different priorities.

#include< stdio.h >
#include< systypes.h >
#include< sysipc.h >

JNTU       JNTU Anathapur       B.TECH      


13. Write a c program that illustrates communication between 2 unrelated processes using named pipe(fifo).

#include< stdio.h >
#include< string.h >
#include< fcntl.h >
main(int argc,char *argv[])
{

JNTU       JNTU Anathapur       B.TECH      


Write a c program in which a parent writes a message to a pipe & the child reads the message

#include< stdio.h >
#include< string.h >
#include< unistd.h >
main()
{

JNTU       JNTU Anathapur       B.TECH      


12. write an awk script to count the number of characters,words & lines in a file.

#to run: awk -f 12.awk filename

#BODY section
{
len=length($0)

JNTU       JNTU Anathapur       B.TECH      


11. write an awk script to count the number of lines in a file that do not contain vowels.

#!binbash
echo "Enter file name"
read file

JNTU       JNTU Anathapur       B.TECH      


10. write a shell script that finds all links to a file

DIRTOSTART="$1"
FILE="$2"

JNTU       JNTU Anathapur       B.TECH      


9. write a shell script to backup the files in a specified directory

# to run . 9.sh srcdirectory destdirectory
#!binbash
SRCDIR="$1"

JNTU       JNTU Anathapur       B.TECH      


7. Write a shell script that removes duplicate lines from a file.

#to run . 7.sh sourcefile destinationfile
sort "$1" | uniq >> "$2"

JNTU       JNTU Anathapur       B.TECH      


6. Implement the grep command in c language.

#include< stdio.h >
#include< string.h >
#define BUFSIZE 256
#define FAILURE -1
#define SUCCESS 0

JNTU       JNTU Anathapur       B.TECH      


3. write a shell script that searches for a given string in a file

#!binbash
echo "Find the file you want to search the word in?"
read filename

JNTU       JNTU Anathapur       B.TECH      


write a shell script that compiles all c files in your directory 7 creates executable files.

for file in *.c
do
cc -o "${file}.execute" "${file}"
done

JNTU       JNTU Anathapur       B.TECH      


write a shell script that searches for a given string in a file

#!binbash
echo "Find the file you want to search the word in?"
read filename

JNTU       JNTU Anathapur       B.TECH      


write a shell script that creates users.

#to run . 2.sh username password
#!binbash
ROOT_UID=0

JNTU       JNTU Anathapur       B.TECH      


write a shell script that accepts a name from the user and displays whether it is a file, directory or something else.

#to run . 1.sh filename
if [ -L $1 ]
then
echo "file $1 is a symbolic link file"

JNTU       JNTU Anathapur       B.TECH      


Certification Course In Shell Programming



View More