Конвертер валютUSD 2,9921EUR 3,3424Моя статистикаПройдите любой тест
Все записи блога →
Последние Новости
  • Тур Хейердал — путешественник, переплывший океан на плоту
    Шесть мужчин, бальсовый плот и бескрайний Тихий океан. Тур Хейердал хотел проверить смелую идею: могли ли жители Южной Америки в древности добраться до островов Полинезии. Чтобы узнать это, он сам отправился в путь.Путь к успехуТур Хейердал родился 6 октября 1914 года в городе Ларвик в Норвегии. С детства он увлекался зоологией и дикой природой. В 1937–1938 годах Тур с женой прожил около года на острове Фату-Хива в Полинезии. Именно там, наблюдая за ветрами и течениями, он задумался о происхожде...
  • Христофор Колумб — мореплаватель, открывший Европе Америку
    Утром 12 октября 1492 года матрос с корабля «Пинта» крикнул, что видит берег. Через несколько часов три небольших судна подошли к острову, который местные жители называли Гуанахани. Экспедиция Христофора Колумба завершила первый переход через Атлантический океан, после которого мир перестал быть прежним.Путь к экспедицииКолумб родился около 1451 года в Генуе в семье ткача. Он рано ушёл в море, плавал по Средиземному и Атлантическому океанам, жил в Португалии. Он был уверен, что до Индии и Китая ...
  • Фрэнк Синатра — «Голос» века, певший по-своему
    Шляпа с лентой, небрежно накинутый плащ, бархатный баритон — Фрэнк Синатра умел превратить трёхминутную песню в маленький спектакль. Прозвище «Голос» закрепилось за ним ещё в 1940-х, и за десятилетия его мало кто смог оспорить.Путь к успехуСинатра родился в декабре 1915 года в Хобокене, штат Нью-Джерси, в семье итальянских эмигрантов. Музыкального образования он почти не получил, зато с юности пел на радио и в клубах. Первые успехи пришли в оркестрах Гарри Джеймса и Томми Дорси. В начале 194...
  • Михаил Булгаков — мастер, которого прочли после смерти
    Автор, которого при жизни почти не печатали, оказался одним из самых читаемых писателей столетия. История Михаила Афанасьевича Булгакова — это история терпения, упорства и веры в свою книгу.Путь к успехуБулгаков родился в 1891 году в Киеве, в семье преподавателя духовной академии. В 1916 году он окончил медицинский факультет Киевского университета и сразу начал работать врачом, в том числе в земской больнице в селе Никольском Смоленской губернии. Эти годы позже отразились в «Записках юного врача...
  • Дмитрий Менделеев — химик, составивший карту всех элементов
    Дмитрий Иванович Менделеев родился 8 февраля 1834 года (27 января по старому стилю) в Тобольске, в большой семье директора гимназии. Рос он в трудное время, но мать, по семейным преданиям, сделала всё, чтобы младший сын получил образование. Так будущий учёный оказался в Петербурге.Путь к успехуОкончив Главный педагогический институт, Менделеев стажировался в Европе, а в 1860-х годах стал профессором Петербургского университета. Читая курс неорганической химии, он не нашёл подходящего учебника и ...
  • Роальд Амундсен — покоритель полюсов и северо-западного прохода
    Полярные льды веками хранили свои тайны. Роальд Амундсен разгадал сразу несколько из них. Он не искал лёгкой славы: каждый его поход был итогом долгой учёбы у местных народов и внимательного расчёта.Путь к успехуАмундсен родился 16 июля 1872 года недалеко от города Борге в Норвегии. Он собирался стать врачом, но, прочитав о полярных экспедициях, выбрал другую жизнь. В 1897–1899 годах он участвовал в бельгийской экспедиции на судне «Бельжика», которая стала первой, перезимовавшей в Антарктике. Та...
  • Франциск Скорина — первопечатник Беларуси и Восточной Европы
    В 1517 году в Праге вышла небольшая книга, которую можно держать в одной руке. Это была Псалтирь, а на её страницах стояло имя издателя: «Франциск Скорина из Полоцка, в лекарских науках доктор». Так началась история восточнославянского книгопечатания.Путь к книгеТочная дата рождения Скорины неизвестна, обычно называют около 1490 года. Он родился в Полоцке в семье купца. В 1504 году его имя записано среди студентов Краковского университета. В 1512 году в итальянской Падуе он получил степень докто...
  • Марк Шагал — художник, чьи герои парят над городом
    На картинах Марка Шагала люди летают над крышами, скрипач сидит на домике, а синяя корова смотрит на зрителя человеческими глазами. Это не просто фантазия: художник всю жизнь рисовал родной Витебск, каким его хранила память, — с поэтической логикой сна.Путь к успехуМарк Шагал (при рождении Мовша Шагал) родился в 1887 году в семье бедного еврейского рабочего недалеко от Витебска и вырос в самом Витебске. Он учился у местного художника Юделя Пэна, затем уехал в Санкт-Петербург. В 191...
  • Янка Купала — народный поэт Беларуси
    Когда в начале XX века молодой поэт из деревни под Минском подписал свои стихи псевдонимом «Янка Купала», он, возможно, и не думал, что станет голосом целого народа. Но именно так и произошло.Путь к успехуИван Доминикович Луцевич родился в 1882 году в фольварке Вязынка близ Молодечно. Семья была небогатой: родители арендовали землю. Учился он в народном училище, потом работал домашним учителем, писарем, помощником провизора, много читал и рано начал писать стихи. Первое стихотворение «Мужик» нап...
  • Луи Пастер — учёный, победивший невидимых врагов
    Луи Пастер родился 27 декабря 1822 года в городке Доль на востоке Франции, в семье кожевника. Он был прилежным, но не блестящим учеником и интересовался живописью. Однако судьбу решила химия: она повела его от кристаллов к микробам и спасению жизней.Путь к успехуПервое крупное открытие Пастер сделал в 1848 году, изучая кристаллы солей винной кислоты. Он заметил, что они бывают двух зеркально отражённых форм, и тем самым заложил основы стереохимии. Позже он занялся брожением и показал, что за нег...
МатематикаМоя статистика

Тест по UNIX

100 вопросов в 10 темах (лёгкий — 35, средний — 40, сложный — 25). Выберите темы, уровень и количество вопросов — к каждому ответу есть объяснение.

Файлы и каталоги, права доступа, grep и find, конвейеры и перенаправления, sed и awk, процессы, shell-скрипты, окружение, архивы и ssh, диски и система. Вопросы на английском.

Все вопросы теста 100

Нажмите на вариант ответа, чтобы проверить себя, или «Показать ответ».

Files and directories10
1Лёгкий
Which command prints the absolute path of the directory you are currently in?
  1. cd
  2. pwd
  3. echo ~
  4. ls -d
2Лёгкий
You want to create the nested folders runs/2024/raw in one command, even though runs does not exist yet. Which command works?
  1. mkdir runs/2024/raw
  2. mkdir -r runs/2024/raw
  3. touch runs/2024/raw
  4. mkdir -p runs/2024/raw
3Средний
The current directory is /home/ana/data. What does pwd print after this command?
cd ../../bob/./src
  1. /home/bob/src
  2. /home/ana/bob/src
  3. /home/bob/./src
  4. /bob/src
4Средний
results is a directory full of output files. What happens when you run this?
cp results backup
  1. backup becomes a full copy of results with all its files
  2. backup is created as an empty directory
  3. cp refuses: "-r not specified; omitting directory 'results'" and nothing is copied
  4. results is renamed to backup
5Сложный
The directory dest does not exist. What is the result of this command?
mv a.txt b.txt dest
  1. A directory dest is created and both files are moved into it
  2. a.txt is renamed to dest, then b.txt overwrites it
  3. An error "target 'dest' is not a directory"; neither file is moved
  4. a.txt is renamed to b.txt and dest is ignored
6Лёгкий
Which of these is an absolute path?
  1. data/run1.csv
  2. ./data/run1.csv
  3. ../ana/data/run1.csv
  4. /home/ana/data/run1.csv
7Лёгкий
You want to delete the directory old_runs together with everything inside it. Which command does this?
  1. rmdir old_runs
  2. rm -r old_runs
  3. rm old_runs
  4. del old_runs
8Средний
Which command lists the files in long format with the most recently modified file first?
  1. ls -lS
  2. ls -lr
  3. ls -la
  4. ls -lt
9Средний
You were in /data/project/results, ran cd /etc and looked at some files. Which command takes you straight back to /data/project/results?
  1. cd ..
  2. cd -
  3. cd ~
  4. cd .
10Сложный
dest already exists. src contains a.txt. Where does a.txt end up after this command?
mkdir dest
cp -r src dest
  1. dest/a.txt
  2. dest/src/src/a.txt
  3. dest/src/a.txt
  4. Nowhere: cp refuses because dest already exists
Permissions10
11Лёгкий
A file has permissions set by chmod 755. What does ls -l show for it?
  1. -rwxr-xr-x
  2. -rwxrwxr-x
  3. -rw-r--r--
  4. -rwxr--r--
12Лёгкий
You saved a script as analyze.sh, but ./analyze.sh answers "Permission denied". What is the usual fix?
  1. chown root analyze.sh
  2. mv analyze.sh analyze
  3. chmod -w analyze.sh
  4. chmod +x analyze.sh
13Средний
Your umask is 022. You create a new file with touch and a new directory with mkdir. What permissions do they get?
umask 022
touch notes.txt
mkdir out
  1. notes.txt: rwxr-xr-x (755), out: rwxr-xr-x (755)
  2. notes.txt: rw-r--r-- (644), out: rwxr-xr-x (755)
  3. notes.txt: rw-rw-rw- (666), out: rwxrwxrwx (777)
  4. notes.txt: rw-r--r-- (644), out: rw-r--r-- (644)
14Средний
What numeric mode does this command leave on report.csv, whatever it had before?
chmod u=rw,g=r,o= report.csv
  1. 644
  2. 760
  3. 600
  4. 640
15Сложный
A directory shared/ has mode r-- for you (read but no execute). Which statement is true?
  1. You can cd into it and read every file, but not create new ones
  2. You can see the names of the files in it, but you cannot cd into it or open the files inside
  3. You can neither list it nor cd into it
  4. You can open files inside if you know their exact names
16Лёгкий
ls -l shows -rw-r--r-- ana lab notes.txt. Who can modify the file?
  1. Only the owner, ana
  2. Ana and every member of the group lab
  3. Everybody, because r means read and write
  4. Nobody, because no x bit is set
17Средний
Your whole team in the group lab must be able to edit every file under project/. Which command gives the group write permission everywhere inside it?
  1. chmod -R g+w project
  2. chmod g+w project
  3. chmod -R 777 project
  4. chown -R g+w project
18Средний
What does this command do (run as root)?
chown ana:lab results.csv
  1. Gives ana and lab read and write permission
  2. Copies results.csv to the home directory of ana
  3. Makes ana the owner and lab the group of results.csv
  4. Adds ana to the group lab
19Сложный
With umask 077, what permissions do a new file (touch) and a new directory (mkdir) get?
  1. File rwx------ (700), directory rwx------ (700)
  2. File rw------- (600), directory rwx------ (700)
  3. File ---rwxrwx (077), directory ---rwxrwx (077)
  4. File rw-r--r-- (644), directory rwxr-xr-x (755)
20Сложный
secret.txt is mode r-- (read-only) and owned by you, but it is inside a directory where you have rwx. Can rm secret.txt delete it?
  1. No: a read-only file can only be deleted by root
  2. No: you first need chmod +w secret.txt
  3. Only if the file also has the x bit
  4. Yes: deleting a file needs write permission on the directory, not on the file (rm may ask for confirmation)
Viewing and searching10
21Лёгкий
A simulation is writing to run.log. Which command shows the last lines and keeps printing new lines as they are appended?
  1. head -f run.log
  2. cat -f run.log
  3. tail -f run.log
  4. less -n run.log
22Средний
In a config file, comment lines start with #. Which command shows only the lines that are not comments?
  1. grep -v '^#' settings.conf
  2. grep '^#' settings.conf
  3. grep -n '#' settings.conf
  4. grep -c '^#' settings.conf
23Средний
What does this command print?
printf 'Error\nok\nERROR x\n' | grep -in error
  1. 1:Error
    3:ERROR x
  2. Error
    ERROR x
  3. 2
  4. 1:Error
24Сложный
The file has three lines, but the last one has no newline at the end. What does wc -l print?
printf 'a\nb\nc' | wc -l
  1. 3
  2. 1
  3. 2
  4. 5
25Сложный
The current directory contains a.csv, and its subfolders contain many other .csv files. Why does this command find only files named exactly a.csv?
find . -name *.csv
  1. find -name does not support wildcards; you need -regex
  2. The shell expands *.csv to a.csv before find runs; the pattern must be quoted: -name '*.csv'
  3. find searches only the current directory unless -r is given
  4. find stops after the first match unless -all is given
26Лёгкий
Which command lets you scroll through a large log file page by page and search it, without loading the whole file into an editor?
  1. cat big.log
  2. less big.log
  3. wc big.log
  4. touch big.log
27Лёгкий
Which command shows the first 5 lines of data.csv (for example, to check the header)?
  1. tail -n 5 data.csv
  2. head -c 5 data.csv
  3. less -5 data.csv
  4. head -n 5 data.csv
28Средний
Which command finds every line containing TODO in all files under the src directory and its subdirectories?
  1. grep -r TODO src
  2. grep TODO src
  3. find src TODO
  4. grep -v TODO src
29Средний
What does this command do?
find /scratch/ana -name '*.tmp' -mtime +7 -delete
  1. Deletes .tmp files modified in the last 7 days
  2. Deletes .tmp files larger than 7 MB
  3. Deletes .tmp files under /scratch/ana that were last modified more than 7 days ago
  4. Lists .tmp files that are exactly 7 days old and deletes nothing
30Сложный
How many lines does each command count?
printf 'cat\ndog\nbird\n' > a.txt
grep -c 'cat|dog' a.txt
grep -cE 'cat|dog' a.txt
  1. 2 and 2
  2. 0 and 0
  3. 0 and 2
  4. 1 and 2
Pipes and redirection10
31Лёгкий
What is the difference between > and >> when redirecting output to a file?
  1. > appends to the file, >> overwrites it
  2. >> redirects error messages, > redirects normal output
  3. There is no difference; >> is just the older syntax
  4. > overwrites the file, >> appends to the end of it
32Лёгкий
What does this command do?
./simulate 2> errors.log
  1. Writes both normal output and errors to errors.log
  2. Writes error messages (stderr) to errors.log; normal output still appears on the screen
  3. Writes normal output to errors.log and shows errors on the screen
  4. Runs simulate twice and logs the second run
33Средний
You want to watch a long computation on screen and also keep a copy of its output in run.log. Which command does this?
  1. ./compute > run.log
  2. ./compute | cat run.log
  3. ./compute >> run.log | less
  4. ./compute | tee run.log
34Сложный
What does this script print?
cat <<'EOF'
Home is $HOME
EOF
  1. Home is $HOME
  2. Home is /home/ana (the value of HOME)
  3. Home is
  4. An error: unterminated here-document
35Сложный
/nonexist does not exist. After this command, what is in out.txt and where does the error message appear?
ls /nonexist 2>&1 > out.txt
  1. out.txt contains the error message and nothing is shown
  2. out.txt contains the error message, which also appears on the terminal
  3. out.txt is empty and the error appears on the terminal
  4. The shell rejects the command: 2>&1 must come last
36Лёгкий
What does the | symbol do in ls -l | less?
  1. Sends the standard output of ls -l into the standard input of less
  2. Runs ls -l and less at the same time, independently
  3. Runs less only if ls -l succeeded
  4. Saves the output of ls -l to a file called less
37Лёгкий
w.txt has 2 lines. What do these two commands print?
wc -l w.txt
wc -l < w.txt
  1. "2" and "2 w.txt"
  2. "2 w.txt" twice
  3. An error for the second one: < is not valid with wc
  4. "2 w.txt" and "2"
38Средний
What does this command do?
cat <<EOF > params.txt
nsteps=1000
outdir=$HOME/out
EOF
  1. Writes the two lines literally, including the text $HOME
  2. Writes the two lines to params.txt, with $HOME replaced by its value
  3. Appends the lines to a file named EOF
  4. Runs the lines nsteps=1000 and outdir=... as commands
39Средний
You want to see the build output on screen and save both normal output and error messages in build.log. Which command does this?
  1. make | tee build.log 2>&1
  2. make > build.log 2>&1
  3. make 2> build.log | tee
  4. make 2>&1 | tee build.log
40Сложный
d.txt contains three numbers. What is in d.txt after this command?
sort d.txt > d.txt
  1. The three numbers, sorted
  2. Nothing: the file is empty
  3. The three numbers in the original order
  4. The numbers twice: original then sorted
Text processing10
41Лёгкий
samples.csv has lines like id,temperature,pressure. Which command prints only the temperature column?
  1. cut -f2 samples.csv
  2. cut -c2 samples.csv
  3. cut -d, -f2 samples.csv
  4. cut -d, -f1,2 samples.csv
42Средний
What does sort output for this input (without -n)?
printf '10\n9\n100\n' | sort
  1. 10, 100, 9
  2. 9, 10, 100
  3. 100, 10, 9
  4. 10, 9, 100
43Средний
What does this pipeline print?
printf 'a\nb\na\n' | uniq -c
  1. 2 a
    1 b
  2. 1 b
    2 a
  3. 3 a
  4. 1 a
    1 b
    1 a
44Средний
What does this command print?
echo 'aa aa' | sed 's/a/b/'
  1. bb bb
  2. ba aa
  3. ba ba
  4. bb aa
45Сложный
data.csv contains the three lines shown below. What does the awk command print?
$ cat data.csv
a,1,10
b,2,20
c,3,60
$ awk -F, '{s += $3} END {print s/NR}' data.csv
  1. 90
  2. 2
  3. 10
  4. 30
46Лёгкий
What does this command print?
echo 'gene_a, gene_b' | tr 'a-z' 'A-Z'
  1. Gene_a, Gene_b
  2. gene_a, gene_b
  3. GENE_A, GENE_B
  4. GENE_A, gene_b
47Средний
Which pipeline prints the two most frequent lines of words.txt, with their counts, most frequent first?
  1. sort words.txt | uniq -c | sort -rn | head -n 2
  2. uniq -c words.txt | sort -rn | head -n 2
  3. sort words.txt | uniq -c | sort | head -n 2
  4. sort -rn words.txt | uniq -c | head -n 2
48Средний
You want to replace /usr/local with /opt in every path of a file. Which sed command is the easiest to write correctly?
  1. sed 's|/usr/local|/opt|g' paths.txt
  2. sed 's//usr/local//opt/g' paths.txt
  3. sed 's/usr/local/opt/g' paths.txt
  4. sed 'r/usr/local/opt/g' paths.txt
49Сложный
What do these two commands print?
echo '  alice   42  ' | awk '{print $2}'
echo '  alice   42  ' | cut -d' ' -f2
  1. "42" and "42"
  2. "alice" and "alice"
  3. "42" and an empty line
  4. An empty line and "42"
50Сложный
runs.csv contains the lines a,x,10 / b,y,9 / c,z,100. What order does this command produce?
sort -t, -k3,3n runs.csv
  1. a,x,10 / c,z,100 / b,y,9
  2. b,y,9 / a,x,10 / c,z,100
  3. c,z,100 / a,x,10 / b,y,9
  4. a,x,10 / b,y,9 / c,z,100
Processes and jobs10
51Лёгкий
What does the & at the end of this command do?
./long_simulation &
  1. Runs the program with administrator rights
  2. Starts the program in the background and immediately returns the prompt
  3. Runs the program only if the previous command succeeded
  4. Sends the output of the program to a file named &
52Лёгкий
Right after a command finishes successfully, what does echo $? print?
  1. 1
  2. The PID of the finished command
  3. 0
  4. The number of lines the command printed
53Средний
You run kill 4321 without specifying a signal. Which signal is sent?
  1. SIGTERM (15), which asks the process to terminate and can be caught for cleanup
  2. SIGKILL (9), which cannot be caught or ignored
  3. SIGHUP (1), which is sent when the terminal closes
  4. SIGINT (2), the same as pressing Ctrl+C
54Средний
You started ./train in the foreground and realised it will take hours. What sequence frees your terminal while the program keeps running?
  1. Press Ctrl+Z, then type bg
  2. Press Ctrl+C, then type bg
  3. Press Ctrl+Z, then type fg
  4. Type & and press Enter
55Сложный
What does this print in bash (with default settings)?
false | true
echo $?
  1. 1
  2. 2
  3. 0
  4. 141
56Лёгкий
Which command shows a continuously updated, interactive view of the processes using the most CPU and memory?
  1. ps
  2. jobs
  3. kill -l
  4. top
57Средний
You started a long job on a remote server over ssh and want it to keep running after you log out. Which command is appropriate?
  1. ./simulate &
  2. nohup ./simulate > sim.log 2>&1 &
  3. ./simulate > sim.log
  4. nice ./simulate &
58Средний
What does this line print?
false && echo A || echo B
  1. A
  2. A and B
  3. Nothing
  4. B
59Средний
You ran ./sim & and then started other commands. Which pair of commands lists the background jobs and brings job 1 back to the foreground?
  1. jobs, then fg %1
  2. ps, then bg %1
  3. jobs, then kill %1
  4. top, then fg 1234
60Сложный
What exit status does wait report after the background sleep is killed with kill -9?
sleep 100 &
kill -9 $!
wait $!
echo $?
  1. 9
  2. 0
  3. 137
  4. 1
Shell scripting10
61Лёгкий
Why does a script often start with the line #!/bin/bash?
  1. It is a comment that only documents who wrote the script
  2. It tells the system which interpreter should run the file when it is executed directly
  3. It makes the file executable without chmod
  4. It loads ~/.bashrc before the script runs
62Лёгкий
What does this print?
name=World
echo 'Hello $name'
  1. Hello World
  2. Hello
  3. Hello 'World'
  4. Hello $name
63Средний
This script, args.sh, is called as ./args.sh a "b c" d. What is the first line it prints?
echo "$#"
for a in "$@"; do echo "[$a]"; done
  1. 4
  2. 3
  3. 1
  4. a
64Средний
Why does this line fail with "x: command not found"?
x = 5
  1. Variable names must be upper-case in bash
  2. Numbers must be quoted: x = "5"
  3. Variables must be declared with let or var first
  4. Assignments must not have spaces around =, so bash runs a command named x with arguments = and 5
65Сложный
The directory contains two files: b.txt and "my data.txt". What does this loop print?
for f in $(ls); do
  echo "[$f]"
done
  1. [b.txt]
    [my]
    [data.txt]
  2. [b.txt]
    [my data.txt]
  3. [my data.txt]
    [b.txt]
  4. [b.txt my data.txt]
66Лёгкий
What does $(date +%F) do inside this command?
echo "run_$(date +%F).log"
  1. Inserts the literal text date +%F
  2. Reads a variable named date
  3. Runs date +%F and inserts its output, e.g. run_2024-05-17.log
  4. Starts date in the background
67Лёгкий
What does this loop print?
for i in {1..3}; do
  echo "step $i"
done
  1. step 1, step 2 and step 3 on separate lines
  2. step {1..3}
  3. step 1..3
  4. step 3
68Средний
What is the effect of set -e at the top of a bash script?
set -e
cp input.dat work/
./process work/input.dat
  1. Every command is printed before it runs
  2. Errors are suppressed and the script always continues
  3. Unset variables are treated as errors
  4. The script exits as soon as a command fails, so ./process does not run if cp fails
69Средний
What happens when this script runs in a directory containing a file called "my data.txt"?
file="my data.txt"
rm $file
  1. "my data.txt" is removed
  2. rm tries to remove two files, "my" and "data.txt", and fails for both
  3. rm removes every file in the directory
  4. Bash reports a syntax error at the space
70Сложный
In an empty directory, this test is run. What happens?
[ 9 > 10 ] && echo true
  1. It prints nothing, because 9 is not greater than 10
  2. It prints true, because 9 > 10 is compared as text
  3. Bash reports "integer expression expected"
  4. It prints true and creates an empty file named 10
Environment10
71Лёгкий
What is the PATH environment variable used for?
  1. It stores the current working directory
  2. It lists the directories that are backed up
  3. It is a colon-separated list of directories the shell searches for commands
  4. It holds the full path of the running script
72Лёгкий
Which command shows the full path of the python executable that would run when you type python?
  1. pwd python
  2. find python
  3. which python
  4. echo python
73Средний
What do the two bash -c commands print?
x=5
bash -c 'echo "[$x]"'
export x
bash -c 'echo "[$x]"'
  1. [] and then [5]
  2. [5] and then [5]
  3. [] and then []
  4. [$x] and then [5]
74Средний
You installed tools into ~/bin and want them found in every new terminal, while keeping all system commands. What should you add to ~/.bashrc?
  1. export PATH="$HOME/bin"
  2. PATH=$HOME/bin:PATH
  3. alias PATH="$HOME/bin"
  4. export PATH="$HOME/bin:$PATH"
75Сложный
setenv.sh contains the single line export X=1. Why does the second echo print [1] but the first one []?
bash setenv.sh
echo "[$X]"
source setenv.sh
echo "[$X]"
  1. export only takes effect after the second run of a script
  2. bash runs the script in a child process whose variables vanish when it exits; source runs it in the current shell
  3. The first run fails because the script is not executable
  4. echo caches variables and only refreshes them after source
76Лёгкий
What does export do in this line?
export OMP_NUM_THREADS=8
  1. Writes the variable permanently to ~/.bashrc
  2. Sets the variable and marks it so that programs started from this shell inherit it
  3. Makes the variable read-only
  4. Sends the variable to all other open terminals
77Лёгкий
You type ls -lh --color so often that you want to type just ll. What creates this shortcut?
  1. export ll='ls -lh --color'
  2. ll='ls -lh --color'
  3. alias ll='ls -lh --color'
  4. ln -s 'ls -lh --color' ll
78Средний
Why might type ls give a more useful answer than which ls?
  1. type also reports aliases, functions and shell builtins, which which (a separate program searching PATH) cannot see
  2. type also searches the internet for the command
  3. which works only for root
  4. type prints the man page of the command
79Сложный
What do these two lines print (with HOME=/home/ana)?
echo "~/data"
echo ~/data
  1. ~/data and then /home/ana/data
  2. /home/ana/data twice
  3. ~/data twice
  4. /home/ana/data and then ~/data
80Сложный
You added an alias to ~/.bashrc, but it is missing when you log in to a server over ssh, while it works in new terminal windows on your desktop. What is the likely reason?
  1. Aliases never work over ssh
  2. The server ignores all files starting with a dot
  3. ssh starts a login shell, which reads ~/.bash_profile (or ~/.profile) instead of ~/.bashrc, and that file does not source ~/.bashrc
  4. ssh reads ~/.bashrc only after a reboot
Archives and transfer10
81Лёгкий
You received results.tar.gz. Which command extracts it into the current directory?
  1. tar czf results.tar.gz
  2. tar tzf results.tar.gz
  3. gzip results.tar.gz
  4. tar xzf results.tar.gz
82Лёгкий
What is left in the directory after running this command?
gzip data.csv
  1. Both data.csv and data.csv.gz
  2. Only data.csv.gz; the original data.csv is replaced
  3. Only data.csv, compressed in place under the same name
  4. data.csv and a folder data.csv.gz/
83Средний
How do you copy the local file input.dat to the directory /scratch/ana on the cluster login.hpc.example.org, logging in as ana?
  1. scp ana@login.hpc.example.org input.dat /scratch/ana/
  2. ssh input.dat ana@login.hpc.example.org:/scratch/ana/
  3. scp input.dat ana@login.hpc.example.org:/scratch/ana/
  4. scp input.dat /scratch/ana/@login.hpc.example.org
84Средний
Which command lists the files inside archive.tar.gz without extracting anything?
  1. tar tzf archive.tar.gz
  2. tar xzf archive.tar.gz --list-only
  3. gunzip archive.tar.gz
  4. ls archive.tar.gz
85Сложный
What is the difference between these two rsync commands?
rsync -av data/ backup/
rsync -av data  backup/
  1. The first copies the contents of data into backup/; the second creates backup/data/ and copies into it
  2. There is no difference; the trailing slash is ignored
  3. The first deletes files in backup that are not in data, the second does not
  4. The first copies only the top-level files, the second copies recursively
86Лёгкий
Which command packs the folder figures with all its contents into figures.zip?
  1. zip figures figures.zip
  2. zip -r figures.zip figures
  3. unzip -r figures.zip figures
  4. gzip -r figures
87Лёгкий
What does this command do?
ssh ana@login.hpc.example.org 'squeue -u ana'
  1. Opens an interactive shell and types the command later
  2. Copies the program squeue to the remote host
  3. Runs squeue locally using the remote user ana
  4. Logs in to the remote host as ana, runs squeue -u ana there, prints the result and returns
88Средний
You run curl https://example.org/data.csv and the whole file scrolls past on the screen. How do you save it as data.csv instead?
  1. curl -v https://example.org/data.csv
  2. curl -O https://example.org/data.csv
  3. curl -I https://example.org/data.csv
  4. curl https://example.org/data.csv | less
89Средний
You want to extract data.tar.gz into the existing directory /scratch/ana/input instead of the current directory. Which command does this?
  1. tar xzf data.tar.gz /scratch/ana/input
  2. tar czf /scratch/ana/input data.tar.gz
  3. tar xzf data.tar.gz > /scratch/ana/input
  4. tar xzf data.tar.gz -C /scratch/ana/input
90Сложный
Why is --delete in this backup command dangerous if you mix up the two paths?
rsync -av --delete results/ /backup/results/
  1. rsync deletes files in the destination that do not exist in the source, so with the paths swapped your newer working files are removed
  2. --delete deletes the source files after copying them
  3. --delete empties the destination before copying
  4. --delete removes the files on both sides that differ
System and disk10
91Лёгкий
Which command shows how much space is used and free on each mounted filesystem, in units like G and M?
  1. du -h
  2. free -h
  3. df -h
  4. ls -lh /
92Лёгкий
Which command prints the kernel name, release and machine architecture of the current system?
  1. whoami
  2. uname -a
  3. hostname -i
  4. df -a
93Средний
You do not remember the name of the command that compares files, but you know the word "compare". How do you search the manual pages by keyword?
  1. man compare
  2. help compare
  3. which compare
  4. man -k compare
94Средний
Your home directory is nearly full. Which command shows the total size of each file and folder in it, in human-readable units?
cd ~
  1. df -h *
  2. du -sh *
  3. ls -s
  4. du -a
95Сложный
Why does this command fail with "Permission denied", and what works instead?
sudo echo 'vm.swappiness=10' > /etc/sysctl.d/99-swap.conf
  1. sudo cannot run echo; use sudo printf instead
  2. The file must be created first with touch, then the same command works
  3. You must quote the whole command: sudo "echo ... > file"
  4. The redirection is done by your own shell, not by sudo; use echo 'vm.swappiness=10' | sudo tee /etc/sysctl.d/99-swap.conf
96Лёгкий
Which command shows how much RAM and swap is total, used and available, in human-readable units?
  1. df -h
  2. du -h
  3. free -h
  4. uname -m
97Лёгкий
On Ubuntu, how do you install the gnuplot package from the distribution repositories?
  1. sudo dnf install gnuplot
  2. gnuplot --install
  3. sudo apt install gnuplot
  4. sudo apt remove gnuplot
98Средний
man crontab describes the crontab command. How do you open the page describing the crontab FILE FORMAT instead?
  1. man 5 crontab
  2. man -5 crontab
  3. man crontab.5
  4. help crontab
99Средний
Why do downloaded binaries often come in versions labelled x86_64 and aarch64, and how do you check which one you need?
  1. They are for different Linux distributions; cat /etc/hostname tells you which
  2. They are 32-bit and 64-bit builds of the same architecture; free -h tells you which
  3. They are debug and release builds; any of them runs everywhere
  4. They are built for different CPU architectures; uname -m prints the one of your machine
100Сложный
df -h says the disk is 100% full, but du -sh on every directory adds up to much less. What is a common cause?
  1. du counts only files smaller than 1 GB
  2. A process still has a deleted file open; its space is freed only when the process closes it or exits
  3. df reports in powers of 10 and du in powers of 2, so they differ by 50%
  4. du ignores files that you have not opened recently

Как проходить тест

  • Выберите темы и уровень — лёгкий уровень проверяет определения и задачи в одно действие, средний — стандартные вычисления, сложный — многошаговые задачи и теорию.
  • Отвечайте касанием или с клавиатуры: 1–4 или A–D, Enter — следующий вопрос.
  • Читайте объяснения — после ошибки разбор открывается сразу, после верного ответа его можно раскрыть кнопкой «Почему».
  • Работайте над ошибками — «Повторить ошибки» в конце теста или режим «Только мои ошибки» потом: ответы запоминаются в этом браузере.

Незавершённый тест сохраняется — после перезагрузки страницы можно продолжить с того же вопроса.

Темы теста

  • Files and directories 10
  • Permissions 10
  • Viewing and searching 10
  • Pipes and redirection 10
  • Text processing 10
  • Processes and jobs 10
  • Shell scripting 10
  • Environment 10
  • Archives and transfer 10
  • System and disk 10