Sanjoy Roy

[MCM, MCP, SCJP] – Senior PHP Programmer

Tag Archives: Linux

Copy recursively directory structure using Linux Command

How to copy a directory/folder structures in a single command
Create a new directory
Cd new_directory
Run the following command
Where “../catalog” is the source location
***Remember to backup before running this script.


find ../catalog -type d -printf “%P\n” | xargs mkdir -p

find ../admin -type d -printf “%P\n” | xargs mkdir -p

Some Linux useful IP commands

Display Current Config for all NIC’s: ifconfig

Display Current Config for eth0: ifconfig eth0

Assign IP: ifconfig eth0

Ping: ping -c 3

Assign multiple IP’s: ifconfig eth0:0

Assign second IP: ifconfig eth0:1

Disable network card: ifconfig eth0 down

Enable network card: ifconfig eth0 up

View current routing table: route “or” route -n

View arp cache: arp “or” arp -n

Assign IP/Subnet: ifconfig eth0 netmask

Assign Default Gateway: route add default gw

Trace Route: traceroute

Trace Path: tracepath

DNS Test: host

Advanced DNS Test: dig

Reverse Lookup: host

Advanced Reverse Lookup: dig -x

*You MUST be at the ROOT user to make/save any changes. Linux users, your distribution will determine the location of your network config file which will need to be updated and saved in order for the changes to remain in effect after rebooting. Network cards are referred to as eth0, eth1, eth2, etc based on their position on the PCI bus.
*Special thanks to Gergely for the Linux commands!


Linux – Kill all processes for a user

How to restart cPanel service from command line – Linux Server?

In order to restart cPanel service from command line one need to execute below mentioned command:
[root@root ~]# /etc/rc.d/init.d/cpanel restart

To Recover Your Parallels Plesk Panel Password on a Linux Server

Using SSH, log in to your server with the User ID and Password that you created when you set up your dedicated hosting account.
At the command line, type su -.
For your password, use the same password that you use with your User ID.
Type cat /etc/psa/.psa.shadow
This file contains your admin Parallels Plesk Panel password.

%d bloggers like this: