This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
ServerName example.com | |
ServerAlias www.example.com | |
DirectoryIndex index.php | |
DocumentRoot /var/www/wordpress/html/ | |
<Directory /var/www/wordpress/html/> | |
Options -Indexes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^your-site.com [NC] | |
RewriteRule ^(.*)$ http://www.your-site.com/$1 [L,R=301] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# check how many arguments are passed to the script | |
# if less than 3 arguments are passed to the script, print an error and exit | |
if [[ $# < 3 ]] | |
then | |
printf "%b" "error not enough aruments" | |
exit 1 # exit with non zero | |
# if more than 3 arguments are passed to the script, print an error and exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# print the first word of every line of input | |
awk '{print $1}' input.txt | |
# print the last line | |
ls -l | awk '{print $1, $NF} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ln -s path/to/source path/to/alias |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Bash File Testing | |
# -b filename Block special file | |
# -c filename Special character file | |
# -d directoryname Check for directory existence | |
# -e filename Check for file existence | |
# -f filename Check for regular file existence not a directory | |
# -G filename Check if file exists and is owned by effective group ID. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# =========================================================== | |
# = Showing All Hidden (dot) Files in the Current Directory = | |
# =========================================================== | |
# Use ls -d along with whatever other criteria you have. | |
ls -d .* | |
ls -d .b* | |
ls -d .[!.]* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls *.{jpg,gif} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Square brackets—matches any of a series of characters in a filename. | |
#For example, ls a[rn]t.jpg matches art.jpg and ant.jpg, but does not match aft.jpg. | |
#If the first character is a caret (^), it matches every character except for the characters l | |
ls a[rn]t.jpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cd to previous directory | |
cd - |