Tuesday, January 17, 2017

SSH, SCP and SFTP Syntax


  
1)       SSH Syntax





2)       SCP syntax







3)      
SFTP Syntax






sftp> get /path-file-name-from-target-computer


sftp> put /path-file-name-from-our-computer
sftp> bye

Schedule Tasks in Linux




Using at:

# at now +5 days 
= > will schedule a task after 5 days from now
at> reboot  => enter ctl+d to come out of at utility



#atq  => will query active jobs
#atrm <<job_id>>     => will remove the job







Using Cron:













Delete the Logical volume, physical volumes and remove Physical Disk



Step 1) Choose the physical volume to delete. Also determine in which volume group it is added.


Step 2)  Unmounts the file system


Step 3)  remove the logical volume.


Step 4) remove physical volume from volume group


Step 5) Remove physical volume




Step 6) remove partition


delete




Nice level of process




Nice:


It is the method of prioritizing a process in terms of CPU and Memory.

Nice level ranges from -20 to 19. Where -20 is the highest priority and 19 is the least priority.

List the nice level of process

# ps axo pid, comm, nice   =>  Will return the process id, command, nice level


Set nice level to a process

# nice –n -10
<<Process_name>>




set the nice level of a particular running process

# renice –n 12 <<PID>>



set the nice level of all running process

 # renice –n 13 ${pgrep <<process_name>>}


Note: Only privileged user can set the nice level

MBR and GPT partition


Master Boot Record (MBR):

This is the most command and old partition mechanism. The limit is for primary partition can have only 2048 GB of maximum size. This is a 32 bit based and can have only four primary partitions.




Global Partition Table (GPT):

This is a new partition method and 64 bit based partition. This can have 128 primary partitions.

Managing services



 Find the status of a service.




Start the service




 Stop the service



 List all services


 List all dependencies of a service


 

Disable and enable service


Find if a specific service is a dependency for a particular target










Logical Volume Manager (LVM)


 
New we are going to see how to create the new partitions in Linux using LVM.


Below are the steps to configure the new hard disk on Linux:

Step 1) Take a physical disk (PD)

Step 2) Physical Partition (PP) the PD using fdisk for MBR partitioning or gdisk for GPT partitioning.




Step 3) Create physical volume (PV)



validate

Step 4) Create a volume group (VG)

Step 6) Create a logical volume (LV)



Step 7) Create a file system type.


Step 8) Create a mount point. This is a directory where the above formatted logical volume is supposed to point



Step 9) mount the logical volume to the mount point.



 Step 10) to make the file system persistent. Add the entry to fstab.