This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
cori_s_guide_to_linux [2015/02/13 20:38] 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 2242. Open PuTTY and enter the server Host Name and Port. If you want to save the connection info, enter a name for the connection in "Saved Sessions" and click save. To load a saved session, double-click on the saved session. | + | The server is running at twelvetacos.com and ssh is open on port 2222. Either pull up a terminal and connect to ssh using ''ssh -p 2222 twelvetacos.com'' or browse to https://shell.twelvetacos.com and log in there. The terminal will probably have a faster and more responsive experience. |
| - | {{:putty.png?400 |}} | + | |
| ====Initial Configuration==== | ====Initial Configuration==== | ||
| Line 17: | Line 16: | ||
| </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 4 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 48: | 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 63: | Line 64: | ||
| to search for. If you want to search all files in a directory, the use ''grep <pattern> *''. If | 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. | you want to search subdirectories as well, specify the -r (recursive) option. | ||
| - | corina@jolokia:~$ grep -r "#ff" /var/www/corinaheich/public_html/wp-content/themes/sela-wpcom/ | + | corina@taco:~$ grep -r "#ff" /var/www/corinaheich/www/wp-content/themes/sela-wpcom/ |
| - | /var/www/corinaheich/public_html/wp-content/themes/sela-wpcom/style.css: background-color: #fff9c0; | + | /var/www/corinaheich/www/wp-content/themes/sela-wpcom/style.css: background-color: #fff9c0; |
| - | /var/www/corinaheich/public_html/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/public_html/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/public_html/wp-content/themes/sela-wpcom/style.css: color: #fff; | + | /var/www/corinaheich/www/wp-content/themes/sela-wpcom/style.css: color: #fff; |
| ... | ... | ||
| ... | ... | ||
| Line 75: | Line 76: | ||
| lot of output. Instead of filling up the terminal with crap, I can pipe the output of grep into the | 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. | more command, which will allow me to scroll through it bit by bit. | ||
| - | corina@jolokia:~$ grep -r "#ff" /var/www/corinaheich/public_html/wp-content/themes/sela-wpcom/ | more | + | corina@taco:~$ grep -r "#ff" /var/www/corinaheich/www/wp-content/themes/sela-wpcom/ | less |
| - | /var/www/corinaheich/public_html/wp-content/themes/sela-wpcom/style.css: background-color: #fff9c0; | + | /var/www/corinaheich/www/wp-content/themes/sela-wpcom/style.css: background-color: #fff9c0; |
| - | /var/www/corinaheich/public_html/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/public_html/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/public_html/wp-content/themes/sela-wpcom/style.css: color: #fff; | + | /var/www/corinaheich/www/wp-content/themes/sela-wpcom/style.css: color: #fff; |
| ... | ... | ||
| ... | ... | ||
| Line 86: | Line 87: | ||
| then search those results for a second term, and so on. This is useful when I have a couple things | 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. | I want to search for but I'm not sure what they will be formatted like. | ||
| - | corina@jolokia:~$ grep -r "#ff" /var/www/corinaheich/public_html/wp-content/themes/sela-wpcom/ | grep "background-color" | + | corina@taco:~$ grep -r "#ff" /var/www/corinaheich/www/wp-content/themes/sela-wpcom/ | grep "background-color" |
| - | /var/www/corinaheich/public_html/wp-content/themes/sela-wpcom/style.css: background-color: #fff9c0; | + | /var/www/corinaheich/www/wp-content/themes/sela-wpcom/style.css: background-color: #fff9c0; |
| - | /var/www/corinaheich/public_html/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/public_html/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/public_html/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/public_html/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/public_html/wp-content/themes/sela-wpcom/editor-style.css: background-color: #fff9c0; | + | /var/www/corinaheich/www/wp-content/themes/sela-wpcom/editor-style.css: background-color: #fff9c0; |
| </code> | </code> | ||
| Line 103: | Line 104: | ||
| <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 113: | Line 114: | ||
| ====Web Content and Wordpress==== | ====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 public_html directory. This is where the content is located. All of your wordpress content is located in ''/var/www/corinaheich/public_html/''. 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. | + | 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. | 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. | ||