UNIX Basics 2 Flashcards

1
Q

What does the date command do?

A

Displays the current date and time

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

What does the cal command do?

A

The calendar command displays the current month.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
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
4
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
5
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
6
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
7
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
8
Q

What does the 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
9
Q

What does the&raquo_space; vs the > do?

A

> prints the output into a file, while&raquo_space; appends the output into a file.

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

What is a pipe?

A

This will bring unix commands together.

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

What does date +%Y-%m-%d print?

A

2024-11-23

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
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
13
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
14
Q

What does cal -n numberOfMonths print?

A

The first month plus however many months.

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

What does cal -w print?

A

Displays the week number.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
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
17
Q

What does du COP3363 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
18
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
19
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
20
Q

What does du -a do?

A

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

21
Q

What does du -c print?

A

Prints a grand total for each file.

22
Q

What was head -n __ print?

A

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

23
Q

What does head -c __ print?

A

Prints the first blank number of bytes.

24
Q

Does tail share the same options meanings?

A

Yes!

25
Q

What does tail -h print?

A

Watches for changes in the file (for logging).

26
Q

What does the cut -c print?

A

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

27
Q

What does cut -b print?

A

Cuts by bytes instead of characters.

28
Q

What does cut -f fieldNumbers -d delimiters print?

A

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

29
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.

30
Q

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

A

Changes the output delimiter from space to the given delimiter

31
Q

What does sort -r fileName print?

A

Sorts in reverse order.

32
Q

What does sort -n fileName print?

A

Sorts numerical content as numbers instead of lexicographical order.

33
Q

What does Dort -f fileName print?

A

Ignores the case while sorting.

34
Q

What does sore -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.

35
Q

What does sort -u fileName print?

A

Sorts the file contents and removes the duplicates.

36
Q

What does tar -c print?

A

insert files into a tar file?

37
Q

What does tar -f print?

A

Uses the name of the tar file that is specified.

38
Q

What does tar -v print?

A

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

39
Q

What does tar -x print?

A

Extracts the files from a tar file.

40
Q

What does tar -t print?

A

Lists contents of an archive.

41
Q

What does tar -z print?

A

gzip/gunzip if necessary.

42
Q

What does the diff -b print?

A

Treat groups of spaces as one.

43
Q

What does diff -i print?

A

ignores case

44
Q

What does tar -r print?

A

Includes directories in comparison.

45
Q

What does diff -w do?

A

Ignores all spaces and tabs.

46
Q

What does grep -i do?

A

Ignores case.

47
Q

what does grep -n print?

A

Displays line numbers.

48
Q

What does grep -l print?

A

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

49
Q

What does grep -P do?

A

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