Monday, May 15, 2017

Linux Interview Questions

Linux Interview Questions

What is awk?
awk (also written as Awk and AWK) is a utility that enables a programmer to write tiny but effective programs in the form of statements that define text patterns that are to be searched for in each line of a document and the action that is to be taken when a match is found within a line.
What is SED?
sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file, or input from a pipeline). ... But it is sed's ability to filter text in a pipeline which particularly distinguishes it from other types of editors.
Stream EDitor is used to perform basic transformations on text read from a file or a pipe. The result is sent to standard output. The syntax for the sed command has no output file specification, but results can be saved to a file using output redirection.
What is the use of cat command in Unix?
UNIX Basic commands: cat. The cat command reads one or more files and prints them to standard output. The operator > can be used to combine multiple files into one. The operator >> can be used to append to an existing file.
#cat proc/cpuinfo //gives the cpu info or  
#dmidecode also gives the cpu info
#cat proc/meminfo //gives the mem info
What is the grep?
grep is a command-line utility for searching plain-text data sets for lines matching a regular expression. Its name comes from the ed command g/re/p (globally search a regular expression and print), which has the same effect: doing a global search with the regular expression and printing all matching lines.
Diff between find and grep?
grep is used to search for string in a file
find is used to searche files or directories

No comments: