Code POC
Tutorials
Blogs
Search
Categories
Feeds
Unix Tutorial
Basic Programming
Shell script to check dir directory if it exists then change the path, if not then create dir with that name and also check for file name not exists
Prepare a menu driven calculator
Shell script to measure size of a file
Sort file abc.txt and save this sorted file in xyz.txt
How would we see content of the file?
Write a shell program to add, subtract and multiply the 2 given numbers passed as command line arguments
Write a shell script to reverse a number supplied by a user.
Write a shell program to count number of words, characters,white spaces and special symbols in a givin text
Write a shell script, which will receive any number of filenames as arguments .The shell script should check whether such files already exist.
Shell script which takes year as an input and displays whether it is leap year or not. If year is not provided then take current year as an input
Suppose four filenames are supplied then the first file should get copied into second file, the third file should get copied into four
Searching Programs
How would you count the number of words, lines and character of a file?
Write a shell script to find sum of digits of a number
Write a shell scripts that finds total no. of users and finds out how many of them are currently loggedin
Print message a shown in description
Count no.of character in file abc?
Shell script that prints names of all sub-directories present in the current directory
Shell Script to create a Menu Driven program : Hard Link, Soft Link, Counting each of the links for a specific link and Display the soft-links
How delete directory with files?
Program to convert and print this distance in meters, feet, inches and centimeters
Shell script to change extension of an existing file
Sort Numeric file
Create a file with 10 lines. Display lines from 5 to 8
Write a shell program to find the sum of the series sum=1+1/2+...+1/n
Explain two functionality of “mv” command with example?
Write a shell program to convert all the contents into the uppercase in a particular file
Write a shell script for renaming each files in the directory such that it will have the current shell PID as an extension
Shell script to display time in word
Write a shell script, which reports names and sizes of all files in a directory whose size is exceeding 1000 bytes
Shell script that takes filename or the filename with its full path as an input during execution and display ls -l command result for inputted file
Calculate 3+4+5+6
Shell Script combine file in one file horizontally and vertically
Shell script which whenever gets executed displays the message “Good Morning/Good afternoon /Good Evening “depending on the time it get executed
Count no.of lines in file abc?
Program to perform all ADDITION on two operands : (decimal, binary, octal,hexadecimal)
Shell script to display all users names, or users names of a particular group, or name of users who are currently working in the system
Is it possible to create and remover more than one directory together?
Write a script to enhance the calander to accept any month as mm or mmm or only year as yyyy or both month and year
Find the lines containing a number in a file
File Programs
Split a large file into small files
Write a shell program to display the alternate digits in a given 7 digit number starting from the first digit
Find out how many users are currently working.
Write a shell program to find the position of substring in given string
Sort Numeric file
Shell script to perform string replacement in a file and view the content of file
write a script to delete zero sized files from a given directory (and all its subdirectories)
Shell script to check whether inputted directory is in current directory or not
Script to find the value of one number raised to the power of another
Shell script to display the name of those files (in the given directory) which are having multiple links
Write a menu driven program to display message, user name, terminal name, login date and time
Display file in column format
Shell Script to make a menu driven calculator using case
Write a shell script to ask your name, program name and enrolement number and print it on the screen
Remove entire directory structure
How would you display the calendar of 2007?
Write a shell script to convert a file to lower case or upper case as specified by user.
Mathematical Program
List all hidden files in current directory
Write a shell script to display the digits which are in odd position in a given 5 digit number
Execute the command which display login name, the name of your terminal and date and time of since user logged in
Program to count length of user input string
How to find out difference between two files?
Write a script to count and report the number of entries in each subdirectory mentioned in the path, which is supplied as a command-line argument
Program to calculate the sum of its digits
Shell script to perform operations like display, list, make directory and copy, rename, delete, edit file
Write a shell program to search for a given number from the list of numbers provided using binary search method
Copy abc.txt into xyz
Write a shell script to find the average of the numbers entered in command line
Write a Script to Broadcast a message to a specified user when the user loged on any terminal
Find all lines in a file with words longer than 4 characters, assuming that words are separated by spaces except at the beginning or end of line
Write a shell script to search all files and rename them such that they do not contain the shell PID.
Shell script which whenever gets executed displays the message “Good Morning/Good afternoon /Good Evening “depending on the time it get executed
Write a shell script, which displays a list of all files in the current directory to which you have read, write and execute permissions
String Programs
Rename a file from first1.txt to first2.txt
Shell script to print first 5 odd numbers
Prepare the marksheet of the student
How would you know name of the users who are login?
How to compare two files?
List all hidden files in current directory
Shell Script to separate the colon from the given item
Shell script that prints names of all sub-directories present in the current directory
Program to calculate the area and perimeter of the rectangle
Shell script to perform database operations for student data like view, add and delete records
Write a shell script to sort the given numbers in descending order using Bubble sort
Change a permission of a file
Write a shell script to find the smallest of three numbers
menu driven shell program which have the options change the term, change the prompt and user list of unix system.
Write a shell program to count the characters, count the lines and the words in a particular file
Write s shell script, which will receive any number of filenames as arguments. The shell script should check whether every argument is a file or a dir
Shell Script to display the exit status using grep command which search a string from a string
Write a shells scripts which will receives a list of filenames,the first of whch would be wordfile
Sorting Programs
List all files start with a or A
Calculate 9/5
Shell script which would Receive the log name during execution ,obtain information about it from /etc/passswd and display this information on screen
How would you count the number of words, lines and character of a file?
Count no.of words in file abc?
Program to perform all SUBTRACTION on two operands : (decimal, binary, octal,hexadecimal)
Shell Script to create a pyramid of number
To identify directory and executable file which command is used?
Program to calculate the gross salary
Write a shell program to concatenate the contents of 2 files
General Programs
Combine two files to a single file
Write a shell program to find the gcd for the 2 given numbers
Explain the command, which work as spelling checker?
Write a shell program to check whether a given string is palindrome or not.
Shell script to check dir directory if it exists then change the path, if not then create dir with that name and also check for file name not exists
Shell script to perform operations like compare string, concatenate, find length, occurrence of word in a string and reverse a string
Script to make File and Directory Management Operations menu based : Display Current directory, List Directory, Make Directory, Change Directory etc
Shell script which receives two file names as arguments and checks whether the two file contents are same or not. If same then delete second file
Script to print all prime numbers from 1 to 300
Shell Script to check file is ordinary or not
Write a menu driven program to display message, user name, terminal name, login date and time
To identify directory and executable file which command is used?
Shell Script to find out the sum of the given numbers using command line argument
Write a shell script to find the sum, the average and the product of the four integers entered
How to create a directory and remove a directory?
How would u get today\’s date?
Write a menu driven shell script for Copy a file, Remove a file, Move a file
Directory Programs
Sort file abc.txt and save this sorted file in xyz.txt
Write a shell script to find the largest among the 3 given numbers
Display information about all the current programs running
Write a shell program to concatinate two strings and find the length of the resultent string
How to change permission of file as 644?
Write a shell program to find the position of substring in given string
Write a shell script that takes a file names as a argument and deletes this file from every directory above the present working directory.
Script to make File and Directory Management Operations menu based : Display Current directory, List Directory, Make Directory, Change Directory etc
Program to calculate the factorial of a number
Shell script for following conditions. Take two files as input and run spell command on it, Collect a list of potential spelling errors, modify file
Write a shell script that accepts a string from the terminal and echo suitable message if it doesn\’t have at least ten characters
Append abc.txt, xyz .txt
Write a shell script to display the digits which are in odd position in a given 5 digit number
Write a shell program to exchange the values of two variables
Print the calendar of December 2006
Write a shell script to reverse the contents of a file
Date, time, year Program
Convert first1.txt file to hidden file
Write a shell script to find the sum, the average and the product of the four integers entered
Shell script to take LOGNAME or the UID an an input and find how many terminals has this user logged in
How would you know machine\’s name in the network?
How to find out common lines between two files?
Display your current working directory
Back to Tutorials