unix by darcy tatlock. 1. successful log into unix to actively manipulate your website you need to...

19
UNIX By Darcy Tatlock

Upload: morris-fletcher

Post on 22-Dec-2015

222 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

UNIXBy Darcy Tatlock

Page 2: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

1. Successful Log Into UnixTo actively manipulate your website you need to be logged in. Without being logged in you cannot enter commands to find out useful information such as the last time the account has been accessed or change directory permissions.

Page 3: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

2. List of Folders in the Root DirectoryUsing the list command allows you to see what is located in your root directory, this list shows all of the files and documents you have access to.

COMMAND: ls

Page 4: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

3. Moving into Another Directory

COMMAND: cd filename

The changing directories command allows you to move into another directory, one that is listed in your root directory. Without this command direct access to files stored in other directories would be impossible to access.

Page 5: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

4. Moving Back to the Root Directory

COMMAND: cd ..

This command is the back button of the Unix operating system. It allows you to navigate through your directories. In this case since we are only one directory away from the root directory, this is the directory we will return to.

Page 6: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

5. Making a New Directory

COMMAND: mkdir newname

To make a new directory, in this case from the root directory, you type the make a directory command followed by the new title of the new directory. In this example I use the title muffin. This can allow you to group similar files together, making them easier to find.

Page 7: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

6. Moving Into the New Directory

COMMAND: cd directoryname

Just like you used the change directory command to move into a previously existing directory. We use it again with the new directory name to move into the newly created directory. This command makes navigation easy.

Page 8: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

7. Displaying the Last 10 Commands

COMMAND: history

The history command gives you the list of the last 10 commands you have entered. I find this useful if I have forgotten which directory I am in or what I have recently done.

Page 9: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

8. What’s the Current Date?

COMMAND: date

The date command allows you to see a time stamp of the date and time you are working on entering commands into Unix. Keep this information in mind to keep track of the usage of your profile.

Page 10: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

9. How Many Other Users Are Logged In?

COMMAND: who

The who command allows you to see who else is logged into the server. This is beneficial when you need to work with a group, to see who is logged in to continue working.

Page 11: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

10. What is the Calendar’s Current Month?

COMMAND: cal

The calendar command allows you to see a calendar of the current month and year. Though not the most necessary command, it can come in handy for a quick view of the date, especially when you need to double check the due date of an assignment without leaving Unix.

Page 12: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

11. Let’s Delete the Muffin Directory!

COMMAND: rmdir title

If you no longer need a directory, due to it being empty or it is no longer needed, use the remove directory command to keep your profile tidy and organized.

Page 13: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

12. A List of Files in the Root Directory (with assigned directory permissions)

COMMAND: ls -l

The list of details of files command allows you to see what permission you, the user, your group, and others have while interacting with the files. This is beneficial because you can make sure unauthorized people don’t have the permission to edit your files.

Page 14: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

13. So What Exactly Do d r w x and – Mean and How Do You Change It?

The first character in of the line can either be d or -. The d means it is a directory and the - means it is a file.The second, third, and fourth characters are the permissions of the user (u).The fifth, sixth, and seventh characters are the permissions for the group (g).The eighth, ninth, and tenth characters are the permissions for all others (o).

To understand what permissions each individual has you need to know that r means read, w means write, and x means execute. To be able to read the file you need to have a r permission.To be able to write the file you need to have a w permission.To be able to execute or run a file you need to have a x permission.

Make sure you don’t take away any of these permissions for the user or you will not be able to work with your directory.

EXAMPLE: drwxr-xr-xThis directory allows you, the user, to read, write, and execute, the group can read, not write, and can execute, and others can also read, not write, and can execute.

Page 15: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

14. Search for a Specific Word Within a File.

COMMAND: grep term filename

In order to find a word located in a file you want to use the grep command. This helps you find certain times a term is mentioned in a specific file making it easy to identify patterns.

Page 16: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

15. Change Directory Command to Previous Directory

COMMAND: cd -

Though this is a simple command I find it very useful by making it very easy to move back to the previous directory you were in. This means if you are in a directory several steps away from the root directory and jump directly to the root you can easily move back to the previous directory without going step by step.

Page 17: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

16. Print Working Directory

COMMAND: pwd

The print working directory command tells you where you are in the directory structure. This is useful to use if you have many directories and cannot remember which one you may be in at the moment.

Page 18: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

17. The Manual Command

COMMAND: man command

The manual command allows you to look up how another command is used. This is useful if you know a command but want to check it’s function before you use it. If the next command line doesn’t show after the manual use the space bar to end the manual and continue using commands.

Page 19: UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter

18. Exit

COMMAND: exit

To keep your server and files secure, don’t forget to sign-out of Unix with this simple exit command.