#!/bin/bash
# Script for finding a file and copy to a Specific directory
read -p "write the name of file: " a
file=`find / -name $a`
if [ $? -eq 0 ]
then
{
echo "*********************"
echo "* $a File found which u r looking for *"
echo "*********************"
read -p " where do u want to copy it: " b
cp $file $b
}
else
echo "file not found"
fi
###########################################
IF we find More than one files then we can use this script
###########################################
#!/bin/bash
read -p "write down the file name : " file
find / -name $file>/shell/find
grep $file /shell/find
if [ $? -eq 0 ]
then
{
valfile=`cat /shell/find`
line=`sed -n 2p /shell/find`
if [ ! -z "$line" ]
then
{
echo ""
read -p "Hey !!! select to copy from above" c
echo ""
read -p "Place where to copy :" d
cp $c $d
echo ""
echo "File Copied to $d"
echo ""
}
else
{
echo ""
read -p "Place where to copy :" f
cp $valfile $f
echo ""
echo "File Copied to $f"
echo ""
}
fi
}
else
echo ""
echo "File not exixt"
echo ""
fi
# Script for finding a file and copy to a Specific directory
read -p "write the name of file: " a
file=`find / -name $a`
if [ $? -eq 0 ]
then
{
echo "*********************"
echo "* $a File found which u r looking for *"
echo "*********************"
read -p " where do u want to copy it: " b
cp $file $b
}
else
echo "file not found"
fi
###########################################
IF we find More than one files then we can use this script
###########################################
#!/bin/bash
read -p "write down the file name : " file
find / -name $file>/shell/find
grep $file /shell/find
if [ $? -eq 0 ]
then
{
valfile=`cat /shell/find`
line=`sed -n 2p /shell/find`
if [ ! -z "$line" ]
then
{
echo ""
read -p "Hey !!! select to copy from above" c
echo ""
read -p "Place where to copy :" d
cp $c $d
echo ""
echo "File Copied to $d"
echo ""
}
else
{
echo ""
read -p "Place where to copy :" f
cp $valfile $f
echo ""
echo "File Copied to $f"
echo ""
}
fi
}
else
echo ""
echo "File not exixt"
echo ""
fi
Balo laglo. Well done
ReplyDeleteBalo laglo. Well done
ReplyDeletewell done .carry on..Bro
ReplyDeleteWhat do the following commands do in Linux?
ReplyDelete1)$ rm data 1 2)$ cat chap *.* 3)$ ls *.? 4)$ cat