Exam 2 Flashcards

(99 cards)

1
Q

Absolute pathname

A

Absolute pathname: refers to the complete path of a directory or file starting from the root directory (/). It
specifies the exact location of the directory or file in the filesystem hierarchy.
For example, /home/user/documents/file.txt is an absolute pathname. It starts from the root directory
(/) and specifies the complete path to the file file.txt

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

Relative pathname

A

specifies the location of a directory or file relative to the current working directory.

. (dot) represents the current directory.

.. (dot-dot) represents the parent directory.

~ (the tilde character) is a shorthand representation of the current user’s home directory.

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

!

A

not

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

$

A

Following string is a variable (should be all CAPS)

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

;

A

chains commands together

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

&

A

if one command errors. The next command will not run

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

`` backquote

A

substitutes whatever command is on the inside with its output

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

‘ ’ single quote

A

protects everything

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

“ ” double quotes

A

protects most things except \ = protects everything

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

*

A

represents unknown 0-255 char

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

?

A

represents only 1 char

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

[]

A

represents only 1 char and can contain numbers and a range of numbers and char and a range of char

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

[! ]

A

represents only 1 char and searches for anything not including the range/char/number indicated

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

apropos

A

search with a keyword
same as man -k command

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

cal

A

display current month’s calendar

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

option for calendar year

A

-y

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

cal -3

A

calendar for 3 months: previous, current, next

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

cd

A

change directory with an absolute or relative pathname

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

clear

A

clear the screen

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

date

A

display/change the system date and time

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

echo

A

display or echo output to the terminal screen

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

echo -e

A

utilize escape sequence

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

echo -n

A

newline

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

file

A

determine file type and display the detail information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How do you format the date time to show... Today is dayName, monthName DAY YEAR
date +“Today is %A, %B %d %Y”
26
ls
list contents of a directory
27
ls -l
use long listing format
28
ls -a
shows all files including hidden files
29
ls -F
shows files with type indicator
30
ls -R
lists subdirectories recursively
31
ls -r
reverse order when sorting
32
ls -d
lists directory names instead of contents
33
ls -S
sort by file size
34
ls -i
prints the index number of each file
35
man
display online manual pages
36
man -k
search for keyword
37
mkdir
create the new directory
38
mkdir -p
create a hierarchy directory
39
move files or rename files
mv
40
mv -i
prompt if file move/rename will overwrite a file
41
pwd
display the working directory with the absolute pathname
42
rm
remove files or “non-empty” directory
43
rmdir
remove the “empty” directory
44
create a new file or multiple files as well as change time stamp
touch
45
whatis
searches the what is database for complete words
46
display the number and Status of Users Logged In
who
47
displays who you are
whoami
48
remove the directories with files
rm –r
49
rm -f
enforce
50
Redirect operator "<"
"<" input redirection. receive input from a file instead of the keyboard
51
Redirect operator ">"
redirect the standard output of a command to a file. If the file does not exist, it will be created. If the file already exists, its contents will be overwritten.
52
Redirect operator ">>"
append the standard output of a command to a file. If the file does not exist, it will be created. If the file already exists, the output will be added to the end of the file.
53
Redirect operator "|"
"|" pipe symbol, is used to connect the output of one command to the input of another. It allows you to chain multiple commands together, forming a pipeline. For example, you can use command1 | command2 to pass the output of "command1" as the input to "command2".
54
cat
concatenate and display the contents of files. It's often used to read files sequentially, display their content, combine multiple files, create new files, and append contents to existing files.
55
cat file1
display the contents of the file1
56
cat > newfile
create a new file and manual entry the contents for the ‘newfile’
57
cat file1 > file2
copy the contents of file1 to create a file2
58
cat file1 file2
combine file1 and file2 one after the other on the screen
59
cat file1 file2 > file3
combine file1 and file2 one after the other and save the result to the file3 instead of displaying on the screen
60
`cat file1 >> file2`
append contents of file1 to file2
61
cmp
compare two files byte by byte. It’s often used to check if two files are identical or to find differences between them `cmp [option] file1 file2`
62
comm
compare two sorted files line by line. Outputs three columns. 1. lines unique to file1 (suppress with -1) 2. lines unique to file2 (suppress with -2) 3. files common to both (suppress with -3) `comm [options] file1 file2;`
63
copy Files or directories
cp
64
cut
extract sections from a file or input. Useful for selecting columns from text files like CSV files `cut -f 2 -d ':' file1 > file2` -f: Specifies the field(s) to extract ( -f1,3 extracts fields 1 and 3). -d: Specifies the delimiter to use (default is the tab character). -c: Extracts characters by position (e.g., -c1-5 extracts characters 1 to 5 of each line).
65
diff
compare the contents of two files line by line. Showing the differences.
66
find
search for files and directories within a specified path. locates files based on various criteria such as filename, size, permissions, modification time, and more. `find `
67
search for specific strings within files
grep
68
head
display the beginning or the first few lines of a file. By default, it prints the first 10 lines of each specified file to the standard output.
69
head -n
display the beginning specified lines of a file
70
join
joining lines of two files on a common field
71
use to page through files; similar to more
less
72
create links between files links are references or pointers to the original file hard links and symbolic link
ln
73
ln -s
Creates a symbolic (soft) link
74
`ln -f`
Forces the creation of the link by overwriting an existing link with the same name.
75
show what links are being created
ln -v
76
Prompts before overwriting an existing link.
ln -i
77
view files a screen at a time
motr
78
mv -f
enforce
79
od
display the contents of files in various formats, such as octal or hexadecimal.
80
paste
merge lines horizontally (side by side) of files, separated by a specified delimiter (by default, a tab). `paste [options][file ...].`
81
pr
format text files for printing. Headers, divide text into columns, set custom margins, add page numbers, and adjust the layout to make printed output more readable.
82
Sets the number of columns (e.g., -2 for two columns).
pr -n
83
pr -d
Double-spaces the output.
84
pr -l N
Specifies the number of lines per page (default is 66).
85
pr -w N
Sets the width of the output in characters (default is 72).
86
rm -i
rm -i
87
sed (stream editor)
text transformations on an input stream. Used for search, replace, substitute text.
88
sorts the text file by line
sort
89
extract printable strings from binary files
strings
90
concatenate and display the contents of files in reverse order, line by line
tac
91
tail
display the last few lines of a file. By default, it prints the last 10 lines of each specified file to the standard output.
92
tail -n
display the last specified lines in each specified file
93
tee
reads input and writes output to screen and/or file command | tee [options] [file ...]. view and save the output of a command.
94
translate or delete characters from standard input. character substitution, deletion, case conversion.
tr
95
Deletes characters specified in set1.
tr -d
96
tr -s
Squeezes multiple occurrences of a character in set1 into a single occurrence in the output.
97
remove duplicate lines
uniq
98
wc
word, line and character counts -lcw
99
Sets a custom header text
pr -h