Linux Commands Walkthrough Quiz
10 Questions
2 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the purpose of the command 'awk -F',' '{print $1"-"$2}' file.csv'?

  • Move fields from file.csv to another location
  • Copy fields from file.csv to another file
  • Concatenate fields in the second column of file.csv
  • Add a delimiter between fields in the second column of file.csv (correct)

Which command is useful for combining datasets with matching records, especially when the records are sorted?

  • join (correct)
  • cat
  • paste
  • cp

What does the '-d' option in the 'paste -d',' file1.txt file2.txt' command do?

  • Delete files after pasting
  • Define the number of lines to be pasted
  • Specify a different delimiter for merging lines horizontally (correct)
  • Duplicate the files after pasting

What is the primary function of the 'cat' command in Unix/Linux?

<p>Concatenate and display contents of files (B)</p> Signup and view all the answers

Which command is appropriate for copying files and directories from one location to another?

<p>cp (A)</p> Signup and view all the answers

What does the 'grep' command with the '-n' option do?

<p>Print line number in a file (C)</p> Signup and view all the answers

In the 'sed' command, what does 'sed 's/old/new' file.txt' do?

<p>Replaces 'old' with 'new' in file.txt (C)</p> Signup and view all the answers

What is the purpose of the 'awk' command with '{print $1}'?

<p>Print specific fields from a file (C)</p> Signup and view all the answers

When using 'grep -l "pattern" *.txt', what does it do?

<p>Print only file names containing matches (D)</p> Signup and view all the answers

What is the purpose of 'sed '#,#d' filename.txt' command?

<p>Delete lines within a range in the filename.txt (C)</p> Signup and view all the answers
Use Quizgecko on...
Browser
Browser