Display a list of ports in use:
sudo lsof -nP -iTCP -sTCP:LISTEN
Check a specific port number with this syntax:
sudo lsof -nP -i:[port-number]
For example, to check if port 5054 is in use, type:
sudo lsof -nP -i:5054
Check Ports via netstat Command
sudo netstat -tunpl
-t - Queries the command for TCP ports.
-u - Queries for UDP ports.
-n - Avoids DNS lookup and shows only IP addresses to speed up the process.
-p - Displays the process ID and the name of the program using the port.
-l - Outputs listening ports.
Give Permission
root@ip-192-168-4-59:/var/www# chmod -R 777 www
root@ip-192-168-4-59:/var/www# chown -R 777 www
For example, to copy a folder named source_folder to a destination directory named destination_folder, you can use the following command:
cp -r source_folder /path/to/destination_folder/
cp -r source_folder /path/to/destination_folder/
cp -r ./var/www/pharmacy_/v18/pharmacy /var/www
Verify the Copied Folder
ls /path/to/destination_folder/
Top comments (0)