Input/Output Redirections

0.0(0)
studied byStudied by 0 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/24

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

25 Terms

1
New cards

Cat Command

This command is used to concatenate or join files.

2
New cards

cat catfile.txt -n

The -n option tells cat to number all output lines.

3
New cards

> operator

used to redirect output to the new standard output.

4
New cards

> > operator

appends to the file exists or else creates it as a new file and writes the data.

5
New cards

head

useful to see a few lines of a file, typically the first few lines.

6
New cards

10 lines

default of head command

7
New cards

head -3 name.txt

Show the first 3 lines of text in name.txt

8
New cards

head -c10 name.txt

Show the first 10 characters of the name.text

9
New cards

tail

used to show the last few lines of a file.

10
New cards

tail -3 name.txt

show the last 3 in the name.txt file

11
New cards

tail -3 name.txt

Displays the last 3 lines of the name.txt

12
New cards

tail -n4 name.txt

Displays the last 4 lines of the name.txt file

13
New cards

tail -c10 name.txt

Displays the last 10 bytes (characters) of the name.txt file

14
New cards

sort

used to sort the contents of the file and display the sorted list on the standard output (screen).

15
New cards

sort name.txt

Sort the file name.txt in ascending

16
New cards

sort -r name.txt

Sort the name.txt file in Descending

17
New cards

WC Command

stands word count is used to find the number of characters, the number of words, and number of lines in a file.

18
New cards

wc -w file1.txt

Counts the number of Words in the file1.txt

19
New cards

wc -c file1.txt

Counts the number of Characters (bytes) in the file1.txt

20
New cards

wc -l file1.txt

Counts the number of Lines in the file1.txt

21
New cards

grep

one of the most powerful commands in Linux. It matches the given pattern with each line of the file and displays all lines that match the pattern.

22
New cards

grep hope lines.txt

Show the lines that has character pattern hope from the lines.txt and verify the output.

23
New cards

grep lie lines.txt

Show the lines that has character pattern character lie from the lines.txt and verify the output.

24
New cards

pr

used to convert a text file for printing.

25
New cards

pr -3 lines.txt

Show the print preview of lines.txt and names.txt in 3 columns respectively.

Explore top flashcards

Endocrine System
Updated 317d ago
flashcards Flashcards (87)
TODOS LOS VERBOS
Updated 560d ago
flashcards Flashcards (204)
las asignaturas
Updated 1023d ago
flashcards Flashcards (20)
English Vocab pt.2
Updated 935d ago
flashcards Flashcards (30)
Ap lit
Updated 112d ago
flashcards Flashcards (66)
Endocrine System
Updated 317d ago
flashcards Flashcards (87)
TODOS LOS VERBOS
Updated 560d ago
flashcards Flashcards (204)
las asignaturas
Updated 1023d ago
flashcards Flashcards (20)
English Vocab pt.2
Updated 935d ago
flashcards Flashcards (30)
Ap lit
Updated 112d ago
flashcards Flashcards (66)