I use Linux, so here are some of my favorites and most used:
Look at error log files:
tail /var/log/httpd/error_log
Change Root Password:
passwd
Clear Log Files:
sudo cat /dev/null /var/log/httpd/error_log
Find a directory in server:
cd "add the full directory path"
Import A MySQL Database
The file must be in .sql format. It can not be compressed in a .zip or .tar.gz file.
1: Start by uploading the .sql file onto the server
2: If you haven't already done so, create the MySQL database.
3: Navigate to the directory where your .sql file is. Use the following command line:
cd "add the full directory path"
4: Next run this command:
mysql -p -u username database_name < file.sql
To import a single table into an existing database you would use the following command:
mysql -u username -p -D database_name < tableName.sql
To clear log files:
cd /var/www/vhosts/domain.com/logs/
Then Type:
>error_log
For WINDOWS PC (Local Computer)
Create a txt files for list of files within a particular folder.
1. Click Start.
2. Type cmd and press Enter.
3: Navigate to the directory containing the content you'd like a list to print.
4:Once in the directory you want to print the contents of, type one of the below commands:
dir > print.txt
The above command takes a list of all the files and all of the information about the files, including size, modified date, etc., and sends that output to the print.txt file in the current directory.
dir /b > print.txt
The above command would print only the file names and not the file information of the files in the current directory.
dir /s /b > print.txt
The above command would print only the file names of the files in the current directory and any other files in the sub-directories within the current directory.
Create Structured Folders Within Server
mkdir -p abcd/efgh/ijkl/mnop/qrst/uvwx/yz/
mkdir -p /abcd/efgh/ijkl/mnop/qrst/uvwx/yz/
mkdir is "make directory"
The -p option creates the parent directories if they do not already exist.
ZIP Folders:
zip -r filename.zip foldername/
FIREWALL LOCATION:
CSF conf --> /etc/csf/csf.conf
FIREWALL COMMANDS
To enable a port in csf
1. vim /etc/csf/csf.conf
2. go to TCP_IN and add the ports
3. csf -r
To whitelist an IP address in firewall
1. csf -a IP
2. csf -r
To block and IP address in firewall
1. csf -d IP
2. csf -r
To remove the IP block in firewall
1. csf -dr IP
2. csf -r
Start CSF --> csf -e
Stop CSF --> csf -x
Restart CSF --> csf -r
csf -a IP
Block multiple IP address by adding to form:
/etc/csf/csf.deny
Find Server Updates Command:
yum update
Move
mv path path
Remove:
rm path
Remove Directory:
rmdir path
Remove Directory and Files:
rm -R path
Changing Password:
Simply enter -
passwd
From there enter the new password.
To Check within Server Blacklist and White Lists
WHITELIST
/etc/csf/csf.allow
BLACKLIST
/etc/csf/csf.deny
I hope this helps.