os_cp:files_processes
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| os_cp:files_processes [2023/04/02 09:07] – utworzono jkonczak | os_cp:files_processes [2026/03/12 00:00] (current) – [Directories] jkonczak | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Copying, moving and erasing files ===== | ===== Copying, moving and erasing files ===== | ||
| - | < | + | < |
| - | To create an empty file, you can use '' | + | To create an empty file, you can use '' |
| + | To create file with some contents, you can use '' | ||
| + | or '' | ||
| \\ | \\ | ||
| The '' | The '' | ||
| Line 11: | Line 13: | ||
| To display a file, use '' | To display a file, use '' | ||
| - | < | + | </ |
| ==== Directories ==== | ==== Directories ==== | ||
| Line 17: | Line 19: | ||
| **'' | **'' | ||
| \\ | \\ | ||
| - | < | + | < |
| '' | '' | ||
| \\ | \\ | ||
| With the '' | With the '' | ||
| - | < | + | </ |
| To remove an empty directory one can use '' | To remove an empty directory one can use '' | ||
| ~~Exercise.# | ~~Exercise.# | ||
| + | < | ||
| . | . | ||
| ├── foo | ├── foo | ||
| - | │ ├── | + | │ ├── |
| - | │ │ └── | + | │ │ └── |
| - | │ └── | + | │ └── |
| └── foobaz | └── foobaz | ||
| └── bar | └── bar | ||
| - | + | </ | |
| - | ~~Exercise.# | + | |
| + | ~~Exercise.# | ||
| ==== Hard and soft links ==== | ==== Hard and soft links ==== | ||
| Line 41: | Line 45: | ||
| A directory entry can also point to another directory entry. | A directory entry can also point to another directory entry. | ||
| - | All Linux filesystems [[https:// | + | All Linux filesystems [[https:// |
| To create a hard link, one can use **'' | To create a hard link, one can use **'' | ||
| To create a symlink, one can use **'' | To create a symlink, one can use **'' | ||
| + | |||
| + | ++ Illustration of hard links and soft links | | ||
| + | < | ||
| + | ++ | ||
| ~~Exercise.# | ~~Exercise.# | ||
| - | < | + | < |
| ~~Exercise.# | ~~Exercise.# | ||
| Line 54: | Line 62: | ||
| The disk space used by a file is reclamied once link count drops to 0 (all directory entries that link to the file are erased) and the file is no longer open in any process. | The disk space used by a file is reclamied once link count drops to 0 (all directory entries that link to the file are erased) and the file is no longer open in any process. | ||
| - | < | + | </ |
| ~~Exercise.# | ~~Exercise.# | ||
| Line 62: | Line 70: | ||
| ~~Exercise.# | ~~Exercise.# | ||
| - | < | + | < |
| - | The '' | + | The commands |
| + | symlinks and print a [[https:// | ||
| The Windows NTFS filesystem supports links as well. Creating the links is possible e.g., with [[https:// | The Windows NTFS filesystem supports links as well. Creating the links is possible e.g., with [[https:// | ||
| - | < | + | </ |
| ==== Copying and moving files ==== | ==== Copying and moving files ==== | ||
| Line 78: | Line 87: | ||
| The basic syntax is '' | The basic syntax is '' | ||
| Multiple source files can be provided if the destination is a directory. \\ | Multiple source files can be provided if the destination is a directory. \\ | ||
| - | If the destination is a file, it will be overwritten without warning | + | If the destination is a file, it will be overwritten without warning < |
| - | < | + | < |
| By default '' | By default '' | ||
| - | < | + | </ |
| When '' | When '' | ||
| Line 90: | Line 99: | ||
| To copy recursively, | To copy recursively, | ||
| - | < | + | < |
| With the '' | With the '' | ||
| - | < | + | </ |
| ~~Exercise.# | ~~Exercise.# | ||
| Line 106: | Line 115: | ||
| ~~Exercise.# | ~~Exercise.# | ||
| - | < | + | < |
| - | ~~Exercise.# | + | ~~Exercise.# |
| + | \\ (You can '' | ||
| + | |||
| + | </ | ||
| === [extra] Copying files to/from a remote machine === | === [extra] Copying files to/from a remote machine === | ||
| Line 116: | Line 128: | ||
| '' | '' | ||
| - | < | + | < |
| Microsoft Windows now ships with '' | Microsoft Windows now ships with '' | ||
| - | < | + | </ |
| Most SSH servers enable also the SFTP protocol that allows copying files more conveniently.\\ | Most SSH servers enable also the SFTP protocol that allows copying files more conveniently.\\ | ||
| Line 131: | Line 143: | ||
| ~~Exercise.# | ~~Exercise.# | ||
| - | < | ||
| - | === Rsync === | ||
| - | The '' | + | === [extra] |
| - | < | + | The '' |
| - | < | ||
| ==== Removing files ==== | ==== Removing files ==== | ||
| Line 180: | Line 189: | ||
| ~~Exercise.# | ~~Exercise.# | ||
| - | |||
| < | < | ||
| + | |||
| ~~Exercise.# | ~~Exercise.# | ||
| ~~Exercise.# | ~~Exercise.# | ||
| + | |||
| </ | </ | ||
| Line 237: | Line 247: | ||
| </ | </ | ||
| - | ==== Getting information on currently | + | ==== Getting information on currently |
| === List of processes === | === List of processes === | ||
| Line 250: | Line 260: | ||
| < | < | ||
| + | |||
| The '' | The '' | ||
| \\ | \\ | ||
| The ubiquitous '' | The ubiquitous '' | ||
| that show all processes in a specific format. | that show all processes in a specific format. | ||
| + | |||
| </ | </ | ||
| Line 306: | Line 318: | ||
| </ | </ | ||
| - | < | ||
| - | === Live process viewers === | + | === [extra] |
| The **'' | The **'' | ||
| Line 341: | Line 352: | ||
| There are numerous '' | There are numerous '' | ||
| '' | '' | ||
| - | |||
| - | < | ||
| === Looking up process identifiers === | === Looking up process identifiers === | ||
| Line 357: | Line 366: | ||
| The '' | The '' | ||
| is identical to the provided name. | is identical to the provided name. | ||
| + | |||
| </ | </ | ||
| Line 374: | Line 384: | ||
| role for processes as interrupts do for the operating system — they notify | role for processes as interrupts do for the operating system — they notify | ||
| a process about an external event by forcefully switching the control flow of | a process about an external event by forcefully switching the control flow of | ||
| - | one of the processes | + | one of the process' |
| \\ | \\ | ||
| The programmer can choose to block or ignore specified signals and may set up | The programmer can choose to block or ignore specified signals and may set up | ||
| Line 429: | Line 439: | ||
| Switches allow comparing against full executable name, and using regular | Switches allow comparing against full executable name, and using regular | ||
| expressions. | expressions. | ||
| + | |||
| </ | </ | ||
| Line 436: | Line 447: | ||
| < | < | ||
| + | |||
| ~~Exercise.# | ~~Exercise.# | ||
| - | </ | ||
| - | < | + | </small> |
| - | ==== Controlling process scheduling ==== | + | ==== [extra] |
| The duty of the operating system is to decide which process is given resources | The duty of the operating system is to decide which process is given resources | ||
| Line 484: | Line 495: | ||
| changes it to //spec//. | changes it to //spec//. | ||
| - | '' | + | '' |
| Line 493: | Line 504: | ||
| ~~Exercise.# | ~~Exercise.# | ||
| \\ | \\ | ||
| - | Then, in both terminals, run '' | + | Then, in both terminals, run '' |
| (< | (< | ||
| \\ | \\ | ||
| Line 538: | Line 549: | ||
| on physical threads of node //x// and memory of node //y//. | on physical threads of node //x// and memory of node //y//. | ||
| - | < | ||
| Line 544: | Line 554: | ||
| language = en | language = en | ||
| ~~ | ~~ | ||
| - | |||
| - | |||
os_cp/files_processes.1680426441.txt.gz · Last modified: (external edit)