CH10 : Working with file content Flashcards

1
Q

head

A

You can use head to display the first ten lines of a file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

head -4 /etc/passwd

displays

A

dislplays the first n line of a component

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

head can also display the first n bytes.

A

root:x:0:0:roopaul@debian7~$

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

tail

A

display the last ten lines of a file.

u can give tail the number of lines you want to see.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

cat

A

The cat command is one of the most universal tools

yet all it does is copy standard input to standard output

you can use cat to display a file on the screen
If the file is longer than the screen, it will scroll to the end.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

cat is short for

A

concatenate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Cat - create files

A

You can use cat to create flat text files.

$ cat > winter.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

here directive

A

You can choose an end marker for cat with &laquo_space;as is shown in this screenshot. This construction is called a here directive and will end the cat command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Cat - copy files

A

cat file1 > file2
coping the content of file1 to file2

viewing file2 conent
$cat file2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

tac

A

reverse the file content

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

more and less

A

he more command is useful for displaying files that take up more than one screen.

More will allow you to see the contents of the file page by page. Use the space bar to see the next page, or q to quit.
Some people prefer the less command to more.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

strings

A

With the strings command you can display readable ascii strings found in (binary) files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly