Scott Dollinger CS3377 Exam 1 - Spring 2026

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/77

encourage image

There's no tags or description

Looks like no tags are added yet.

78 Terms

1
New cards

What command finds out what the current shell being run is?

echo $0 / echo $SHELL

2
New cards

What metacharacters are used when you append output to a file?

>>

3
New cards

What is the command to display username?

whoami / id / echo $USER

4
New cards

What does ls -a do?

It lists all files which includes hidden ones

5
New cards

What do you call a path that begins with a slash?

An absolute path

6
New cards

What do you call a path name that does not begin with a slash?

Relative Path

7
New cards

Where does cd with no arguments take you

Home directory

8
New cards

What is the structure of the UNIX file system?

Hierarchical tree structure with root at / and branches

9
New cards

When you log into UNIX what directory are you in by default?

HOME directory

10
New cards

Given a directory structure, can you know where CD will take you?

Remember cd.. takes you one back.

Remember cd. take you to current directory.

11
New cards

What does the man command do?

The man command gives you information about the command you have as an argument

12
New cards

What metacharacter do hidden files start with?

.

13
New cards

What does echo $0 do?

Gives you what your current shell is. bash

14
New cards

What does you have to put in front of a variable to access it?

$

15
New cards

What option do you have to give the ls (list command) to show the permissions associated with the file?

-l long iist format

16
New cards

Environment variable?

All caps / all children know it

17
New cards

Redirection vs Pipes?

> (overwrite), >>(append),

18
New cards

echo $PATH Does what?

colon seprated list of directories

19
New cards

echo $$?

Displays PID

20
New cards

What happens if you run a program not in directory?

It won't find it.

21
New cards

What is the command to change permissions?

chmod

22
New cards

What is the command for copying a file?

cp

23
New cards

Command to change information on the associated file?

Chmod

24
New cards

What are the various ways to go to home directory?

cd, cd~, cd $HOME, cd absolute path

25
New cards

What is the command to create a file?

Touch

26
New cards

What is the command that displays the file type?

file

27
New cards

What is the command that display a text file one screen at a time?

more

28
New cards

Know what command helps you find a file or directory with a certain name

find [path] -name "filename"

29
New cards

Know the command that displays all files in tree structure?

tree

30
New cards

Know how to do a link command?

ln

Syntax: ln -s [original_file] [new_link] (symbolic)

31
New cards

What does the cat command do?

Outputs and displays the file

32
New cards

What does a grep command do?

Searches for patterns in a file

33
New cards

What command creates a new subdirectory?

mkdir

34
New cards

What command moves a file in a subdirectory and renames

mv

35
New cards

What does who command do?

Command that shows list logged in users

36
New cards

What happens if you use remove on a nonempty directory.

It will fail

37
New cards

How to remove a non-empty directory with flag

rm -r

38
New cards

What command gives absolute path for working directory

pwd

39
New cards

What does the touch command do?

It creates an empty file if file does not exist.

40
New cards

Inside a bash shell script what does: $$, $*, and $# do

−PID</p><p>- PID</p><p>* - list of parameters

$$# - number of parameters

$0 - gets name of script (shell)

41
New cards

Inside a script, what does $0 do

$0 - gets name of script (shell)

42
New cards

Identify assigning userdefined shell variable to string?

var="string"

43
New cards

What does environment variable $HOME hold

Home directory path

44
New cards

What is the naming convention of environment variables

CAPITALIZED

45
New cards

In a bash shell, what is the command to read an argument from the command line to the shell?

read

46
New cards

What does find -name do?

Helps you find a file or directory with the name parameter

47
New cards

How does the ls command list only hidden files in the current directory?

ls -d .*

48
New cards

What is the metacharacter to match 0 or more characters?

*

49
New cards

What does a question mark do as a metacharacter

That one character can be anything.

50
New cards

What metalevel character that makes a pipe between commands?

|

51
New cards

What mode does VIM open in?

Native mode (command mode)

52
New cards

Can you VIM a files that doesn't exist?

Yes

53
New cards

How to goes to insert mode in VIM?

Press i

54
New cards

How to leave insert mode?

Esc key

55
New cards

What do you have to use to enter command in vim

Press :

56
New cards

When in native mode, what is the command that deletes the line the cursor is located on?

Press dd

57
New cards

What mode does VIM start in?

Native mode

58
New cards

How to read ls -l?

permissions, user, group

59
New cards

How to read permissions

-(3-Owner/user rwx)(3Group)(3 Others)

60
New cards

Chmod options?

UGO

61
New cards

Can the root user do modify permissions on any file?

Yes, they can modify anything

62
New cards

If you execute a touch on a file that already exists, does it affect permissions?

No

63
New cards

What is a token

In a general computing or programming context, a token is the smallest individual unit of a program or command that has a specific meaning to the system.

The smallest piece like a command, arguments, etc.

ls

-o

64
New cards

What is the metacharacter that options start with?

-

65
New cards

Is echo a builtin command?

Yes

66
New cards

What is the first line of a script?

#!/bin/bash shebang

67
New cards

How to set an alias

alias name="command"

68
New cards

How to user grep on a file to look for a character

grep "character" filename

69
New cards

What does the .bashrc file do?

Saves aliases, functions, etc.

70
New cards

What can symbolic links link to?

Symbolic links only link to files and directories

71
New cards

Are all variables in a script file global by default?

No

72
New cards

How to declare a function

function() {}

73
New cards

Are functions still defined when you log out?

No, they are temporary

74
New cards

How do you use an export command

export var

75
New cards

How to activate and run a script metacharacters?

./

76
New cards

What is the basic if statement syntax

if [[ condition ]]

then

# Commands to execute if the condition is true

fi

77
New cards

What are some test operators

Integer Comparisons: -eq (equal), -ne (not equal), -gt (greater than), -lt (less than).

File Tests: -f (checks if a file exists), -d (checks if a directory exists).

String Tests: -z (checks if a string is empty), == (string equality), -n not empty

78
New cards

When does .bashrc file get activated

At startup of bash