UNIX
🇬🇧
In English
In English
Practice Known Questions
Stay up to date with your due questions
Complete 5 questions to enable practice
Exams
Exam: Test your skills
Test your skills in exam mode
Learn New Questions
Manual Mode [BETA]
Select your own question and answer types
Specific modes
Learn with flashcards
Complete the sentence
Listening & SpellingSpelling: Type what you hear
multiple choiceMultiple choice mode
SpeakingAnswer with voice
Speaking & ListeningPractice pronunciation
TypingTyping only mode
UNIX - Leaderboard
UNIX - Details
Levels:
Questions:
213 questions
🇬🇧 | 🇬🇧 |
Querying other users by name | Id (username) |
Querying other users by name | Id (username |
Querying other users by name | Id (username |
Gives info on what command does | Whatis file_name |
Querying other users by name | Id (username |
Gives info about type of file | File file_name |
Querying other users by name | Id (username |
Proposes commands | Apropos |
Shows where command is installed | Which command_name |
Makes directory | Mkdir dir_name |
Creates file that doesnt exist or updates file's date | Touch file_name |
Copies file to new file | Cp old_file copy_of_file |
Rename file | Mv old_name new_name |
Removes file | Rm file_name |
Removes directory | Rm -r dir_name |
Removes empty directories | Rmdir dir_name |
Reads from file reads from file and enumerates lines fills file with content/ creates file concatenates files | Cat file_name cat -n file_name cat >> file_name cat file_1 file_2 |
Shows what is in the file | Less- more advanced more- less advanced LOGICAL XD |
Changing prompt | PS1="new_prompt" |
Clears current bash session history | History -c |
Clears history file, fills history file with emptiness | Echo -n > .bash history |
Combines two commands | ; cd ; pwd- changes to home dir and prints working dir |
Absolute path relative path | /somepath --------------- ./somepath somepath |
Preserve literal meaning of all enclosed characters preserve literal meaning of all except: $ \ ` | ' ' " " |
Setting variable acccessing variable | SOMEVAR ="sth" echo $SOMEVAR echo ${SOMEVAR} |
Unsetting variable | Unset SOMEVAR |
Exporting variables to enviroment | Export VARIABLE |
Selecting manual sections | Man 1 kill displays first section of man of kill command don't specify parenthesis for functions |
What is SSH | Secure shell protocol enables two computers to commmunicate safely, it is encrypted closing terminal results in killing all processes in current session |
Connecting via ssh | Ssh [username@]hostname[.domainname] |
What is GNU screen utility | Terminal multiplexer, by starting a screen session one can open many virtual terminals, processes runnning in screen will run even after disconnecting |
Makes a copy of everything that is printed on terminal and saves it into the ./typescript file | Script-starts a script exit-ends script cat ./typescript- access to file |
Displays date | Date |
Hardware information | Lscpu lspci lsusb |
Displays information on total and free memory | Free free -h -human readable version |
Querying other users by name | Id username |
User information lookup program | Finger username |
Sends a message to user speccifying the terminal is necessary only if user is logged more than once enables/disables incoming messages | Write username [terminal] mesg [y|n] |
File viewing | More - less advanced less - more advanced |
Displays the first 10 lines of file | Head file_name |
Displays last 10 lines of file | Tail file_name |
Updates file timestamps if file does not exist it is created | Touch file_name |
Creates multilevel directory | Mkdir -p sub1/sub2/sub3 |
Creates a symlink | Ln -s source_file symbolic_link |
Removes file removes non empty directory removes empty directory | Rm file_name rm -R dir_name rmdir dir_name |
Command used to transfer files and dierctories to local or remote destinations | Rsync [options] SOURCE DESTINATION |
Compares files line by line displays results side by side | Diff old_file new_file > file_patch diff -y Symbols: < lines missing in first > lines missing in second | lines that differ |
Reads the changes that need to be applied from source file and then applies the changes | Patch old_file new_file.patch |
Compressing files decompressing files | Gzip file_name gunzip file_name.gz bzip2 file_name bunzip2 file_name.bz2 xz file_name unxz file_name.xz |
Creates a single file that is a concatenation of files given as arguments | Tarball creation: tar -cvf tarball.tar file_1 file_2 tarball extraction: tar -xvf tarball.tar -c create -x extract -v verbose mode -f specifies name leaves source files untouched doesnt create extention .tar auomatically |
Finding files and performing operations on them | Fin [where to look for] [conditions while looking for] [what to do] |
What is a stream | Communcation channel for transfering ordered bytes |
Overwrites somefile with output overwrites somefile with output and error | Ls > somefile ls &> somefile ls > & somefile |
Appends output to somefile appends output and errors to some file | Ls >> somefile ls &>> somefile |
What standard streams are there? | Stdin (0) stdout (1) stderr (2) |
Redirection to stderr and stdout | 2>&1 or: >& |
Redirecting to "black hole" file | >/dev/null |
Redirecting to /dev/null and ignoring stderr | 2>/dev/null |
What are filters | Filters are commands that take input from stdin if there are no filenames given examples: sort, grep |
What are pipes | Pipes allow for redirecting stdout of one command to stdin of another symbol: | if second command is a filter it processes stdout of preceding command |
How to perform command substitution | `command` content is replaced with stdout of the command example: echo my name is `whoami` my name is hania |
Counting lines, words, characters | Wc [-l|-w|-c] filename can be used in pipelining example: env | wc -l |
Sorting | Sort filename can be used in pipelining example: env | sort |
What is generic regular expression parser | Grep is used for searching and extracting lines form file that match some regular expression grep [options] patter file_name popular options: -i -ignore case -v -invert selection zgrep allows for grepping over compressed files |
What is i-node? | I-node is a structer that stores all information about file except its name and data. Information is stored in numerical value |
Displays information on a file stored in its i-node | Stat file_name |
What are block devices? | File type that refers to mass storage devices Allow for random buffered access to devices lsblk -lists block devices |
What are character devices? | File type that refers to both pysical devices and system byte generators Allow for sequential unbuffered access to devices |
What are hidden files? | Files that start with a dot rm command skips hidden caracters, hence * wildcard doesnt work .* must be used |
How to protect directory from removing it by accident? | Put there hidden file |
Displays directory content size recursively | Du -sh h stand for human readable, particular files are distinguished note that it includes hidden files |
Lists all files that are open | Lsof lsof somefile -displays information on selected file |
Copies count block of the bs size from if to the of file | Dd if=input_file of=output_file count=how_many bs=block_size |
What is disk partitioning in linux? | It enables to split hard drive into separate sections that act independently |
Command for partiton management | Fdisk it requires root privileges |
BSD terminology slice partitions | Fdisk partition logical disks |
Command used to create file system | Mkfs [-t type] device mkfs.type device |