SlideShare a Scribd company logo
Conquering the
Command Line
Making WordPress Work
About Me
● Developer at ServerGrove
● All around nerd
● Systems Administrator for
7 years
● @aramonc in all the places
Why bother?
More than 40% of all web servers use Linux
Debian
Ubuntu

CentOS/RHEL
SmartOS*

Servers do not use graphical interfaces
*Not really Linux, still Unix based
What if I mess up?
Conquering the Command Line
Navigating the Folder = Directory Tree
Where are you right now?
Print Working Directory

$>pwd
/var/www/wp_site
● /var/www/wp_site = a path
● / not 
● Starts with / (root) = absolute
What’s in here?
LiSt

$>ls
index.php
license.txt
readme.html
wp-activate.php
wp-admin
wp-blog-header.php
wp-comments-post.php
wp-config-sample.php

wp-includes
wp-links-opml.php
wp-load.php
wp-login.php
wp-mail.php
wp-settings.php
wp-signup.php
wp-trackback.php
What’s in here?
LiSt

$>ls -la
total 320
drwxr-xr-x
drwxr-xr-x
-rw-r--r--@
-rw-r--r--@
-rw-r--r--@
-rw-r--r--@
drwxr-xr-x@
drwxr-xr-x@
-rw-r--r--@

21
3
1
1
1
1
88
5
1

adrian_sg
root
adrian_sg
adrian_sg
adrian_sg
adrian_sg
adrian_sg
adrian_sg
adrian_sg

wheel
wheel
wheel
wheel
wheel
wheel
wheel
wheel
wheel

714
102
640
418
19929
7185
2992
170
2932

Feb
Feb
Mar
Sep
Jan
Jan
Jan
Jan
Sep

28
28
05
24
18
13
23
23
24

22:07
21:57
20:14
20:18
2013
13:16
15:17
15:17
20:18

.
..
.htaccess
index.php
license.txt
readme.html
wp-admin
wp-content
wp-cron.php
Moving around...
Change Directory
$>cd wp-admin
$>pwd
/var/www/wp_site/wp-admin
$>cd /var/www/wp_site
$>pwd
/var/www/wp_site
$>cd wp-content/themes/twentyfourteen
$>pwd
/var/www/wp_site/wpcontent/themes/twentyfourteen
Moving around...
Change Directory
$>cd ..
$>pwd
/var/www/wp_site
$>cd ~/
$>pwd
/Users/adrian_sg
$>cd $>pwd
/var/www/wp_site
Where is this thing?
Find
$>find . -iname xml*
/var/www/wp_site/xmlrpc.php

$>find . -ctime 3

. (dot) means current directory
-ctime in 24 hour increments of
creation date
Where is this thing?
Globally search a Regular Expression and Print

$>grep theme ./*
./index.php: * wp-blog-header.php...the theme.
grep: ./wp-admin: Is a directory
./wp-settings.php:require(ABSPATH.WPINC.'/theme.php');
./wp-settings.php:do_action( 'setup_theme' );
Where is this thing?
Globally search a Regular Expression and Print

$>grep -R theme ./*
./wp-admin/update.php:
./wp-admin/update.php:
./wp-admin/update.php:

$parent_file='themes.php';
$submenu_file='themes.php';
$nonce='install-theme_'.$theme;
Can I change things?
Owners, Groups, & Permissions

$>ls -l
total 320
-rw-r--r--@
1 adrian_sg
-rw-r--r--@
1 adrian_sg
-rw-r--r--@
1 adrian_sg
drwxr-xr-x@ 88 adrian_sg
drwxr-xr-x@
5 adrian_sg
-rw-r--r--@
1 adrian_sg
drwxr-xr-x@ 122 adrian_sg
-rw-r--r--@
1 adrian_sg

wheel
wheel
wheel
wheel
wheel
wheel
wheel
wheel

418
19929
7185
2992
170
2932
4148
2359

Sep
Jan
Jan
Jan
Jan
Sep
Jan
Oct

24
18
13
23
23
24
23
24

20:18
2013
13:16
15:17
15:17
20:18
15:17
18:58

index.php
license.txt
readme.html
wp-admin
wp-content
wp-cron.php
wp-includes
wp-load.php
Can I change things?
Permissions
r = Read
w = Write
x = Execute (run a script or open a directory)
Three levels of permissions: Owner, Group,
Everyone else
Can I change things?
Owner = User
● Sometimes your user
● Sometimes root
● Sometimes www-data (Apache user)
Can I change things?
Group
● Permissions for a set of users
● Users have own group
● Most users only belong to own group
Can I change things?
Permissions

$>ls -l
drwxr-xr-x@

Is Dir.?

88 adrian_sg

wheel

2992 Jan 23 15:17 wp-admin

Group

adrian_sg
d

Owner

wheel

rwx

r-x

Everyone

r-x
How do I change this thing?
MaKe DIRectory

$>mkdir -p useless/stuff
$>ls -l
-rw-r--r--@
-rw-r--r--@
-rw-r--r--@
drwxr-xr-x
-rw-r--r--@

1
1
1
2
1

adrian_sg
adrian_sg
adrian_sg
adrian_sg
adrian_sg

wheel
418 Sep 24 20:18 index.php
wheel 19929 Jan 18 2013 license.txt
wheel 7185 Jan 13 13:16 readme.html
wheel
68 Mar 3 22:04 useless
wheel 4892 Oct 4 10:12 wp-activate.php
How do I change this thing?
MoVe
$>mv readme.html useless/stuff/readme
$>ls -l
-rw-r--r--@
-rw-r--r--@
drwxr-xr-x
-rw-r--r--@

1
1
2
1

adrian_sg
adrian_sg
adrian_sg
adrian_sg

wheel
418 Sep 24 20:18 index.php
wheel 19929 Jan 18 2013 license.txt
wheel
68 Mar 3 22:04 useless
wheel 4892 Oct 4 10:12 wp-activate.php
How do I change this thing?
CoPy
$>cp wp-config-sample.php wp-config.php
$>ls -l
-rw-r--r--@
-rw-r--r--@
-rw-r--r--@
drwxr-xr-x@

1
1
1
5

adrian_sg
adrian_sg
adrian_sg
adrian_sg

wheel 4795 Sep 5
wheel 3087 Oct 24
wheel 3087 Mar 3
wheel 170 Jan 23

21:38
18:58
21:59
15:17

● cp -a keeps same permissions
as original

wp-comments-post.php
wp-config-sample.php
wp-config.php
wp-content
Conquering the Command Line
When everything goes wrong...
Read the log file

$>less
/var/log/apache2/error_log
Conquering the Command Line
When everything goes wrong...
Read the log file
●
●
●
●
●
●
●

(up arrow) to scroll towards the top
(down arrow) to scroll towards the bottom
(space) next page
p previous page
q(uit) to exit
/ <expression> to search for <expression>
n to search again
But I only care about the last error...
Read the last few lines of the log file
$>tail -n 5 /var/log/apache2/error_log
[Mon Mar 03 10:28:01 2014] [notice] Digest: generating secret for digest
authentication ...
[Mon Mar 03 10:28:01 2014] [notice] Digest: done
[Mon Mar 03 10:28:01 2014] [notice] Apache/2.2.26 (Unix) DAV/2 PHP/5.5.4
mod_ssl/2.2.26 OpenSSL/0.9.8y configured -- resuming normal operations
[Mon Mar 03 13:40:08 2014] [notice] child pid 8870 exit signal Bus error (10)
[Mon Mar 03 18:02:20 2014] [notice] caught SIGTERM, shutting down
I only care about the current error...
Read the log file as it happens
$>tail -f /var/log/apache2/error_log
[Mon Mar 03 10:28:01 2014] [notice] Digest: generating secret for digest
authentication ...
[Mon Mar 03 10:28:01 2014] [notice] Digest: done
[Mon Mar 03 10:28:01 2014] [notice] Apache/2.2.26 (Unix) DAV/2 PHP/5.5.4
mod_ssl/2.2.26 OpenSSL/0.9.8y configured -- resuming normal operations
[Mon Mar 03 13:40:08 2014] [notice] child pid 8870 exit signal Bus error (10)
[Mon Mar 03 18:02:20 2014] [notice] caught SIGTERM, shutting down
[Mon Mar 03 20:18:01 2014] [notice] Apache/2.2.26 (Unix) DAV/2 PHP/5.5.4
mod_ssl/2.2.26 OpenSSL/0.9.8y configured -- resuming normal operations

● -f is interactive
● Ctrl+C to exit interactive
Who is currently on my site?
Read the access log as it happens
$>tail -f /var/log/apache2/*access_log
::1 - - [26/Dec/2013:09:35:23 -0500] "OPTIONS *
127.0.0.1 - - [26/Dec/2013:09:35:34 -0500] "GET
127.0.0.1 - - [26/Dec/2013:09:35:34 -0500] "GET
127.0.0.1 - - [26/Dec/2013:09:36:40 -0500] "GET
127.0.0.1 - - [26/Dec/2013:09:36:42 -0500] "GET

HTTP/1.0" 200 / HTTP/1.1" 200 44
/favicon.ico HTTP/1.1" 404 209
/ HTTP/1.1" 304 / HTTP/1.1" 304 -
How do I change this thing
Nano text editor

$>nano wp-config.php
Conquering the Command Line
How do I change this thing
Nano text editor

$>nano wp-config.php
^G
^R
^K
^X
^W
^U

Get Help
Read File
Cut Text
Exit
Where Is
UnCut Text

^O
^Y
^C
^J
^V
^T

WriteOut
Prev Page
Cur Pos
Justify
Next Page
To Spell
Putting it all together
Deep filtering with the pipe statement
$>tail -n 10000
/var/log/apache2/error_log | grep “Mar
01” | less
Look for any log entry that occurred on March 1st within the
last ten thousand lines of the error log and display it in a
way I can easily navigate
Putting it all together
Chaining commands with &
$>mkdir -p /var/www/wp_site/news
&& wget http://wordpress.org/latest.zip
&& unzip latest.zip -d
/var/www/wp_site/news
Make news directory under /var/www/wp_site, then
download latest version of WordPress, then extract the
contents of the archive to /var/www/wp_site/news
Putting it all together
Creating files without a text editor
$>mkdir -p wp-content/uploads && echo e "RemoveHandler .php .phtml .php3
php4nRemoveType .php .phtml .php3
php4" > wp-content/uploads/.htaccess
Make a new uploads directory in wp-content, then create a
.htaccess file in uploads with the contents of
“RemoveHandler .php .phtml .php3 php4
RemoveType .php .phtml .php3 php4”
Resources
● Usage Share of Server OSes
● http://linuxcommand.org/
● In The Beginning Was the Command Line
● 5-Minute Essential Shell Tutorial
Questions?
Thank you!
http://www.slideshare.net/aramonc/conquering-the-command-line

More Related Content

PDF
PDF
Beyond Golden Containers: Complementing Docker with Puppet
PDF
ODP
Perl dancer
PDF
Containers for sysadmins
PDF
Install tomcat 5.5 in debian os and deploy war file
PPTX
OpenStack Swift - MSST 2011 Tutorial Day
PDF
Solaris_quickref.pdf
Beyond Golden Containers: Complementing Docker with Puppet
Perl dancer
Containers for sysadmins
Install tomcat 5.5 in debian os and deploy war file
OpenStack Swift - MSST 2011 Tutorial Day
Solaris_quickref.pdf

What's hot (15)

DOCX
Really useful linux commands
PPTX
What is suid, sgid and sticky bit
PPTX
Environments line-up! Vagrant & Puppet 101
PDF
Heroku Tips and Hacks
PDF
mapserver_install_linux
PDF
How to add user in system without useradd command
PDF
Build Moses on Ubuntu (64-bit) in VirtualBox: recorded by Aaron
PPTX
2012 coscup - Build your PHP application on Heroku
PDF
konfigurasi freeradius + daloradius in debian 9
PPTX
망고100 보드로 놀아보자 7
PDF
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...
PDF
Alfredo-PUMEX
PDF
Augeas
PDF
Talk NullByteCon 2015
PDF
Provisionamento orquestrado nas nuvens com Juju
Really useful linux commands
What is suid, sgid and sticky bit
Environments line-up! Vagrant & Puppet 101
Heroku Tips and Hacks
mapserver_install_linux
How to add user in system without useradd command
Build Moses on Ubuntu (64-bit) in VirtualBox: recorded by Aaron
2012 coscup - Build your PHP application on Heroku
konfigurasi freeradius + daloradius in debian 9
망고100 보드로 놀아보자 7
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...
Alfredo-PUMEX
Augeas
Talk NullByteCon 2015
Provisionamento orquestrado nas nuvens com Juju
Ad

Similar to Conquering the Command Line (20)

PDF
Learning the command line
PDF
First there was the command line
DOC
Capital onehadoopclass
PDF
Operation outbreak
PPTX
Creating "Secure" PHP applications, Part 2, Server Hardening
PDF
LogStash - Yes, logging can be awesome
PPT
vBACD - Introduction to Opscode Chef - 2/29
PDF
PFIセミナー資料 H27.10.22
PDF
Installing spark 2
PDF
Linux 系統管理與安全:基本 Linux 系統知識
ODP
Drizzle to MySQL, Stress Free Migration
PPTX
Dtalk shell
DOC
Php version 5
PDF
Puppet Data Mining
PDF
Thijs Feryn - Leverage HTTP to deliver cacheable websites - Codemotion Milan ...
PDF
Miscelaneous Debris
TXT
Command
PDF
AtlasCamp 2015 Docker continuous integration training
PDF
PDF
Operating CloudStack: the easy way (automation!)
Learning the command line
First there was the command line
Capital onehadoopclass
Operation outbreak
Creating "Secure" PHP applications, Part 2, Server Hardening
LogStash - Yes, logging can be awesome
vBACD - Introduction to Opscode Chef - 2/29
PFIセミナー資料 H27.10.22
Installing spark 2
Linux 系統管理與安全:基本 Linux 系統知識
Drizzle to MySQL, Stress Free Migration
Dtalk shell
Php version 5
Puppet Data Mining
Thijs Feryn - Leverage HTTP to deliver cacheable websites - Codemotion Milan ...
Miscelaneous Debris
Command
AtlasCamp 2015 Docker continuous integration training
Operating CloudStack: the easy way (automation!)
Ad

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
cuic standard and advanced reporting.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Electronic commerce courselecture one. Pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Unlocking AI with Model Context Protocol (MCP)
PPT
Teaching material agriculture food technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation theory and applications.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
DOCX
The AUB Centre for AI in Media Proposal.docx
“AI and Expert System Decision Support & Business Intelligence Systems”
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Spectral efficient network and resource selection model in 5G networks
cuic standard and advanced reporting.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Electronic commerce courselecture one. Pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Building Integrated photovoltaic BIPV_UPV.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Approach and Philosophy of On baking technology
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Unlocking AI with Model Context Protocol (MCP)
Teaching material agriculture food technology
Reach Out and Touch Someone: Haptics and Empathic Computing
MYSQL Presentation for SQL database connectivity
Encapsulation theory and applications.pdf
Network Security Unit 5.pdf for BCA BBA.
The AUB Centre for AI in Media Proposal.docx

Conquering the Command Line

  • 2. About Me ● Developer at ServerGrove ● All around nerd ● Systems Administrator for 7 years ● @aramonc in all the places
  • 3. Why bother? More than 40% of all web servers use Linux Debian Ubuntu CentOS/RHEL SmartOS* Servers do not use graphical interfaces *Not really Linux, still Unix based
  • 4. What if I mess up?
  • 6. Navigating the Folder = Directory Tree
  • 7. Where are you right now? Print Working Directory $>pwd /var/www/wp_site ● /var/www/wp_site = a path ● / not ● Starts with / (root) = absolute
  • 9. What’s in here? LiSt $>ls -la total 320 drwxr-xr-x drwxr-xr-x -rw-r--r--@ -rw-r--r--@ -rw-r--r--@ -rw-r--r--@ drwxr-xr-x@ drwxr-xr-x@ -rw-r--r--@ 21 3 1 1 1 1 88 5 1 adrian_sg root adrian_sg adrian_sg adrian_sg adrian_sg adrian_sg adrian_sg adrian_sg wheel wheel wheel wheel wheel wheel wheel wheel wheel 714 102 640 418 19929 7185 2992 170 2932 Feb Feb Mar Sep Jan Jan Jan Jan Sep 28 28 05 24 18 13 23 23 24 22:07 21:57 20:14 20:18 2013 13:16 15:17 15:17 20:18 . .. .htaccess index.php license.txt readme.html wp-admin wp-content wp-cron.php
  • 10. Moving around... Change Directory $>cd wp-admin $>pwd /var/www/wp_site/wp-admin $>cd /var/www/wp_site $>pwd /var/www/wp_site $>cd wp-content/themes/twentyfourteen $>pwd /var/www/wp_site/wpcontent/themes/twentyfourteen
  • 11. Moving around... Change Directory $>cd .. $>pwd /var/www/wp_site $>cd ~/ $>pwd /Users/adrian_sg $>cd $>pwd /var/www/wp_site
  • 12. Where is this thing? Find $>find . -iname xml* /var/www/wp_site/xmlrpc.php $>find . -ctime 3 . (dot) means current directory -ctime in 24 hour increments of creation date
  • 13. Where is this thing? Globally search a Regular Expression and Print $>grep theme ./* ./index.php: * wp-blog-header.php...the theme. grep: ./wp-admin: Is a directory ./wp-settings.php:require(ABSPATH.WPINC.'/theme.php'); ./wp-settings.php:do_action( 'setup_theme' );
  • 14. Where is this thing? Globally search a Regular Expression and Print $>grep -R theme ./* ./wp-admin/update.php: ./wp-admin/update.php: ./wp-admin/update.php: $parent_file='themes.php'; $submenu_file='themes.php'; $nonce='install-theme_'.$theme;
  • 15. Can I change things? Owners, Groups, & Permissions $>ls -l total 320 -rw-r--r--@ 1 adrian_sg -rw-r--r--@ 1 adrian_sg -rw-r--r--@ 1 adrian_sg drwxr-xr-x@ 88 adrian_sg drwxr-xr-x@ 5 adrian_sg -rw-r--r--@ 1 adrian_sg drwxr-xr-x@ 122 adrian_sg -rw-r--r--@ 1 adrian_sg wheel wheel wheel wheel wheel wheel wheel wheel 418 19929 7185 2992 170 2932 4148 2359 Sep Jan Jan Jan Jan Sep Jan Oct 24 18 13 23 23 24 23 24 20:18 2013 13:16 15:17 15:17 20:18 15:17 18:58 index.php license.txt readme.html wp-admin wp-content wp-cron.php wp-includes wp-load.php
  • 16. Can I change things? Permissions r = Read w = Write x = Execute (run a script or open a directory) Three levels of permissions: Owner, Group, Everyone else
  • 17. Can I change things? Owner = User ● Sometimes your user ● Sometimes root ● Sometimes www-data (Apache user)
  • 18. Can I change things? Group ● Permissions for a set of users ● Users have own group ● Most users only belong to own group
  • 19. Can I change things? Permissions $>ls -l drwxr-xr-x@ Is Dir.? 88 adrian_sg wheel 2992 Jan 23 15:17 wp-admin Group adrian_sg d Owner wheel rwx r-x Everyone r-x
  • 20. How do I change this thing? MaKe DIRectory $>mkdir -p useless/stuff $>ls -l -rw-r--r--@ -rw-r--r--@ -rw-r--r--@ drwxr-xr-x -rw-r--r--@ 1 1 1 2 1 adrian_sg adrian_sg adrian_sg adrian_sg adrian_sg wheel 418 Sep 24 20:18 index.php wheel 19929 Jan 18 2013 license.txt wheel 7185 Jan 13 13:16 readme.html wheel 68 Mar 3 22:04 useless wheel 4892 Oct 4 10:12 wp-activate.php
  • 21. How do I change this thing? MoVe $>mv readme.html useless/stuff/readme $>ls -l -rw-r--r--@ -rw-r--r--@ drwxr-xr-x -rw-r--r--@ 1 1 2 1 adrian_sg adrian_sg adrian_sg adrian_sg wheel 418 Sep 24 20:18 index.php wheel 19929 Jan 18 2013 license.txt wheel 68 Mar 3 22:04 useless wheel 4892 Oct 4 10:12 wp-activate.php
  • 22. How do I change this thing? CoPy $>cp wp-config-sample.php wp-config.php $>ls -l -rw-r--r--@ -rw-r--r--@ -rw-r--r--@ drwxr-xr-x@ 1 1 1 5 adrian_sg adrian_sg adrian_sg adrian_sg wheel 4795 Sep 5 wheel 3087 Oct 24 wheel 3087 Mar 3 wheel 170 Jan 23 21:38 18:58 21:59 15:17 ● cp -a keeps same permissions as original wp-comments-post.php wp-config-sample.php wp-config.php wp-content
  • 24. When everything goes wrong... Read the log file $>less /var/log/apache2/error_log
  • 26. When everything goes wrong... Read the log file ● ● ● ● ● ● ● (up arrow) to scroll towards the top (down arrow) to scroll towards the bottom (space) next page p previous page q(uit) to exit / <expression> to search for <expression> n to search again
  • 27. But I only care about the last error... Read the last few lines of the log file $>tail -n 5 /var/log/apache2/error_log [Mon Mar 03 10:28:01 2014] [notice] Digest: generating secret for digest authentication ... [Mon Mar 03 10:28:01 2014] [notice] Digest: done [Mon Mar 03 10:28:01 2014] [notice] Apache/2.2.26 (Unix) DAV/2 PHP/5.5.4 mod_ssl/2.2.26 OpenSSL/0.9.8y configured -- resuming normal operations [Mon Mar 03 13:40:08 2014] [notice] child pid 8870 exit signal Bus error (10) [Mon Mar 03 18:02:20 2014] [notice] caught SIGTERM, shutting down
  • 28. I only care about the current error... Read the log file as it happens $>tail -f /var/log/apache2/error_log [Mon Mar 03 10:28:01 2014] [notice] Digest: generating secret for digest authentication ... [Mon Mar 03 10:28:01 2014] [notice] Digest: done [Mon Mar 03 10:28:01 2014] [notice] Apache/2.2.26 (Unix) DAV/2 PHP/5.5.4 mod_ssl/2.2.26 OpenSSL/0.9.8y configured -- resuming normal operations [Mon Mar 03 13:40:08 2014] [notice] child pid 8870 exit signal Bus error (10) [Mon Mar 03 18:02:20 2014] [notice] caught SIGTERM, shutting down [Mon Mar 03 20:18:01 2014] [notice] Apache/2.2.26 (Unix) DAV/2 PHP/5.5.4 mod_ssl/2.2.26 OpenSSL/0.9.8y configured -- resuming normal operations ● -f is interactive ● Ctrl+C to exit interactive
  • 29. Who is currently on my site? Read the access log as it happens $>tail -f /var/log/apache2/*access_log ::1 - - [26/Dec/2013:09:35:23 -0500] "OPTIONS * 127.0.0.1 - - [26/Dec/2013:09:35:34 -0500] "GET 127.0.0.1 - - [26/Dec/2013:09:35:34 -0500] "GET 127.0.0.1 - - [26/Dec/2013:09:36:40 -0500] "GET 127.0.0.1 - - [26/Dec/2013:09:36:42 -0500] "GET HTTP/1.0" 200 / HTTP/1.1" 200 44 /favicon.ico HTTP/1.1" 404 209 / HTTP/1.1" 304 / HTTP/1.1" 304 -
  • 30. How do I change this thing Nano text editor $>nano wp-config.php
  • 32. How do I change this thing Nano text editor $>nano wp-config.php ^G ^R ^K ^X ^W ^U Get Help Read File Cut Text Exit Where Is UnCut Text ^O ^Y ^C ^J ^V ^T WriteOut Prev Page Cur Pos Justify Next Page To Spell
  • 33. Putting it all together Deep filtering with the pipe statement $>tail -n 10000 /var/log/apache2/error_log | grep “Mar 01” | less Look for any log entry that occurred on March 1st within the last ten thousand lines of the error log and display it in a way I can easily navigate
  • 34. Putting it all together Chaining commands with & $>mkdir -p /var/www/wp_site/news && wget http://wordpress.org/latest.zip && unzip latest.zip -d /var/www/wp_site/news Make news directory under /var/www/wp_site, then download latest version of WordPress, then extract the contents of the archive to /var/www/wp_site/news
  • 35. Putting it all together Creating files without a text editor $>mkdir -p wp-content/uploads && echo e "RemoveHandler .php .phtml .php3 php4nRemoveType .php .phtml .php3 php4" > wp-content/uploads/.htaccess Make a new uploads directory in wp-content, then create a .htaccess file in uploads with the contents of “RemoveHandler .php .phtml .php3 php4 RemoveType .php .phtml .php3 php4”
  • 36. Resources ● Usage Share of Server OSes ● http://linuxcommand.org/ ● In The Beginning Was the Command Line ● 5-Minute Essential Shell Tutorial