31
Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort ©2014

Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

Embed Size (px)

Citation preview

Page 1: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

Unix CommandsPowerPoint Presentation

developed forLS 560 Information Technology

online class - University of Alabamaby

Debey SklenarTENacious Cohort

©2014

Page 2: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

1 – Login or ssh

Being logged in to the server through a shell allows you to see what is happening on a deeper level than you can with a GUI. You have more control than you typically do with a graphical interface.

Page 3: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

2 – List Folders or ls command

The ls command lists all the files and directories in the directory you are currently in. This is important because computers use a hierarchal directory structure to organize files.

Page 4: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

3 – Change Directory or cd command

The cd command lets you change directories from one into another. It is important because without it you would be stuck in the root directory and not be able to do anything in other directories.

Page 5: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

4 – Move Back or cd .. command

The cd .. command lets you back up one level in the directory. Useful for moving around, especially if you have worked your way down in directories and do not need to go back to the beginning.

Page 6: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

4a – Return Home or cd ~ command

The cd ~ command takes you back to the beginning directory. To illustrate this, I created several levels of test directories. This lets you go back to the start without having to back up one step at a time.

Page 7: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

4b – Return Home or cd command

However, the class video showed a cd command (no ~) that when tested, looked like it worked the same as the cd ~ command, taking me back to my home directory, illustrated above.

Page 8: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

5 – Make New Directory or mkdir command

The mkdir insertnewnamehere command lets you make a new directory. Useful because you may need a new directory in which to place new files that do not fit into other established directories.

Page 9: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

6 – Change Directory or cd command

The cd command can be used to move into other directories, such as the newly created directory. Extremely useful as you will probably want to accomplish something within the new directory.

Page 10: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

7 – Display Last or history command

The history command shows you the last several commands you've entered. Extremely useful in going back to see how you may have gotten yourself to where you currently are.

Page 11: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

8 – Date command

The date command will display the current date, time and year. This could potentially become important if the timing on your computer is off; the date command would show you.

Page 12: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

9 – Users Logged In or who command

The who command tells you who else is currently logged into the server and their login location. If others had write privileges to the same files, it may be useful to see if any of them might be trying to make alterations as well.*Note that here, I am one of 6 users logged into the

server. (For some reason, it is showing me

twice . . .)

Page 13: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

10 – Calendar or cal command

The cal command will display the current month's calendar. Again, this could be useful if your computer (or you) have lost track of time.

Page 14: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

11 – rmdir command versus rm -r command

My husband advised me to use the rm -r command in order to delete the directory I created in slide 5. (I will illustrate why in the next slide.) Removing a directory can be useful if it is no longer needed.

Page 15: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

11a – rmdir command versus rm -r command

The difference between the rmdir and rm -r commands is that the rmdir command will only delete a directory that is empty. If you need to delete all the contents as well as the directory, you should use the rm -r command.

Page 16: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

12 – Long List or ls -l command

The ls -l command will show you a more detailed list of the files found in a directory, such as permissions, date created, and file size. Important for determining what you or others may or may not do with a file.

Page 17: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

13 – Directory Permissions

From the same slide, note the letters d, r, w, x, and symbol - to the left of the long listing of directories/files. These symbols (called symbolic notation) tell you what you may and may not do (or what rights/permissions you have).

Page 18: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

13a – Directory Permissions The letter d stands for directory and is sort of the

exception in our permissions because it does not represent any permission granted or denied, but rather the fact that the item listed is a directory rather than a file. If it were a file, you would see a - . It is always the first character.

Page 19: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

13b – Directory Permissions The letter r stands for read and appears if

reading is permitted. The letter w stands for write and appears if

writing is permitted.

Page 20: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

13c – Directory Permissions The letter x stands for execute and appears

when execution is permitted. The character - appears when no right for a

certain attribute is permitted.

Page 21: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

13d – Directory Permissions Note the groupings and positions of the letters

and - symbol as well. The first set of 3 characters after the initial slot

denotes the user class, most likely the account owner.

Page 22: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

13e – Directory Permissions The second set of 3 slots is reserved for the

group class rights. The third set of 3 characters displays

permissions granted to others. This is anyone and everyone with any kind of access.

Page 23: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

14 – Globally Search a Regular Expression & Print or grep command

The grep command will search out and list (or “print”) on the screen. Here, I searched for !-- on the index file of my website. This can be extremely useful when looking for something, but you are not quite sure of its location.

Page 24: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

15 – Log Out or exit command

The exit command will log you out of the system. This is best practice and common courtesy. Also, it keeps others from inferring you are working with the system when in fact you are not.

Page 25: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

16 – Processes or ps command and ps aux command

The ps aux command shows all the processes running on your machine, while the ps command will only show the processes running in your terminal window. Note the end of the ps aux list above followed by the short ps list.

Page 26: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

17 – Display a Plain Text File or more command

The more +filename command will display that file in your terminal window. This only works for plain text files, however, and if the file is too large to show in its entirety, as above, you can use the space-bar to page down through it.

Page 27: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

17a – Display a Plain Text File or more command

The problem with the more command is that once you have reached the end of the file, there is no way to get back to the top again. It is still useful to be able to look inside a file. However, there is another way . . .

Page 28: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

18 – Display a Plain Text File with the less command

With the less +filename command, a plain text file will still display in your terminal window, but here, you are able to scroll down or up with the arrow keys. I am told this is why . . .

Page 29: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

lessis

more

Page 30: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

Why is Mastery of the Command Line in Unix Important for

Information Professionals?The GUI is user-friendly and easy to use, but

what if the user is unable to find the information they seek because the GUI programmers did not anticipate such a need from the user? Information Professionals need to be able to “look under the hood” of the GUI in order to determine where the breakdown in need is arising and to help solve the problem.

Page 31: Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort

Unix CommandsPowerPoint Presentation

developed forLS 560 Information Technology

online class - University of Alabamaby

Debey SklenarTENacious Cohort

©2014