Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » Homework HelpRSS Feeds

Shell script to display the name of those files (in the given directory) which are having multiple links

Posted By: Joshua Evans     Category: Unix / Linux / Ubuntu     Views: 8073

Write a script to display the name of those files (in the given directory) which are having multiple links.

Code for Shell script to display the name of those files (in the given directory) which are having multiple links in Unix / Linux / Ubuntu

echo -e    -: DISPLAY FILES HAVING MULTIPLE LINKS :-"
echo -e   DIRECTROY PATH : \C"
read dirpath

ls -l $dirpath| tr -s " ""|" > flinks

grep -v "|1|" flinks | cut -d"|" -f9 > fname

echo -e "  files having multiple in  $dirpath are "

cat fname


OUTPUT
***********

[04mca58@LINTEL 04mca58]$ sh mulink.sh

DISPLAY FILES HAVING MULTIPLE LINKS

DIRECTROY PATH : ..

files having multiple in .. are

DATA
DESKTOP
MAIL
SCRIPT               


DISPLAY FILES HAVEING MULTIPLE LINKS

DIRECTROY PATH : ../DESKTOP

files having multiple in ../DESKTOP are

AUTOSTART
  
Share: 



Joshua Evans
Joshua Evans author of Shell script to display the name of those files (in the given directory) which are having multiple links is from London, United Kingdom.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!