Unix Commands Extended Flashcards

1
Q

What does the du command do?

A

Prints the number of disk blocks -512 byte units, being used by the contents of the current directory.

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

What does the sort command do?

A

Sorts the input according to the given option.

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

What does the cut command do?

A

Extracts columns out of text files.

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

What does the tar command do?

A

Bundles files into an archive.

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

What does the diff command do?

A

Finds the differences between 2 files.

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

What does grep command do?

A

Search for information using regular expressions.

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

What does date +%j print?

A

The number of days since January 1st.

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

What does date +%s print?

A

The Unix timestamp.

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

What does cal -j print?

A

Displaying the day numbers.

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

What does du name print?

A

Prints the disk usage of the entered directory.

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

What does du -h print?

A

Prints the disk usage in human readable form.

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

What does du -s print?

A

Prints a grand summary of the disk space used.

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

What does du -a do?

A

Prints the disk usage of all files and subdirectories in the current directory.

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

What does du -c print?

A

Prints a grand total for each file.

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

What was head -n _ print?

A

Prints the first blank number of lines instead of the first ten.

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

What does head -c _ print?

A

Prints the first blank number of bytes.

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

What does tail -h print?

A

Watches for changes in the file (for logging).

18
Q

What does the cut -c print?

A

Cuts each line of the file from start position to end position.

19
Q

What does cut -b print?

A

Cuts by bytes instead of characters.

20
Q

What does cut -f fieldNumbers -d delimiters print?

A

Separates the lines into fields based off the delimiters then prints the significant fields.

21
Q

What does cut [options] –complement filename print?

A

Prints the complement - the parts of the files that would have been left out in the original cut command.

22
Q

What does cut [options] –output-delimiter new di filename print?

A

Changes the output delimiter from space to the given delimiter.

23
Q

What does sort -r fileName print?

A

Sorts in reverse order.

24
Q

What does sort -n fileName print?

A

Sorts numerical content as numbers instead of lexicographical order.

25
Q

What does sort -f fileName print?

A

Ignores the case while sorting.

26
Q

What does sort -c fileName print?

A

Checks if a file is already sorted. Prints the lines that are not in order. The file is already sorted if there is no output.

27
Q

What does sort -u fileName print?

A

Sorts the file contents and removes the duplicates.

28
Q

What does tar -c print?

A

Insert files into a tar file?

29
Q

What does tar -f print?

A

Uses the name of the tar file that is specified.

30
Q

What does tar -v print?

A

Outputs the name of each file as it is inserted into or extracted from a tar file.

31
Q

What does tar -x print?

A

Extracts the files from a tar file.

32
Q

What does tar -t print?

A

Lists contents of an archive.

33
Q

What does tar -z print?

A

gzip/gunzip if necessary.

34
Q

What does the diff -b print?

A

Treat groups of spaces as one.

35
Q

What does diff -i print?

A

Ignores case.

36
Q

What does tar -r print?

A

Includes directories in comparison.

37
Q

What does diff -w do?

A

Ignores all spaces and tabs.

38
Q

What does grep -i do?

A

Ignores case.

39
Q

What does grep -n print?

A

Displays line numbers.

40
Q

What does grep -I print?

A

Displays only the names of the files and note the actual lines.

41
Q

What does grep -P do?

A

Pattern is a Perl regular expression, not a Unix regular expression.