Você está na página 1de 3

Workshop Module 2 Commands and options

1. Sign onto atlas using ssh Host name:


atlas.sheridanc.on.ca
Username:
Port number: 22 default
Password
2. If all goes well it will login and give you a prompt
>>
3. Obtain a “listing” to see what files are in your
current directory ls
4. Provide more information about the file, provide
a “long” listing. Notice the structure of the option ls -l
with the space after the command and the dash.
This is an l and not a “one”
5. Let us now include “hidden” files, ones where the ls -a
file name starts with .
6. We can combine the options ls -al
7. What is your “present working directory” or the pwd
current location you are at in the file system?
This will represent the path to your directory
8. What is we want to change your present working cd /
directory? Lets go to “root”
9. What sort of goodies are in my new pwd? Notice ls
the files
10. Let’s descend into directory etc cd etc
11. Let’s snoop around and see what’s there? ls -l

12. How do I get back “home” no matter where I am cd


at in the system?
13. Let’s make a directory! Call it dir1 mkdir dir1
14. Dis you really make it? ls
ls dir1
15. Let’s make a few more mkdir dir2 dir3 dir4 dir6
16. Did you really make them? ls
17. Lets delete one of them
rmdir dir6
18. Did you really delete it? ls
ls dir6
19. Let’s delete a few more rmdir dir4 dir3 dir2
ls
20. Let’s descend into the directory we made cd dir1
pwd
21. Let’s make a few files touch a b c
22. Let us edit the file a vi a
23. You will be in “command mode”. Change to i
insert mode.
24. Now type your name and then your home Your actual name
address Your address
25. Save the file and exit <esc> :wq <enter>cat a
Workshop Module 2 Commands and options

26. Let’s look at the content of the file you just cat a
created
27. Now lets copy that file and call it aboutme cp a aboutme
28. Let’s look at our directory and then output the ls
content of this new file cat aboutme
29. Let’s now rename file b to blank using move mv b .blank
command. But we want to make it a hidden file
30. How come you can’t see blank? ls
31. Remember, its hidden!! ls -a
32. We now want to remove file a rm a
33. See if it worked ls
34. Lets go back to your home cd
pwd
35. Let’s try to delete directory dir1. Why does this rmdir dir1
not work?
36. Lets try recursive remove rm –r dir1
37. What happened? This will recursively remove ls
files and then the directories in which they were
contained.
38. Let’s create a directory again and then go into mkdir mod2
that directory cd mod2
39. Lets make a few files and see what it is touch a b
ls -l
40. The file command will tell us about the file file a
41. Lets edit file b and insert our name vi b
i
your name
<esc>:wq <enter>
42. What does file do this time file b
43. Let’s try the whoami command. What did this whoami
do?
44. Try the command to see who is logged onto the who
system
45. To look up more information about a command, man ls
use “man”. Use cursor and enter to page down. q
To get out and back to shell use the “q” key
46. You can do this for any command. Its your online man man
help man vi
man –k vi
47. Let’s work with vi a bit more vi b
48. Remember, you are in “command mode”. Try the
following keys and see what happens l h
49. Let’s go back to insert mode i
50. See if you can cursor around. At some point, <enter>
press enter. This is a new line <enter>
This is another line <enter>
Workshop Module 2 Commands and options

Last line
51. Press <esc> to get into insert mode <esc>
52. Use the command keys to cursor around the file h j k l
53. You can cursor by word instead of letter, try W w b B
these keys
54. Where does the cursor go when you type the 0 $
following (beginning of line, end of line)
55. Experiment with x (delete character) y (yank) p x y yy p u
(paste) u (undo)
56. You can search for text /line <enter>
57. There are different ways to get into insert mode A I i

58. Add a line to say you are done I am done


59. Save and exit vi <esc> :wq
60. Clear the screen clear
61. Who are you? whoami
62. What did you just make cat b
63. Take a screen shot and submit to dropbox. You
are done!

Screenshot for workshop 2 :

Você também pode gostar