Sunday, November 21, 2021

ITIL : ITIL Certification Question and Answers Part-I

 

1) What does the ‘C’ in ‘RACI’ refer to?

A. Communicate
B. Configure
C. Customer
D. Consult


2) Which is NOT a sub-process of capacity management?

A. People capacity management
B. Component capacity management
C. Business capacity management
D. Service capacity management

3) Which BEST describes the purpose of the CSI register?
A. To capture, record and prioritize all improvement opportunities
B. To store details of all component CIs and their interfaces
C. To be a central repository for all IT service management related information
D. To record details of all live services and their service targets

4) What is part of a configuration management system (CMS)?
1- Configuration records
2- Configuration management databases

3- Physical assets
4- Release plans

5) Which are objectives of problem management?
1- Eliminate recurring incidents
2- Minimize the impact of incidents that cannot be prevented

3- Increase visibility and communication of incidents
4- Provide a trigger for the raising of incidents

6)Which statement BEST describes the value of the service transition stage to the business?
A. It supports the creation of a catalogue of services?
B. It leads to gradual and continual improvement in service quality
C. It ensures the production of more successful service designs
D. It results in higher volumes of successful change


7)Which statement about Service Asset and Configuration Management (SACM) is FALSE?
A. The scope of SACM includes management of the complete lifecycle of every configuration item (CI)
B. Configuration baselines and versions are produced by SACM
C. SACM maintains an accurate and complete configuration management system (CMS)
D. All changes to Cis are authorized by SACM

8) Which list includes information that would be collected when any incident is first logged?
A. Unique reference number, escalation activity, incident priority
B. Unique reference number, incident priority, description of symptoms
C. Escalation activity, closure category, resolution date and time
D. Closure category, description of symptoms, resolution date and time

9) Which statement BEST describes a service request?
A. A request from a customer for a new service
B. A generic description for the many types of request for change (RFC) that are received by the IT organization
C. A high priority RFC from a senior manager
D. A generic description for the many different types of demands that are placed upon the IT organization by the users

10) Which is a supplier category?
A. Technical
B. Commodity
C. Customer
D. Resource

11) Which is an example of how service automation assists service automation assists service management?
A. Customers can employ more sales staff during peak business periods
B. The capacity of services can be adjusted to respond to respond to variations in demand
C. Requests for new services can be authorized by anyone in service management
D. The capacity of the service desk can be reduced to prevent users contacting it at busy times

12) What do customers NOT have ownership of when receiving value from services?
A. Specific costs and outcomes
B. Specific costs and risks
C. Specific risks and impacts
D. Specific outcomes and impacts

13) What must a service level agreement (SLA) define?
A. Legally binding contractual responsibilities or both parties
B. Legally binding contractual responsibilities of just the IT service provider
C. Key service targets and responsibilities of both the IT service provider and customer
D. Key service targets and responsibilities of just the IT service provider


14) Which BEST describes a situation in which the emergency change advisory board (ECAB) is used?
A. Following a full change advisory board (CAB) to resolve any outstanding agenda items
B. During peak or holiday periods when emergencies are more likely to occur
C. In an emergency situation when it is not possible to convene a full CAB
D. Outside the normal working hours of the business unit


15) Which one of the following is NOT a responsibility of the service transition stage of the service lifecycle?
A. To ensure that a service can be managed and operated in accordance with constraints specified during design
B. To design and develop capabilities for service management
C. To provide good-quality knowledge and information about services
D. To plan the resources required to manage a release

16) Which one of the following is concerned with policy and direction?
A. Capacity management
B. Governance
C. Service design
D. Service level management

17) Which tool helps with defining accountability and responsibility within processes?
A. A CSI register
B. A project charter
C. A RACI model
D. A communications plan

18) What are the three service provider business models?

A. Internal service provider, outsourced 3rd party and off-shore party
B. Internal service operations provider, external service operations provider, shared service unit
C. Internal service provider, external service provider, outsourced 3rd party
D. Internal service provider, external service provider, shared service unit

19) Which of the following are types of service defined in ITIL?

1.Core
2.Enabling

3.Special

20)Which of the following is NOT an objective of Continual Service Improvement?

A. Review and analyze Service Level Achievement results
B. Identify activities to improve the efficiency of service management processes
C. Improve the cost effectiveness of IT services without sacrificing customer satisfaction
D. Conduct activities to deliver and manage services at agreed levels to business users

21) Which of the following BEST describes service strategies value to the business?
A. Allows higher volumes of successful change
B. Reduction in unplanned costs through optimized handling of service outages
C. Reduction in the duration and frequency of service outages
D. Enabling the service provider to have a clear understanding of what levels of service will make their customers successful

22)Which process or function is responsible for the Definitive Media Library and Definitive Spares?

A. Facilities Management
B. Access Management
C. Request Fulfillment
D. Service Asset and Configuration Management


23) Which problem management activity ensures that a problem can be easily tracked and management information can be obtained?
A. Categorization
B. Detection
C. Prioritization
D. Escalation


24) Which one of the following would be the MOST useful in helping to define roles and responsibilities in an organizational structure?

A. RACI model
B. Incident model
C. Continual service improvement (CSI) approach
D. The Deming Cycle


25) Which process is responsible for controlling, recording and reporting on the relationships between components of the IT infrastructure?
A. Service level management
B. Change management
C. Incident management
D. Service asset and configuration management


26) Service transition contains detailed descriptions of which processes?
A. Change management, service asset and configuration management, release and deployment management
B. Change management, capacity management event management, service request management
C. Service level management, service portfolio management, service asset and configuration management
D. Service asset and configuration management, release and deployment management, request fulfillment


27) What is the result of carrying out an activity, following a process or delivering an IT service known as?
A. Outcome
B. Incident
C. Change
D. Problem


28) Which one of the following do major incidents require?
A. Separate procedures
B. Less urgency
C. Longer timescales
D. Less documentation


29) What are Request Models used for?
A. Capacity Management
B. Modeling arrival rates and performance characteristics of service requests
C. Comparing the advantages and disadvantages of different Service Desk approaches such as local or remote
D. Identifying frequently received user requests and defining how they should be handled


30) Which of the following are basic concepts used in access management?
A. Personnel, electronic, network, emergency, identity
B. Rights, access, identity, directory services, service/service components
C. Physical, personnel, network, emergency, service
D. Normal, temporary, emergency, personal, group


31) Which of the following is the BEST reason for categorizing incidents?
A. To establish trends for use in problem management and other IT service management (ITSM) activities
B. To ensure service levels are met and breaches of agreements are avoided
C. To enable the incident management database to be partitioned for greater efficiency
D. To identify whether the user is entitled to log an incident for this particular service


32) Which of the following is the BEST reason for categorizing incidents?
A. To establish trends for use in problem management and other IT service management (ITSM) activities
B. To ensure service levels are met and breaches of agreements are avoided
C. To enable the incident management database to be partitioned for greater efficiency
D. To identify whether the user is entitled to log an incident for this particular service






Saturday, July 17, 2021

Informatica Repository commands for daily administrative tasks

Informatica Repository commands is very useful in day to day activities. These commands are useful to perform adminitrative tasks

1. To Create Database Connection or Repository folder, Assign permission we can use the pmrep commnd

to create connection we need to connect the repository and then create connection.

a.  pmrep connect -r "Repository name" -d "domain name" -n Username -X Password

-r :  Informatica Power Center Repository Name
-d : Informatica Domain Name
-n : User Name
-X : Encrypt Password

To Create encrypted password we can use the pmpasswd 
  
 pmpasswd abc
Encrypted String --> xadffjjkjkvd=<---
will decrypt to -> abc<---

Once we connect to Repository we perform any tasks in Repositoy like Folder Creation, Connection Creation etc.

b.  pmrep  CreateConnection -s "type"  -n "name" -u "Username"  -p "Password" -c "Connection String"  -l MS1252

-s :  Connection type for example odbc,Teradata etc
-n : Connection  Name, This will be used in workflows
-u : Connection User Name
-p : Connection Password
-c: Connection String which is same as odbc or tns entry

To Delete Connection we can use deleteconnection in pmrep

c.  pmrep  deleteconnection -s "type"  -n "name" 

-s :  Connection type for example Relational ,Application, HTTP,MQ
-n : Connection  Name, This will be used in workflows

d.  pmrep AssignPermission -o "Object Type" -n "Connection name" -g "Group name"  -p "rwx"

-o :  Object Type for example Connection, folder etc
-n : Connection  Name
-g : Informatica Permission Group so that whoever part of this group will get the permission. We can use -u for the individual users.
-p : Connection Permission who can read,write and execute.

e.  pmrep ChangeOwner -o "Object Type" -n "Connection name" -u "Owner name" 

-o :  Object Type for example Connection, folder etc
-n : Connection  Name
-u : New Object Owner for this folder or Connection object

to create folder we need to connect the repository and then create connection. Once we connect Repository we can use CreateFolder command to create a folder and permission adding will be same as connection.

f.  pmrep  createfolder   -n "name" -d "Description"  -o "Owner"

-n :  Folder Name
-n : Connection  Name
-o : Owner Name 


To Delete Connection we can use deleteconnection in pmrep

g.  pmrep  deletefolder -n "name" 

-n : Folder name to delete in a Repository


2. To  Validate the Informatica Components like Workflow, Session, Mapping etc we can use the pmrep commands

we need to connect the repository and then validate objects

a.  pmrep connect -r "Repository name" -d "domain name" -n Username -X Password

Once connected use validate command

b.  pmrep Validate -n "Object name" -o "Object Type"  -f  "foldername" -s -k -m "Comments"

-n :  Object Name which can be mapping name or session name or workflow etc
-o : Object type which can be mapping or sesssion or workflow or mapplet
-m :  Comments for validating so that it will be have the details

3. To  update Sequnce generator in mapping we can use the pmrep commands

we need to connect the repository and then update sequnce generator.

a. pmrep connect -r "Repository name" -d "domain name" -n Username -X Password

Once connected use update sequence generator command

b. pmrep Updateseqgenvals -f "Foldername" -t "SQ name" -c "cur val"


-f :  Folder Name of the sequence generator
-t :  Sequence Generator name
-c :  The value that currently needs to set to replace previous value.

4. To  Export objects like mapping,session, workflows pmrep command can be used

we need to connect the repository and then export object from Repository

a. pmrep connect -r "Repository name" -d "domain name" -n Username -X Password

Once connected use objectexport command

b. pmrep objectexport -n "name"  -o "type" -m -s -b -r -u "objectname.xml"

-n :  Workflow or session name that needs to be exported
-o :  Object type can be workflow or session
-u :  Exported objectname to save in local folder.

Folders list also can be exported used pmrep using below command. This will help to compare and verify whether folder is already available in target repository

c. pmrep listobjects -o "folder"

5. To  Deploy the workflow or folder we can use pmrep

a. pmrep connect -r "Repository name" -d "domain name" -n Username -X Password

Once connected use deployfolder command

pmrep deployfolder -f "folder name" -c "control file" -r " Repository name" -n "username" -s "native" -X "password"

To deploy deployment group we can use deploymentgroup command

pmrep deploydeploymentgroup -p "deployment group name" -c "control file dtd" -r "remote repository name" -h "hostname"  -o "port number" -n " remote username" -x " remote password"

To remove deployment group we can use deletedeploymentgroup command

pmrep deletedeploymentgroup -p "groupname" -f

6. To  start the workflow we can use pmcmd command

To start workflow first we need to connect to repository and start the workflow.

a. pmrep connect -r "Repository name" -d "domain name" -n Username -x Password

b.pmcmd startworkflow -sv "Integration Service" -d "domain"  -u "username" -pv "password" -f "foldername" "workflow name"

To get the workflow status we can use the below command

c.pmcmd getworkflowdetails -service "Integration Service" -d "domain"  -u "username" -pv "password" -f "foldername" "workflow name"


7. To  Create User or assign permission to User we can use the infacmd command

we can use infacmd command to create user in informatica power center repository. infamd command is available in $INFAHOME/server/bin path.

a. infacmd.sh createuser -dn "domain name"  -un "admin user"  -pd "admin password" -ny "new user name" -np "new user passwd" -nf "new user folder"

once user created using infacmd command, permissions need to be provided to the user. It can be user permission or group permission

b. infacmd.sh addUserToGroup -dn "domain name"  -un "admin user"  -pd "admin password" -eu "user who needs permission" -gn "group that user required"

Similarly user can removed using removeuser

b. infacmd.sh removeuser -dn "domain name"  -un "admin user"  -pd "admin password" -eu "user who needs removed" 

To update the domainoptions we can use infacmd

c. infacmd.sh updatedomainoptions -dn "domain name" -un "Admin user" -pd "password" -do TLSMode=True

To switch the Gatewaynodes we can use infacmd

d. infacmd.sh isp SwitchtoGatewaynode -dn "domain" -un "admin user" -pd "admin passwd" -hp "host1:port"  "host2:port"  "host3:port" -Nodename "node01" -ld "node directory path"

To Covertlogfile to normal file to read session logs we can use infacmd

e. infacmd.sh Convertlogfile -in /var/opt/infa/cache/wofklow.log.bin -fm text -lo workflw.txt

8. To  start informatica services we need to user infaservice.sh command located in $INFAHOME/server/tomcat/bin

To start Informatica services, we can run the below command

infaservice.sh shutdown

To stop Informatica services, we can run the below command

infaservice.sh startup

9. To update informatica setup files like nodemetadata.xml or any domain console port etc we need to run infasetup command and restart the service. this setup files script is available in $INFAHOME/isp/bin

To setup domain after certificate update  with keystore and trust store we can use the below command

infasetup.sh updategatewaynode -dn "domain name" -hs "ssl port" -kf "old keystore file" -kp "old keystore password" -nk "new kestore" -nkp "new keystore password" -nt "new trust store" -nkp "new trust store password" 


To setup SSL port we can run the below command

infasetup.sh updategatewaynode -hs "port number"









Friday, July 16, 2021

UNIX File Zipping and unzipping Commands

There are various file compression and un compression commands in UNIX.


1) Unzip the gz file we wil use the gunzip command

 
if we need to see the contents of the file without unzipping the file we can use -c option. This will enable to view file without unzipping

gunzip -c filename.gz

need  The below command use to uunzip the file completly

gunzip filename.gz




2) to Zip the txt,csv,dat etc file into gz format we wil use the gzip command

gzip  file.txt 

The above command will convert the file.txt to file.txt.gz format.


Also we can zip the file 


3) To compress the folder and its contents we use the tar command


tar -cvf filename.tar /opt/sw/SrcFiles/backup


The above command compress the folder and its contents that include its subfolders into a single tar file.

tar -xvf filename.tar

The above command un-compress the folder and its contents that include its subfolders into a single tar file.


4) We can use the unzip command to unzip the .zip file for that we need to install the 7zip software in unix.

unzip file.zip









Friday, June 25, 2021

Unix Server health check commands

 

1) To check the top process used in Unix server 

topas 

Above command will provide details CPU Usage , order top processed based on their CPU usage in descending order.

2) To check the unix OS version used in Unix server 

oslevel -s

3) To check the unix ssl version 

lslpp -l | grep -i opessh

4) Memory related commands

vmstat

provides the system configuration. No of logical cpus, current ram allocated, entitle ment of CPU etc.


svmon -G

Provides the details of usage of memory usage and free space in server memory.


lparstat -i |egrep 'Memory|CPU'

Provides the details of no of virtual CPU , Max CPU,Min CPU, Max and Min memory , Active Cpus etc.

4) To check process in the unix

ps -ef | grep processname

to check the idle process

ps -aux


to check the Zombie process below command can be ued


ps -el | grep 'Z'


to kill the process

kill -9 <processid>


to get user user process

ps -u <userid>

ps -eo, etime, user,pid,args | grep processid

5) To check the logical partition we can use the command

laparstat

6) To check the host name we can use the hostname command

and once we get hostname we can idetify ip address using the below command

nslookup servername



There are various command that can be used to check the file size in UNIX.

7) Finding the Largest directory in a particular mount point

du -sk . [!.] *  * | sort -n

8) to check the size of partiular mount pount

df -g | grep mountpoint

mount point is the storage path like /opt/sw/Unix/dev

9) To check space for all mount points

df -g 

g - stands for size in giga bytes.


10) To performance we can nmon

nmon -fT -I 3 -s 300 -c 12 -m 


11) To check free memory we can use the below command

free -m 

This will display system memory and swap memory in MBs

Wednesday, June 16, 2021

UNIX File Operations and User permission Commands

 
1) Vi editor

ESC + ! + wq   -- This for saving the file
ESC + ! + q  --This will abort current changes
CNTRL +Z  also works for aborting the changes but it is not proper way to abort.
shift + G  -- Will come to the end of the file
dd -- typing two times in vi editor will delete the enitre line.
d -- only one time d will delete the one letter
i or insert button will be used for insert option. By default vi editory will be in edit mode. 
vi -R file.txt -- Opens the file.txt in read only mode


2) Change file group of a folder 

chgrp usergroup foldername
chgrp  -- Command name
usergroup -- user group that will be changed to
foldername -- folder details that need to be changed

To Change the owner of the folder or file we can use chown command

chown newowner:newgroup foldername

To Change the owner of the folder and all its conents inside the subfolder we can use the below command

chown -fR newowner:newgroup Path


3) to check the permission of a user

id userid
id -- Command
userid- any user login that need to check for their permission


4) to check the default group of user

id -Gn userid
id -- Command
Gn -- Group name
userid- any user login that need to check for their permissions

5) to check the current user groups

groups  -- command will be used to check current user groups

6) to check the full user details from passwd file.

cat /etc/passwd | cut -d: -f5
The above command gives all user details in Unix server.

6) to check the user full information finger command can be used

finger -- Command
finger username  -- This gives infromation about current user login name and home path and from which servers its connected.

7) to change the permission of file

chmod 775 filename
There are three 3 modes of permissions 

8) find command will be used to find the file in a folder or directory

find /var -xdev -type f -size +300000c -exec ls -al {} \; | sort -k5nr | head -50
The above command fetches the files from the mount point /var with files greater that 300000kb that included hidden files and then sort the files to retreive the 50 large files. 
-type :  There can be f (file) or d (directory)
ls :  for listing files 
sort :  for sorting the order
head:  for limiting the record after sorting
find command will be used to find the file in a folder or directory
find /var  -type f -name bkp* -exec ls -al {} \; | sort -k5nre | head -50
The above command fetches first 50 the files that starts with bkp name
Similary find can used with most of the file operation commands 
find /var -type f -name bkp* -exec chmod 775 {} \;
The above command changes permission of the all the files starts with bkp to rwxrwxr-x (775) .
find /var -type f -name bkp* -exec chmod 770 {} \;
The above command changes permission of the all the directories starts with bkp to rwxrwx--- (770) .
If the current user who executing the above command does not have permission then it will not change and will get permission denied error.

9) Removing the files 

For Removing the files we can use rm command
rm file.txt
Above command will remove the file.txt. For removing directory we can 
use rmdir command
rmdir testdir
Above command will will remove directory testdir. This will work only when directory is empty.
if we need to remove recursivly with subfolders and files we can use
rm -fR testdir
Above command will will remove directory testdir. This will remove the full directory. if there is any files inside directoy in which user does not have permission then it will skip that files and direcotry will not be removed.
find /var -type f -name bkp* -exec rm -fR {} \;
Above command will remove the files that starts with bkp in all directories. 
find /var -type f -name *.txt  -mtime +30  -exec rm -fR {} \;
Above command will remove the files that has txt extension which is older than 30 days from all the directories. 


10) Replace the keyword in a file  or replace the line


sed : sed command will be used for replacing the text
sed -e 's/orginal keyword/replacing keyword/g' inputfile.txt



example
-------- 
sed -e 's/abc/cda/g' inputfile.txt > newfile.txt
above command replace the text abc in the file inputfile.txt with cda and put into newfile.txt file.


to replace old line with new line and copy the updated file to new file.

sed -e 's:opt/sw/abc.txt:opt/sa/tcb.txt:g' inputfile.txt > newfile.txt


11) moving the file from one place instead of copying


For moving the file we use the mv command. When you use mv command the actual file will be moved. The permissions and file creation timestamp will not be changed it will be as original file. 
mv  filename1.txt filename2.txt
In the above command it will rename filename1.txt to filename2.txt
mv /opt/sw/ss/filename1.txt /opt/sw/filename1.txt
The above command will move file from /opt/sw/ss/ drirectory to /opt/sw/ directory.

To move the entire directory we can use mvdir command

mvdir /opt/sw/ss/dir1 /opt/sw/dir1

12) To create empty files we can use touch command and similary we can use mkdir to create new directory

touch filename.txt

This will create an empty file using with name filename.txt. 

To create file with certain time stamp we can use the below command

touch -a -m -t 202410101530.06 filename.txt

To Copy the content to new files we can use the redirect arrow.

cat filename.txt  >> filename1.txt

This will copy file the context of filename.txt to filename1.txt

mkdir folder1

This will create a directory with folder1

13) To extract value from a column delimited file

awk -F "," '{print $1}' Filename.txt | sort -d | head 10

The above command will fetch first 10 records of first column from the file name.txt with descending order.

cat Filename.txt  | awk -F "|" '{print $10}' | sort -d | uniq

The above command will fecth unique records of 10th column in a delimited text having pipe as delimiter .

awk -F "~" '{sum+=$6} END { printf "sum of 5th field" }' Filename.txt 

The above command will give the sum of 6th column

with filename.txt


14. To list the files with specific text in a folder 


grep -Ril "search keyword"   "filepath"

with two arguments like search keyword and filepath we can find the keyword that is used in all files.

15. For listing the files in Unix, we can use the command

ls  -  ls will allow you to list the files and folder in a particualr permissions

For see the files full details like last modfied date , file owner , file groups -lrt can be used

ls -lrt or ls -ltr can used used tol files with file owner ,file group and last modified stamp

For listing the hidden files in Unix the below command -a can used be along with -lrt

ls -lart  - This will all files inlcude hidden files in a directory

To see what are the folders that has extened permissions aprart from file owner and file groups below command can be used.

ls -le  - This will display the directory that has extened permission.

ls -le | grep +

After identifying the extened permission, For updating the group or add extra group

acledit an be used.


acledit directory


head :  used to for get top rows in a file

usage :  head -10 file.txt

The above command will fetch first 10 rows from a file file.txt

tail :  used to for get last rows in a file

usage :  tail -10 file.txt

The above command will fetch last 10 rows from a file file.txt


To check the number of lines wc command will be used

wc -l filename.txt  (filename.txt is the filename we need to check the number of lines)

To change the directory we use the cd command

cd /opt/sw/

/opt/sw/ is the directory

To copy the files we use the cp command

cp file1 file2

This will copy file1 to file2 using the same directory
we can specify full path if we need to copy to different directory.

pwd : This will display the present directory

more :  display data in read only format with each page. to move to next page we need enter.
ln : Create a soft link on oldname
file :  display the file type.
	
cut : will display certain charater from the file or text
echo "This is test" | cut -c 1-3,6-8
This will display This 
locate : will list all files with specific search
locate test
This will display all files that contains name test in all sub folders.

Sending mail using Unix and Linux commands

Unix Commands for Sending email
-------------------------------------------------

sending file as attachment

1) uuencode filename.txt | mailx -s "filename details"  -c abc@test.com -r noreply@test.com sender@test.com

sending file as attachment

2) mail -s "Test mail" abc@test.com < TestFile.txt


3)  (echo "Hi All, \n Please find the attached details in the email \n Thanks \n Application Team"; uuencode File.txt attahedFile.txt) | mailx -s "File details" -c abc@test.com -r noreply@test.com sender@test.com

Linux Commands for Sending email
--------------------------------------------------

1. Below command will send mail sending hello text mail in body

echo "Hello" | mailx -s "Test Email " -r abc@test.com to@test.com

-r means sender who is sending the mail

2. Below command will send text file in the body

mailx -s "Test mail subject" -r abc@test.com to@test.com < sample.txt

3. Below command will also send mail similar to above

cat sample.txt | mailx -s "Test mail subject" -c cc@test.com -r from@test.com to@test.com 

-c means cc to list.

4. Below command will send attachment in email. We use -a for attachment

echo "Hello, Please find the attached Report" | mailx -s "Report Details" -a report.html -r from@test.com to@test.com

5. Below command will variable as attachment

echo "$variable"  | mail -s "Testing" -r from@test.com to@test.com

6. Below command will sent mail with attachment with body text include new lines.

echo -e "Hi Team, \n Please find the attached Report" | mailx -s "Test Report Subject"  -a "attachmentpath+filename" -r noreply@test.com to@test.com


UNIX Shell Commands : File transfer using various commands

 

1) SFTP Commands in Unix

The basic command used for connecting remote server using sftp in Unix

sftp username@servername

username:  Username for the remote server. This user should be created in remote server should have Public/private key present in the remote server.

servername :  server is the remote servername we need to connect.

After connecting to the sftp server, basically we will perfrom two operations 

a) Pulling the file from remote server.  For this we will use the get command

 get :  get will fecth the file from remote directory and place it to the current directory into the local server.

get will have two parameters . First parameter is mandatory which remote filepath and second parameter local directory path. if we do not provide the second variable it will copy int present directory

i ) get /opt/sw/unix/Remote/Test.txt  

ii) get /opt/sw/unix/Remote/Test.txt  /opt/sw/unix/local/Test.txt

The above commands will copy only the file. What if you need to copy the entire directory from remote server to local server using sftp command, We have abiltiy to copy enitre directory using -r option.

i ) get -r /opt/sw/unix/Remote

ii) get  -r /opt/sw/unix/Remote  /opt/sw/unix/local


 put :  put will place the file in remote directory from the current directory into the local server.

put will have two parameters . First parameter is mandatory which filepath and second parameter remote directory path. if we do not provide the second variable it will copy into present directory in remote server

i ) put /opt/sw/unix/Remote/Test.txt  

ii) put /opt/sw/unix/Remote/Test.txt  /opt/sw/unix/local.Test.txt

The above commands will place only the file. What if you need to place the entire directory from local server to remote server using sftp command, We have abiltiy to place enitre directory using -option.

i ) put -r /opt/sw/unix/local

ii) put -r /opt/sw/unix/local/  /opt/sw/unix/remote/

Above will copy the local directory

2) Copy Commands in Unix

The basic command used for Copying file from one server to other server. It accepts two parameters.

First parameter is madatory which source file. Second parmeter is target path.

cp /opt/sw/sw/SourcePath/Testfile.txt  .

Here . represents local path which is current direcotry. Above command will copy file to current directory. 


cp /opt/sw/sw/SourcePath/Testfile.txt /opt/sw/sw/TargetPath/Test.txt

This comand will copy file from /opt/sw/sw/SourcePath/ to  /opt/sw/sw/TargetPath/ Path

We can copy the entire directory using -R option. This will copy all directory files and folders inside the current directory


cp  -R /opt/sw/sw/SourcePath/   /opt/sw/sw/TargetPath

The above command will copy the SourcePath directory to TargetPath directory



3) Move Commands in Unix


The basic command used for moving file from one server to other server. It accepts two parameters.

First parameter is madatory which source file. Second parmeter is target path.

mv /opt/sw/sw/SourcePath/Testfile.txt  .

Here . represents local path which is current direcotry. Above command will move file to current directory. 


mv /opt/sw/sw/SourcePath/Testfile.txt /opt/sw/sw/TargetPath/Test.txt

This comand will move file from /opt/sw/sw/SourcePath/ to  /opt/sw/sw/TargetPath/ Path

We can move the entire directory using -R option. This will move all directory files and folders inside the current directory


mv -R /opt/sw/sw/SourcePath/   /opt/sw/sw/TargetPath

The above command will move the SourcePath directory to TargetPath directory

4) File Copy using scp in Unix

 The scp command can be used to copy securly in Unix. This is same as Copy command but copies the files securly to remote server. This will be used purely for copying the files.

scp -rp /opt/sw/sw/SourcePath/file.txt  username@remoteserver:/opt/sw/sw/TargetPath

The above command copy file from current seever to remote user and retain same permission as source server. (-rp for replicating same permission of source server)

to copy the files into current server from remote server we can use the below command

scp -rp  username@remoteserver:/opt/sw/sw/SourcePath/file.txt     /opt/sw/sw/TargetPath/  


to copy the files into with time stamp we can use the command

scp -p  "Source File full path"  "remoteuser@remoteserver":"Remote file path"_${date +Y%m%d)