File and Directory Management
chmod: Change file or directory permissions. ```sh chmod 755 myfile
2. **`mkdir`**: Create a new directory.
```sh
mkdir mydirectory
rm: Remove files or directories. ```sh rm myfile
4. **`cp`**: Copy files or directories.
```sh
cp source destination
mv: Move or rename files or directories. ```sh mv oldname newname
6. **`touch`**: Create an empty file or update the timestamp of an existing file.
```sh
touch newfile
cat: Display the contents of a file. ```sh cat myfile
8. **`less`**: View the contents of a file one page at a time.
```sh
less myfile
find: Search for files in a directory hierarchy. ```sh find /path -name filename
10. **`grep`**: Search for a specific pattern within files.
```sh
grep "pattern" filename
Composer Commands
composer install: Install project dependencies fromcomposer.json. ```sh composer install
2. **`composer update`**: Update project dependencies to the latest versions.
```sh
composer update
composer require: Add a new package to your project. ```sh composer require vendor/package
4. **`composer dump-autoload`**: Regenerate the list of all classes that need to be included in the project.
```sh
composer dump-autoload
MySQL Commands
- Import Database: Import a database from a file. ```sh mysql -u username -p database_name < file.sql
2. **Export Database**: Export a database to a file.
```sh
mysqldump -u username -p database_name > file.sql
- Show Databases: List all databases on the server. ```sql SHOW DATABASES;
4. **Show Tables**: List all tables in the selected database.
```sql
SHOW TABLES;
- Describe Table: Show the structure of a table. ```sql DESCRIBE table_name;
## GitHub Commands
1. **Clone Repository**: Clone a remote repository to your local machine.
```sh
git clone https://github.com/user/repo.git
- Commit Changes: Commit staged changes with a message. ```sh git commit -m "Commit message"
3. **Push Changes**: Push local commits to a remote repository.
```sh
git push origin branch_name
- Pull Changes: Fetch and merge changes from a remote repository. ```sh git pull origin branch_name
5. **Create Branch**: Create a new branch.
```sh
git checkout -b new_branch_name
- Merge Branch: Merge a branch into the current branch. ```sh git merge branch_name
## Homebrew Commands (macOS)
1. **Install Package**: Install a new package using Homebrew.
```sh
brew install package_name
- Update Homebrew: Update Homebrew to the latest version. ```sh brew update
3. **Upgrade Packages**: Upgrade all installed packages to their latest versions.
```sh
brew upgrade
- Search Package: Search for a package in Homebrew. ```sh brew search package_name
## Apache Server Commands
1. **Start Apache**: Start the Apache server.
```sh
sudo service apache2 start
- Stop Apache: Stop the Apache server. ```sh sudo service apache2 stop
3. **Restart Apache**: Restart the Apache server.
```sh
sudo service apache2 restart
- Check Apache Status: Check the status of the Apache server. ```sh sudo service apache2 status
5. **Edit Apache Configuration**: Edit the Apache configuration file.
```sh
sudo nano /etc/apache2/apache2.conf
- Enable Apache Module: Enable a specific Apache module. ```sh sudo a2enmod module_name
7. **Disable Apache Module**: Disable a specific Apache module.
```sh
sudo a2dismod module_name
Additional Useful Commands
ls: List files and directories in the current directory. ```sh ls -la
2. **`cd`**: Change the current directory.
```sh
cd /path/to/directory
curl: Transfer data from or to a server. ```sh curl http://example.com
4. **`nano`**: Edit files using the nano text editor.
```sh
nano filename
wget: Download files from the web. ```sh wget http://example.com/file.zip
6. **`tar`**: Archive files into a tarball or extract a tarball.
```sh
tar -czvf archive.tar.gz directory/
tar -xzvf archive.tar.gz
zip: Compress files into a zip archive. ```sh zip -r archive.zip directory/
8. **`unzip`**: Extract files from a zip archive.
```sh
unzip archive.zip
Conclusion
These commands are fundamental for managing your development environment, especially when working with an Apache server. By mastering these commands, you can efficiently handle file management, dependency management, database operations, and more. Practice using these commands to streamline your development workflow and improve productivity.