Buscar
Estás en modo de exploración. debe iniciar sesión para usar MEMORY

   Inicia sesión para empezar

level: UNIX2

Questions and Answers List

level questions: UNIX2

QuestionAnswer
file viewingmore - less advanced less - more advanced
displays the first 10 lines of filehead file_name
displays last 10 lines of filetail file_name
variable that defines the default editorEDITOR
displays currently working directorypwd
long listing displays rights, owners etcls -l
changes directory to most recent one changes directory to homecd - cd ~
updates file timestamps if file does not exist it is createdtouch file_name
creates multilevel directorymkdir -p sub1/sub2/sub3
creates a symlinkln -s source_file symbolic_link
removes file removes non empty directory removes empty directoryrm file_name rm -R dir_name rmdir dir_name
command used to transfer files and dierctories to local or remote destinationsrsync [options] SOURCE DESTINATION
compares files line by line displays results side by sidediff 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 changespatch old_file new_file.patch
compressing files decompressing filesgzip 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 argumentstarball 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 themfin [where to look for] [conditions while looking for] [what to do]
What is a streamcommuncation channel for transfering ordered bytes
overwrites somefile with output overwrites somefile with output and errorls > somefile ls &> somefile ls > & somefile
appends output to somefile appends output and errors to some filels >> somefile ls &>> somefile
gets input frome some file content of somefile will be displayedls < somefile
What standard streams are there?stdin (0) stdout (1) stderr (2)
redirection to stderr and stdout2>&1 or: >&
redirecting to "black hole" file>/dev/null
redirecting to /dev/null and ignoring stderr2>/dev/null
what are filtersfilters are commands that take input from stdin if there are no filenames given examples: sort, grep
what are pipespipes 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, characterswc [-l|-w|-c] filename can be used in pipelining example: env | wc -l
sortingsort filename can be used in pipelining example: env | sort
what is generic regular expression parsergrep 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