This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
os_cp:intro [2026/03/03 00:05] jkonczak [Accessing the shell] |
os_cp:intro [2026/03/12 00:57] (current) jkonczak [Glob names and wildcards] |
||
|---|---|---|---|
| Line 99: | Line 99: | ||
| where ''user'' is the user name and ''host'' is the name or address of the target device. | where ''user'' is the user name and ''host'' is the name or address of the target device. | ||
| \\ | \\ | ||
| - | For instance, if used ''john'' would like to log into a computer named ''polluks.cs.put.poznan.pl'', he would have to input \\ ''ssh john@polluks.cs.put.poznan.pl''. | + | For instance, if the user ''john'' would like to log into a computer named ''polluks.cs.put.poznan.pl'', he would have to input \\ ''ssh john@polluks.cs.put.poznan.pl''. |
| + | \\ | ||
| + | To terminate a ssh session, one can use either ''logout'' or ''exit'' command, or use //Ctrl// + //d// key combination on empty prompt line((//Ctrl// + //d// actually indicates //end-of-file// condition.)). | ||
| Currently all major operating systems (including Windows) provide ''ssh'' command by default. | Currently all major operating systems (including Windows) provide ''ssh'' command by default. | ||
| Line 112: | Line 114: | ||
| must verify that it does not contact a rogue server that can learn the password | must verify that it does not contact a rogue server that can learn the password | ||
| ([[https://docs.ssh-mitm.at/user_guide/authentication.html#id2|ready-to-go tool]]) | ([[https://docs.ssh-mitm.at/user_guide/authentication.html#id2|ready-to-go tool]]) | ||
| - | and/or hijacks the session. | + | and/or hijack the session. |
| \\ | \\ | ||
| [[https://en.wikipedia.org/wiki/Public-key_cryptography|Asymmetric cryptography]] | [[https://en.wikipedia.org/wiki/Public-key_cryptography|Asymmetric cryptography]] | ||
| Line 144: | Line 146: | ||
| ~~Exercise.#~~ Display help for ''cat'' and ''bat'' commands by running them with help option. <html><small></html>(NB: ''bat'' is installed by default only in some Linux distros.)<html></small></html> | ~~Exercise.#~~ Display help for ''cat'' and ''bat'' commands by running them with help option. <html><small></html>(NB: ''bat'' is installed by default only in some Linux distros.)<html></small></html> | ||
| - | Usually together with a program comes with a set of system manual pages. The pages can be displayed using the **''man //pagename//''** command. To leave the manual, type ''q''. | + | Usually a program comes together with a set of system manual pages. The pages can be displayed using the **''man //pagename//''** command. To leave the manual, type ''q''. |
| ~~Exercise.#~~ Display manual page for ''timeout'' command. | ~~Exercise.#~~ Display manual page for ''timeout'' command. | ||
| Line 152: | Line 154: | ||
| Page names are unique within a section, but there may be pages with the same name in different sections. | Page names are unique within a section, but there may be pages with the same name in different sections. | ||
| \\ | \\ | ||
| - | You may use the **''whatis //pagename//''** command to learn which sections contain given page name and display the full page title. | + | You may type **''whatis //pagename//''** or <small>''man -f //pagename//''</small> to learn which sections contain given page name and display the full page title. |
| ~~Exercise.#~~ List all pages that are named ''time''. | ~~Exercise.#~~ List all pages that are named ''time''. | ||
| - | To select a page from a given section, one has to use ''man //section// //pagename//'' syntax. | + | To select a page from a given section, one has to use ''man //section// //pagename//'' syntax, e.g., ''man 2 write''. |
| ~~Exercise.#~~ The ''man'' itself is described on two manual pages. Display both. What information is contained in each one? | ~~Exercise.#~~ The ''man'' itself is described on two manual pages. Display both. What information is contained in each one? | ||
| Line 167: | Line 169: | ||
| <html><small></html> | <html><small></html> | ||
| - | For searching within manual there is also the ''apropos //what//'' command that searches within page names and titles. | + | For searching within manual there are also the ''apropos //what//'' and ''man -k //what//'' commands that search within page names and titles. |
| Apart from ''man'', there is an alternative (and less popular) documentation system called ''info''. To see an Info page, type ''info //name//''. Some programs ship with a more detailed Info document than manual page. | Apart from ''man'', there is an alternative (and less popular) documentation system called ''info''. To see an Info page, type ''info //name//''. Some programs ship with a more detailed Info document than manual page. | ||
| Line 261: | Line 263: | ||
| To change directory the command **''cd [//target//]''** is used. If no target is provided, ''cd'' changes current directory to the home directory. | To change directory the command **''cd [//target//]''** is used. If no target is provided, ''cd'' changes current directory to the home directory. | ||
| \\ | \\ | ||
| - | <html><small></html>If ''-'' is uses as the target, the directory is changed to the previously visited. <html></small></html> | + | <html><small></html>If ''-'' is used as the target, the directory is changed to the previously visited. <html></small></html> |
| ~~Exercise.#~~ Enter ''.config'' directory (located in your home directory) and list files within. | ~~Exercise.#~~ Enter ''.config'' directory (located in your home directory) and list files within. | ||
| Line 321: | Line 323: | ||
| ~~Exercise.#~~ Change directory to ''/usr/bin/'' directory. List all files that end with ''cat''. | ~~Exercise.#~~ Change directory to ''/usr/bin/'' directory. List all files that end with ''cat''. | ||
| - | ~~Exercise.#~~ List all files that end with ''cat'' in ''/usr/bin/'' while being in your home directory. | + | ~~Exercise.#~~ Change directory to your home directory. From there, list all files that end with ''cat'' in ''/usr/bin/''. |
| - | ~~Exercise.#~~ List all files that are in the ''/usr/bin/'' directory that have names consisting of two chatacters. | + | ~~Exercise.#~~ List all files that are in the ''/usr/bin/'' directory that have names consisting of two characters. |
| ~~Exercise.#~~ List contents of ''/usr/share/zoneinfo/'' and its subdirectories using a single command. | ~~Exercise.#~~ List contents of ''/usr/share/zoneinfo/'' and its subdirectories using a single command. | ||