CSC 352 bash commands Flashcards

1
Q

absolute path

A

A path that is fully specified from the root directory down.

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

relative path

A

A path that is relative to the current working directory.

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

/

A

The root directory OR the character to separate directories in a path.

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

“current working directory”

A

The directory the shell uses as a reference point for relative paths.

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

home directory

A

The directory where that user’s files typically reside.

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

pwd

A

The command that prints the shell’s current working directory

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

ls

A

The command that prints the contents (files and directories) in the current working directory.

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

ls

A

The command that prints the contents of the named directory .

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

ls –a

A

The command to print directory contents including hidden files

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

ls –l

A

The command to print directory contents in a long, more descriptive format

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

.

A

The hidden directory that refers to the directory itself.

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

..

A

The hidden directory that refers to a directory’s parent directory.

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

man

A

The command “manual page” for a given command

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

mkdir

A

The command to create a new directory

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

cd

A

The command to change the current working directory to

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

~

A

The user’s home directory

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

cp

A

The command to make a copy of as

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

cp

A

The command to make a copy of a file in another directory

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

mv

A

The command to rename (and possibly move) as

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

mv

A

The command to move a file to another directory

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

rm

A

The command to delete file(s)

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

rm -r

A

The command to delete a directory and all its contents.

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

rmdir

A

The command to delete an empty directory

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

cat

A

The command to print the contents of the named file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
head
The command to print the first 10 lines of the named file
26
tail
The command to print the last 10 lines of the named file
27
more
The command to print the named file , one screen at a time.
28
grep
Print the lines in a file that contain
29
wc
Print the number of lines, words, and characters in the named file.
30
echo
Print the
31
sort –n
Print the lines of sorted in numeric order
32
sort
Print the lines of sorted in alphabetical order
33
>
The redirection that causes the stdout of to be stored in the file
34
<
The redirection that causes the stdin of to come from the file
35
>>
The redirection that causes the stdout of to be appended to the file
36
|
The redirection that causes the stdout of to be the stdin of the command
37
stdin
The name of the input stream
38
stdout
The name of the output stream
39
stderr
The name of the error stream
40
char x;
How to declare variable x as a character.
41
int x;
How to declare variable x as an integer.
42
char *p;
How to declare variable p as a pointer to a character.
43
int *p;
How to declare variable p as a pointer to an integer.
44
int z[10];
How to declare variable z as an array of 10 integers.
45
char z[10];
How to declare variable z as an array of 10 characters.
46
*p
How to dereference the pointer p, to refer to the value held at the address held in p.
47
/dev/null
The permanently empty file
48
touch
Create an empty file at , or update its modification time
49
date
Print the current date and time
50
file
Print the type of file at
51
command 2>
Run , sending stderr to
52
command &>
Run , sending stdout and stderr to
53
kill -9
Kill the process with ID
54
make
Build the target using the Makefile in the current directory
55
history
Print the command history
56
=
Set the shell variable to
57
"..."
Shell quotation that expands variables and interprets some special characters
58
...'
Shell quotation that interprets everything literally
59
`...`
Shell quotation that runs the command inside and substitute its output
60
USER
The shell environment variable set to the name of the current user
61
HOME
The shell environment variable set to the home directory of the current user
62
PATH
The shell environment variable set to the directories to search for commands
63
SHELL
The shell environment variable set to the path of the current shell
64
PWD
The shell environment variable set to the current working directory
65
source
Execute the commands in in the current shell (as if they were typed)
66
$?
The exit status of the last command
67
cmd1 ; cmd2
Run cmd1, then run cmd2
68
cmd1 && cmd2
Run cmd1, then run cmd2 only if cmd1 succeeded
69
cmd1 || cmd2
Run cmd1, then run cmd2 only if cmd1 failed
70
[[ ]]
Test if is true
71
$(...)
Run the command inside and return its output
72
$((...))
Evaluate the arithmetic expression inside
73
$
Substitute the value of the shell variable
74
(cmd)
Run cmd in a subshell