Site Tools


Writing /var/www/twelvetacos/wiki/data/cache/c/cd6514f5bf9a905ce83f5e0dfd5289f9.i failed
Unable to save cache file. Hint: disk full; file permissions; safe_mode setting.
Writing /var/www/twelvetacos/wiki/data/cache/c/cd6514f5bf9a905ce83f5e0dfd5289f9.metadata failed
Hotfix release available: 2025-05-14b "Librarian". upgrade now! [56.2] (what's this?)
Hotfix release available: 2025-05-14a "Librarian". upgrade now! [56.1] (what's this?)
New release available: 2025-05-14 "Librarian". upgrade now! [56] (what's this?)
Hotfix release available: 2024-02-06b "Kaos". upgrade now! [55.2] (what's this?)
Hotfix release available: 2024-02-06a "Kaos". upgrade now! [55.1] (what's this?)
New release available: 2024-02-06 "Kaos". upgrade now! [55] (what's this?)
Hotfix release available: 2023-04-04b "Jack Jackrum". upgrade now! [54.2] (what's this?)
Hotfix release available: 2023-04-04a "Jack Jackrum". upgrade now! [54.1] (what's this?)
New release available: 2023-04-04 "Jack Jackrum". upgrade now! [54] (what's this?)
Hotfix release available: 2022-07-31b "Igor". upgrade now! [53.1] (what's this?)
Hotfix release available: 2022-07-31a "Igor". upgrade now! [53] (what's this?)
New release available: 2022-07-31 "Igor". upgrade now! [52.2] (what's this?)
New release candidate 2 available: rc2022-06-26 "Igor". upgrade now! [52.1] (what's this?)
New release candidate available: 2022-06-26 "Igor". upgrade now! [52] (what's this?)
Hotfix release available: 2020-07-29a "Hogfather". upgrade now! [51.4] (what's this?)
New release available: 2020-07-29 "Hogfather". upgrade now! [51.3] (what's this?)
New release candidate 3 available: 2020-06-09 "Hogfather". upgrade now! [51.2] (what's this?)
New release candidate 2 available: 2020-06-01 "Hogfather". upgrade now! [51.1] (what's this?)
New release candidate available: 2020-06-01 "Hogfather". upgrade now! [51] (what's this?)
Hotfix release available: 2018-04-22c "Greebo". upgrade now! [50.3] (what's this?)
Hotfix release available: 2018-04-22b "Greebo". upgrade now! [50.2] (what's this?)
Hotfix release available: 2018-04-22a "Greebo". upgrade now! [50.1] (what's this?)
New release available: 2018-04-22 "Greebo". upgrade now! [50] (what's this?)
Hotfix release available: 2017-02-19g "Frusterick Manners". upgrade now! [49.7] (what's this?)
Hotfix release available: 2017-02-19f "Frusterick Manners". upgrade now! [49.6] (what's this?)
cori_s_guide_to_linux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cori_s_guide_to_linux [2015/02/13 20:11]
71.166.62.141 [Navigating around the system]
cori_s_guide_to_linux [2017/03/12 20:44] (current)
Line 2: Line 2:
  
 ====Connecting to the server==== ====Connecting to the server====
-The server is running at twelvetacos.com and ssh is open on port 2242Open PuTTY and enter the server Host Name and PortIf you want to save the connection info, enter a name for the connection in "Saved Sessions" ​and click saveTo load saved session, double-click on the saved session. +The server is running at twelvetacos.com and ssh is open on port 2222Either pull up a terminal ​and connect to ssh using ''​ssh -p 2222 twelvetacos.com''​ or browse ​to https://​shell.twelvetacos.com ​and log in thereThe terminal will probably have faster and more responsive experience.
- +
- +
-{{:putty.png?400 |}}+
  
 ====Initial Configuration==== ====Initial Configuration====
Line 18: Line 15:
 /tmp/   - Contains temporary files. /tmp/   - Contains temporary files.
 </​code>​ </​code>​
-Your home directory will be located at /​home/​corina/​. Your current directory will be displayed in your prompt to the right of the colon ''​corina@jolokia:​~$''​. The tilde is a shortcut for your home directory. Some basic commands for navigating the system are below.+ 
 +Your home directory will be located at /​home/​corina/​. Your current directory will be displayed in your prompt to the right of the colon ''​corina@taco:​~$''​. The tilde is a shortcut for your home directory. Some basic commands for navigating the system are below.
 <​code>​ <​code>​
 pwd - Print the working directory (show where you currently are in the file system. pwd - Print the working directory (show where you currently are in the file system.
-corina@jolokia:~$ pwd+corina@taco:~$ pwd
 /​home/​corina /​home/​corina
  
 ls - List the contents of the current directory. You can also provide a location as an argument to view ls - List the contents of the current directory. You can also provide a location as an argument to view
      the contents of another directory. (ls /var/www/)      the contents of another directory. (ls /var/www/)
-corina@jolokia:~$ ls /var/www +corina@taco:~$ ls /var/www 
-corinaheich  ​facebook ​ reddit ​ ​twelvetacos ​ writingroots+corinaheich  ​decrepitgoats ​ ​twelvetacos ​ writingroots
  
 ls -l - Providing the -l option will give a long listing to include file permissions along with the owner ls -l - Providing the -l option will give a long listing to include file permissions along with the owner
         and group owner of each file.         and group owner of each file.
-corina@jolokia:~$ ls -l /var/www +corina@taco:~$ ls -l /var/www 
-total 20 +total 16 
-drwxr-xr-x 4 www-data www-data 4096 Feb 10 23:19 corinaheich +drwxr-s--- 3 root www-data 4096 Mar 11 23:43 corinaheich 
-drwxr-xr-x 4 www-data www-data 4096 Dec 29 23:00 facebook +drwxr-s--- 4 root www-data 4096 Mar 11 13:31 decrepitgoats 
-drwxr-xr-x ​www-data ​www-data 4096 Dec 29 23:00 reddit +drwxr-s--- 8 root www-data 4096 Mar 11 13:31 twelvetacos 
-drwxr-xr-x 5 www-data www-data 4096 Jan  1 17:40 twelvetacos +drwxr-s--- 3 root www-data 4096 Mar 11 13:32 writingroots 
-drwxr-xr-x 4 www-data www-data 4096 Feb 10 22:09 writingroots+ 
 +cd - Change the current directory 
 +corina@taco:​~$ cd /​var/​www/​corinaheich
  
 cat - Print the contents of a file to the screen. cat - Print the contents of a file to the screen.
-corina@jolokia:~$ cat /​var/​www/​corinaheich/​public_html/index.php+corina@taco:~$ cat /​var/​www/​corinaheich/​www/index.php
 <?php <?php
 /** /**
Line 49: Line 49:
 ... ...
  
-more - Print the contents of a file to the screen, but allow scrolling through the file if it is too long.+less - Print the contents of a file to the screen, but allow scrolling through the file if it is too long.
        The down arrow key will scroll down and the pg dn key and space bar will allow faster scrolling.        The down arrow key will scroll down and the pg dn key and space bar will allow faster scrolling.
-corina@jolokia:~$ more /​var/​www/​corinaheich/​public_html/index.php+corina@taco:~$ more /​var/​www/​corinaheich/​www/index.php
 <?php <?php
 /** /**
Line 60: Line 60:
 ... ...
  
 +grep - Search files for a pattern. If you are looking for a certain pattern in a file, you can use this
 +       ​tool. ​ The syntax is ''​grep <​pattern>​ <​file>''​. You can use * as a wildcard when specifying files
 +       to search for. If you want to search all files in a directory, the use ''​grep <​pattern>​ *''​. If
 +       you want to search subdirectories as well, specify the -r (recursive) option.
 +corina@taco:​~$ grep -r "#​ff"​ /​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​
 +/​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​style.css: ​       background-color:​ #fff9c0;
 +/​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​style.css: ​       color: #fff;
 +/​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​style.css: ​       color: #fff;
 +/​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​style.css: ​       color: #fff;
 +...
 +...
 +...
 +
 +| - You can chain commands together with the | command. I mostly use this with grep when I am expecting a
 +    lot of output. Instead of filling up the terminal with crap, I can pipe the output of grep into the
 +    more command, which will allow me to scroll through it bit by bit.
 +corina@taco:​~$ grep -r "#​ff"​ /​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​ | less
 +/​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​style.css: ​       background-color:​ #fff9c0;
 +/​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​style.css: ​       color: #fff;
 +/​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​style.css: ​       color: #fff;
 +/​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​style.css: ​       color: #fff;
 +...
 +...
 +...
 +    You can also chain together multiple grep statements. This will allow you to search for one term,
 +    then search those results for a second term, and so on. This is useful when I have a couple things
 +    I want to search for but I'm not sure what they will be formatted like.
 +corina@taco:​~$ grep -r "#​ff"​ /​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​ | grep "​background-color"​
 +/​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​style.css: ​       background-color:​ #fff9c0;
 +/​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​style.css: ​       background-color:​ #fff;
 +/​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​style.css: ​       background-color:​ #fff;
 +/​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​style.css: ​               background-color:​ #fff;
 +/​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​style.css: ​               background-color:​ #fff;
 +/​var/​www/​corinaheich/​www/​wp-content/​themes/​sela-wpcom/​editor-style.css:​ background-color:​ #fff9c0;
  
 </​code>​ </​code>​
Line 66: Line 100:
 Vim is a basic text-editing tool you can use to view and edit files. To open a file in vim, the command is simply ''​vim <​filename>''​. Once a file is open, you will be in command mode. The mode is shown at the bottom left of the screen when not in command mode. From command mode, type ''​i <​enter>''​ to enter insert mode. In insert mode, you will be able to modify the file as normal using the keyboard. To leave any mode and go back to insert mode, use the escape key. Vim is a basic text-editing tool you can use to view and edit files. To open a file in vim, the command is simply ''​vim <​filename>''​. Once a file is open, you will be in command mode. The mode is shown at the bottom left of the screen when not in command mode. From command mode, type ''​i <​enter>''​ to enter insert mode. In insert mode, you will be able to modify the file as normal using the keyboard. To leave any mode and go back to insert mode, use the escape key.
  
-To save a file, you must first be in command mode. Once in command mode, Enter '':​w <​enter>''​ to write changes to the file. To quit the vim editor, you must enter '':​q <​enter>''​. If you want to save and quit, you can combine these commands and use '':​wq <​enter>''​. This is what I use most of the time. If you want to quit without saving changes, you have to use '':​q! <​enter>''​ to tell vim you want to quit without writing changes to the file. If you receive an error about the file being only '​readonly',​ you must quit without writing changes as you do not have the right permissions to edit the file.+To save a file, you must first be in command mode. Once in command mode, Enter '':​w <​enter>''​ to write changes to the file. To quit the vim editor, you must enter '':​q <​enter>''​. If you want to save and quit, you can combine these commands and use '':​wq <​enter>''​. This is what I use most of the time. If you want to quit without saving changes, you have to use '':​q! <​enter>''​ to tell vim you want to quit without writing changes to the file. If you receive an error about the file being only '​readonly',​ you must quit without writing changes as you do not have the right permissions to edit the file. To search the file, you can use the '/'​ character from command mode. It will move the cursor to the first instance of the word that follows the slash you typed. Hit '​n'​ to go to the next instance.
  
 <​code>​ <​code>​
 vim <​filename>​ - Open a file vim <​filename>​ - Open a file
-corina@jolokia:~$ vim /​var/​www/​corinaheich/​public_html/index.php+corina@taco:~$ vim /​var/​www/​corinaheich/​www/index.php
  
 :w - Write changes to a file :w - Write changes to a file
Line 76: Line 110:
 :wq - Write changes to a file and quit :wq - Write changes to a file and quit
 :q! - Exit vim without writing changes to file :q! - Exit vim without writing changes to file
 +/​word_i_want_to_search_for ('​n'​ to view the next occurrence)
 </​code>​ </​code>​
  
 +====Web Content and Wordpress====
 +All web server content is located in '/​var/​www/'​. /var/www/ contains subdirectories for each of the domains hosted on the server. Within each domain subdirectory is a root directory. This is where the content is located. All of your wordpress content is located in ''/​var/​www/​corinaheich/​www/''​. Most of the stuff you will be interested in is located in the ''​wp-content''​ subdirectory. Wordpress stores theme and plugin information. You can use ls and cd to explore these subdirectories.
  
 +To fix things in wordpress, a lot of times it is easiest to use firebug in firefox (f12 when viewing a page) and find the element that is giving you trouble. If you want to find and modify the class it belongs to, you can grep for the class name on the server in the plugin'​s or theme'​s directory. Once found you can use vim to modify the part you want.
  
 +====Final Notes==== 
 +To view more information on how to use a command, you can use the ''​man''​ command. Simply enter ''​man <​command>''​ to view the manual for and usage of that command.
  
cori_s_guide_to_linux.1423876280.txt.gz · Last modified: 2017/03/05 13:15 (external edit)