os_cp:exercises-shell
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| os_cp:exercises-shell [2025/03/31 14:16] – jkonczak | os_cp:exercises-shell [2026/04/15 23:24] (current) – jkonczak | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | In the exercises, one may also provide names of intractive | + | In the exercises, one may also provide names of interactive |
| \\ | \\ | ||
| - | For instance, if the exercise states //Provide a command, that will let an already running process called '' | + | For instance, if the exercise states //Provide a command, that will let an already running process called '' |
| //'' | //'' | ||
| or //start '' | or //start '' | ||
| Line 20: | Line 20: | ||
| ~~#.#~~. Look up in the system manual for the '' | ~~#.#~~. Look up in the system manual for the '' | ||
| - | ~~#.#~~. Provide a command, that will log you SSH sever available at the '' | + | ~~#.#~~. Provide a command that will log you SSH sever available at the '' |
| - | ~~#.#~~. Provide a command, that logs you via SSH on the computer named '' | + | ~~#.#~~. Provide a command that logs you via SSH on the computer named '' |
| - | ~~#.#~~. Provide a command, that outputs the current working directory. | + | ~~#.#~~. Provide a command that outputs the current working directory. |
| - | ~~#.#~~. Provide a command, that enters the directory '' | + | ~~#.#~~. Provide a command that enters the directory '' |
| - | ~~#.#~~. Provide a command, that changes the directory to the '' | + | ~~#.#~~. Provide a command that changes the directory to the '' |
| - | ~~#.#~~. Provide a single command, that displays the contents of '' | + | ~~#.#~~. Provide a single command that displays the contents of '' |
| - | ~~#.#~~. Provide a command, that displays all files (including the hidden files) in the ''/ | + | ~~#.#~~. Provide a command that displays all files (including the hidden files) in the ''/ |
| - | ~~#.#~~. Provide a command, that lists files in the ''/ | + | ~~#.#~~. Provide a command that lists files in the ''/ |
| - | ~~#.#~~. Tell what is the size in MB of the file ''/ | + | ~~#.#~~. Tell what is the size, in MB, of the file ''/ |
| - | ~~#.#~~. Provide a command, that displays the contents of the '' | + | ~~#.#~~. Provide a command that displays the contents of the '' |
| ~~#.#~~. Provide a name of the most recently modified file in the ''/ | ~~#.#~~. Provide a name of the most recently modified file in the ''/ | ||
| Line 52: | Line 52: | ||
| ~~#.#~~. Provide a single command that creates a directory '' | ~~#.#~~. Provide a single command that creates a directory '' | ||
| - | ~~#.#~~. Provide a single command that creates directories '' | + | ~~#.#~~. Provide a single command that creates directories '' |
| - | ~~#.#~~. Provide a command, that remove | + | ~~#.#~~. Provide a command that removes |
| - | ~~#.#~~. Provide a command, that creates a (hard) link named '' | + | ~~#.#~~. Provide a command that creates a (hard) link named '' |
| ~~#.#~~. Provide a single command that creates a (hard) link to files '' | ~~#.#~~. Provide a single command that creates a (hard) link to files '' | ||
| - | ~~#.#~~. Provide a command, that creates a symbolic link to the file ''/ | + | ~~#.#~~. Provide a command that creates a symbolic link to the file ''/ |
| - | ~~#.#~~. Provide a command, that creates a symbolic link named '' | + | ~~#.#~~. Provide a command that creates a symbolic link named '' |
| - | ~~#.#~~. Provide a command, that copies all files with the '' | + | ~~#.#~~. Provide a command that copies all files with the '' |
| - | ~~#.#~~. Provide a command, that copies the directory '' | + | ~~#.#~~. Provide a command that copies the directory '' |
| - | ~~# | + | ~~# |
| - | ~~#.#~~. Provide a command, that moves all files with the '' | + | ~~#.#~~. Provide a command that moves all files with the '' |
| - | ~~#.#~~. Provide a command, that amends the name of the file '' | + | ~~#.#~~. Provide a command that amends the name of the file '' |
| - | ~~#.#~~. Provide a command, that amends the name of the '' | + | ~~#.#~~. Provide a command that amends the name of the '' |
| - | ~~#.#~~. Provide a command, that removes the '' | + | ~~#.#~~. Provide a command that removes the '' |
| - | ~~#.#~~. Provide a command, that removes all contents from the '' | + | ~~#.#~~. Provide a command that removes all contents from the '' |
| - | ~~#.#~~. Provide a command, that removes write-protected file '' | + | ~~#.#~~. Provide a command that removes write-protected file '' |
| - | ~~#.#~~. Provide a command, that removes all files with the extensions '' | + | ~~#.#~~. Provide a command that removes all files with the extensions '' |
| - | ~~#.#~~. Provide a command, that removes all files which name starts with '' | + | ~~#.#~~. Provide a command that removes all files which name starts with '' |
| -------------------- | -------------------- | ||
| **~~#~~. Processes.** | **~~#~~. Processes.** | ||
| - | ~~#.#~~. Provide a command, that runs the '' | + | ~~#.#~~. Provide a command that runs the '' |
| ~~#.#~~. Provide the process identifier of your current shell and provide the command you used to learn that. | ~~#.#~~. Provide the process identifier of your current shell and provide the command you used to learn that. | ||
| Line 101: | Line 101: | ||
| ~~#.#~~. Provide the name of the program that uses most space in the main memory with its non-shared files (that is, consider // | ~~#.#~~. Provide the name of the program that uses most space in the main memory with its non-shared files (that is, consider // | ||
| - | ~~#.#~~. Run in another terminal the command '' | + | ~~#.#~~. Run in another terminal the command '' |
| - | ~~#.#~~. Run in another terminal the command '' | + | ~~#.#~~. Run in another terminal the command '' |
| - | ~~#.#~~. Run in another terminal the command '' | + | ~~#.#~~. Run in another terminal the command '' |
| - | ~~#.#~~. Run in another terminal the command '' | + | ~~#.#~~. Run in another terminal the command '' |
| -------------------- | -------------------- | ||
| **~~#~~. Users. File Permissions.** | **~~#~~. Users. File Permissions.** | ||
| - | ~~#.#~~. Provide a command, that displays your username. | + | ~~#.#~~. Provide a command that displays your username. |
| - | ~~#.#~~. Provide a command, that displays to which groups the current user belongs. | + | ~~#.#~~. Provide a command that displays to which groups the current user belongs. |
| - | ~~#.#~~. Provide a command, that displays to which groups the '' | + | ~~#.#~~. Provide a command that displays to which groups the '' |
| ~~#.#~~. Provide to which user and which group the file ''/ | ~~#.#~~. Provide to which user and which group the file ''/ | ||
| Line 130: | Line 130: | ||
| ~~#.#~~. Tell which users can see the contents of the file '' | ~~#.#~~. Tell which users can see the contents of the file '' | ||
| - | ~~#.#~~. Provide a command, that revokes the users that do not belong to your group permission to read the file '' | + | ~~#.#~~. Provide a command that revokes the users that do not belong to your group permission to read the file '' |
| - | ~~#.#~~. Provide a command, that forbids access (read, write and execute) to your file '' | + | ~~#.#~~. Provide a command that forbids access (read, write and execute) to your file '' |
| ~~#.#~~. Provide a single command that sets the permissions to the file '' | ~~#.#~~. Provide a single command that sets the permissions to the file '' | ||
| - | ~~#.#~~. Provide a command, that changes the permissions to the ''/ | + | ~~#.#~~. Provide a command that changes the permissions to the ''/ |
| - | ~~#.#~~. Provide a command, that lets the user '' | + | ~~#.#~~. Provide a command that lets the user '' |
| ~~#.#~~. Tell when the contents of the file ''/ | ~~#.#~~. Tell when the contents of the file ''/ | ||
| Line 146: | Line 146: | ||
| ~~#.#~~. Tell when the file ''/ | ~~#.#~~. Tell when the file ''/ | ||
| - | ~~#.#~~. Provide a command, that changes the date od th last modification of the file '' | + | ~~#.#~~. Provide a command that changes the date of the last modification of the file '' |
| -------------------- | -------------------- | ||
| Line 152: | Line 152: | ||
| **~~#~~. Searching for files.** | **~~#~~. Searching for files.** | ||
| - | ~~#.#~~. Provide a command, that searches for all files that contain the word '' | + | ~~#.#~~. Provide a command that searches for all files that contain the word '' |
| - | ~~#.#~~. Provide a command, that searches for all directories which contain their name the string '' | + | ~~#.#~~. Provide a command that searches for all directories which contain |
| - | ~~#.#~~. Provide a command, that searches for all ordinary files that end with '' | + | ~~#.#~~. Provide a command that searches for all ordinary files that end with '' |
| - | ~~#.#~~. Provide a command, that searches for all files with size greater than 1MB that were modified within last week. | + | ~~#.#~~. Provide a command that searches for all files with size greater than 1MB that were modified within last week. |
| -------------------- | -------------------- | ||
| Line 164: | Line 164: | ||
| **~~#~~. Redirections.** | **~~#~~. Redirections.** | ||
| - | ~~#.#~~. Provide a command, that executes and measures the run time of '' | + | ~~#.#~~. Provide a command that executes and measures the run time of '' |
| - | ~~#.#~~. Provide a command, that appends the current date to the file '' | + | ~~#.#~~. Provide a command that appends the current date to the file '' |
| - | ~~#.#~~. Provide a command, that displays the contents of the file ''/ | + | ~~#.#~~. Provide a command that displays the contents of the file ''/ |
| ~~#.#~~. Provide commands that, by means of redirections, | ~~#.#~~. Provide commands that, by means of redirections, | ||
| - | ~~#.#~~. Provide a command, that displays the contents of the files created in the previous exercise side by side. | + | ~~#.#~~. Provide a command that displays the contents of the files created in the previous exercise side by side. |
| - | ~~#.#~~. Provide a single command, that displays the contents of the files created in the previous exercise one after another. | + | ~~#.#~~. Provide a single command that displays the contents of the files created in the previous exercise one after another. |
| - | ~~#.#~~. Provide a command, that created | + | ~~#.#~~. Provide a command that create |
| - | ~~#.#~~. Provide a command, that executes the command '' | + | ~~#.#~~. Provide a command that executes the command '' |
| ~~#.#~~. Provide a command that will execute the command '' | ~~#.#~~. Provide a command that will execute the command '' | ||
| - | ~~#.#~~. Provide a command, that runs in the background the program '' | + | ~~#.#~~. Provide a command that runs in the background the program '' |
| - | ~~#.#~~. Provide a command, that runs '' | + | ~~#.#~~. Provide a command that runs '' |
| - | ~~#.#~~. Provide a command, that tuns '' | + | ~~#.#~~. Provide a command, that runs '' |
| -------------------- | -------------------- | ||
| Line 239: | Line 239: | ||
| </ | </ | ||
| - | ~~#.#~~. Provide a pipeline that, counts how many '' | + | ~~#.#~~. Provide a pipeline that counts how many '' |
| < | < | ||
| 8 | 8 | ||
| Line 284: | Line 284: | ||
| </ | </ | ||
| - | ~~#.#~~. Provide a command that finds out which header file in the directory ''/ | + | ~~#.#~~. Provide a command that finds out which header file in the directory ''/ |
| - | declaration of the function '' | + | |
| ~~#.#~~. Provide a pipeline that counts how many ''#'' | ~~#.#~~. Provide a pipeline that counts how many ''#'' | ||
| Line 341: | Line 340: | ||
| ~~#.#~~. Provide a pipeline that filters the output of 'ping -i 0.5 -c 10 put.poznan.pl', | ~~#.#~~. Provide a pipeline that filters the output of 'ping -i 0.5 -c 10 put.poznan.pl', | ||
| - | answers. | ||
| < | < | ||
| 1.20 | 1.20 | ||
| Line 362: | Line 360: | ||
| ~~#.#~~. Provide a command that redirects the combined output of the commands '' | ~~#.#~~. Provide a command that redirects the combined output of the commands '' | ||
| - | ~~#.#~~. Provide a fragment of the script that creates a directory '' | + | ~~#.#~~. Provide a fragment of the script that creates a directory '' |
| -------------------- | -------------------- | ||
| Line 372: | Line 370: | ||
| ~~#.#~~. Provide a keyboard shortcut that will normally stop (i.e. put to sleep) the foreground process. | ~~#.#~~. Provide a keyboard shortcut that will normally stop (i.e. put to sleep) the foreground process. | ||
| - | ~~#.#~~. Run the '' | + | ~~#.#~~. Run the '' |
| - | ~~#.#~~. Provide a command, that runs the command '' | + | ~~#.#~~. Provide a command that runs the command '' |
| - | ~~#.#~~. Provide a command, that moves the process running in background to foreground. | + | ~~#.#~~. Provide a command that moves the process running in background to foreground. |
| ~~#.#~~. Start '' | ~~#.#~~. Start '' | ||
| - | ~~#.#~~. Provide a command, that lists the processes running in background in the current shell. | + | ~~#.#~~. Provide a command that lists the processes running in background in the current shell. |
| -------------------- | -------------------- | ||
| Line 386: | Line 384: | ||
| **~~# | **~~# | ||
| - | ~~#.#~~. Provide a command, that sets the variable '' | + | ~~#.#~~. Provide a command that sets the variable '' |
| - | ~~#.#~~. Provide a command, that sets the variable '' | + | ~~#.#~~. Provide a command that sets the variable '' |
| ~~#.#~~. Provide a command that lists all currently set variables. | ~~#.#~~. Provide a command that lists all currently set variables. | ||
| Line 396: | Line 394: | ||
| ~~#.#~~. Provide a fragment of shell script that checks if the first argument names an existing file and the second argument names an existing directory, and if not, then prints an error message and quits the script. | ~~#.#~~. Provide a fragment of shell script that checks if the first argument names an existing file and the second argument names an existing directory, and if not, then prints an error message and quits the script. | ||
| - | ~~#.#~~. Provide a fragment of shell script that checks if the second | + | ~~#.#~~. Provide a fragment of shell script that checks if the first argument is greater than the second argument, and if not, then prints an error message and quits the script. |
| ~~#.#~~. Provide a fragment of shell script that assigns to variable '' | ~~#.#~~. Provide a fragment of shell script that assigns to variable '' | ||
| - | ~~#.#~~. Provide a fragment of shell script that calls a program '' | + | ~~#.#~~. Provide a fragment of shell script that calls a program '' |
| -------------------- | -------------------- | ||
os_cp/exercises-shell.1743430611.txt.gz · Last modified: (external edit)