Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

a) Write a shell script to list all of the directory files in a directory.

# !/bin/bash
echo "enter directory name"
read dir
if[ -d $dir]
then
echo "list of files in the directory"
ls –l $dir|egrep ‘^d’
else
echo "enter proper directory name"
fi
Source by vikramlearning.com #
 
PREVIOUS NEXT
Tagged: #Write #shell #script #list #directory #files
ADD COMMENT
Topic
Name
4+2 =