20250421 Flashcards
What is a job on Linux?
A job is simply the shell’s unit of work. The jobs are at a higher level than Linux processes - the Linux OS knows nothing about them. They are merely constructs of the shell
How to ask a command to run in the background?
Place &
after the command.
How to suspend the current foreground job?
^z
- It simply stops running, but its state is remembered.
How to unsuspend a jobs or bring it to the foreground?
fg %1
What does bg %2
do?
Make a suspended job (job No.2) run in the background
- with no argument, bg
operates on the most recently suspended job.
What does yes
command do?
Continiously prints y
untill you kill it.
What is dev/null
?
dev/null
is a special file in Unix/Linux systems - often called the bit bucket or
black hole
- It is a special device file that discards anything written to it. If a program writes output to
/dev/null, it's effectively silenced.
- If you try to read from it, it gives you no data.
- It ignores
standard output or
standard error’ of the command.
How to terminate a shell?
Type exit
or press ^D
What is .bashrc
?
Commands in .bashrc
run every time you launch an interactive shell
What is .bash_logout
Commands in it run each time you log out.
If the output of a command is longer than screen, how to use less
?
man wc | less