3377

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/93

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

94 Terms

1
New cards

what command to use switch back and forth with files in VI editor

:bp and :bn

2
New cards

what symbol indicates file is empty in vi editor

~

3
New cards

to go to start of a file and to go to bottom of a file use what commands

G and gg

4
New cards

Insert before char which command

i

5
New cards

Insert after char which command

a

6
New cards

Switch from command to input in VI. You have to use what command

a,i,o

7
New cards

Switch from input to command. You have to use what command

Esc

8
New cards

How to move to line 89

:89

9
New cards

what can we do to recover a file

vi -r filename

10
New cards

how to globally replace one word with another

:%s/.../.../g

11
New cards

Steps to copy a test

ma
y'a
p

12
New cards

y'a

13
New cards

p

14
New cards

Steps to move a text

ma
d'a
p

15
New cards

d'a

16
New cards

p

17
New cards

Name the two modes in the vi tutor

command and insert mode

18
New cards

Count the files that you own in all your directories (where your userid is myusername)

ls -lR | grep myusername | wc -l

19
New cards

What UNIX command is used to update the modification time of a file and/or change the file's access?

touch

20
New cards

To list the permissions on files, which of the following commands will work?

ls -l

21
New cards

When you use the ln command, which of the following occurs?

a file is created that points to an existing file

22
New cards

(T/F)The command "grep -i hello" prints all the lines in file, not containing the string "hello".

false

23
New cards

Which of the following is not a UNIX file type?

24
New cards
25
New cards

plain file

26
New cards

special file

27
New cards

batch file

28
New cards

Which of the following is not a UNIX file type?

plain file
special file
batch file
directory file

batch file

29
New cards

How do you rename file "new" to be "old"?

mv new old

30
New cards

To delete a file called mynotes.txt, which command do you use?

rm -i mynotes.txt

31
New cards

In Unix, if you wanted to allow a user to list the contents of a directory, you would give the directory what permission, at least?

read

32
New cards

What is the generic syntax for all UNIX commands?

command name, followed by options, followed by arguments

33
New cards

Which command is used to create the directory "abc" in the previous (parent) directory?

mkdir ../abc

34
New cards

Make a copy of file "upper" in the directory two levels up.

cp upper ../..

35
New cards

Consider a file abc which can be "read, write, execute" only by the owner. After the following command: "chmod g+x abc", the result will be is equivalent to the result of command:

chmod 710 abc.

36
New cards

(T/F)The command "grep hello file" prints all lines in "file" that contains hello.

true

37
New cards

What is a shell in UNIX?

a program through which users can issue commands to UNIX

38
New cards

How do you print the first 15 lines of all files ending by ".txt"?

head -15 *.txt

39
New cards

To create a new file "new.txt" that is a concatenation of "file1.txt" and "file2.txt" is done by which command?

cat file1.txt file2.txt > new.txt

40
New cards

To match all your .files (that is, any hidden files begins with a period).

ls .*

41
New cards

Use this as a last resort to destroy any jobs or programs that you suspended and are unable to restart

kill

42
New cards

This displays information about programs that are currently running

43
New cards

Displays process status

ps

44
New cards

Sorts and/or merges files

sort

45
New cards

This displays the beginning of a file

head

46
New cards

This joins lines from two files based on a common field

join

47
New cards

With this option of chmod command,

48
New cards

Owner can read, write, and execute the file; group and other can execute the file.

0711

49
New cards

Displays the last part (tail) of a file

tail

50
New cards

outputs content of a text file, read through brief files, concatenate files together

cat

51
New cards

This displays text files, one screen at a time

less

52
New cards

This reports file system disk usage (i.e., the amount of space taken up on mounted file systems).

df

53
New cards

This searches for a pattern in files

grep

54
New cards

Owner can read, and write the file; group can read the file, and other cannot access the file.

0640

55
New cards

To run a program or command in background, use this symbol at the end of the command line.

56
New cards

Ampersand ("&")

57
New cards

Pipe ("|")

58
New cards

Percent ("%")

59
New cards

Dollar ("$")

60
New cards

To run a program or command in background, use this symbol at the end of the command line.
Ampersand ("&")
Pipe ("|")
Percent ("%")
Dollar ("$")
At-sign ("@")

Ampersand ("&")

61
New cards

This terminates a process by PID

62
New cards

kill

63
New cards

terminate

64
New cards

pskill

65
New cards

stop

66
New cards

This terminates a process by PID


kill
terminate
pskill
stop
procterm

kill

67
New cards

Which one of the following methods is NOT correct for two processes to communicate each other?

pipe

68
New cards

What is the acronym for the unique id given to each running process

PID

69
New cards

All directories are in a _________ structure

hierarchical

70
New cards

What is the symbol for root directory

/

71
New cards

/bin

Holds the files needed to bring the system up and run it when it first comes up in single-user/recovery mode.

72
New cards

/dev

Device files Contains all the files that represent peripheral devices, such as disk drives, terminals, and printers.

73
New cards

/boot

Static files of the boot loader Contains all the files needed to boot the system.

74
New cards

/opt

Add-on (optional) software packages

75
New cards

/sbin

Essential system binaries and used only by superuser

76
New cards

Special user for administrator is called

superuser

77
New cards

change directory

cd

78
New cards

pwd

show current position/working direcotry

79
New cards

what command can we use to navigate one up in the directory hierarchy?

cd ..

80
New cards

List all files/folders that end in ".bashrc"

ls -l .bashrc

81
New cards

hidden filenames start with

.

82
New cards

switch user command

su

83
New cards

change password

passwd

84
New cards

list all

ls -a

85
New cards

detailed list of all files and directories

ls -la

86
New cards

The command searches for the string "Desk" in the redirect.txt file and for each line that contains "Desk", it prints the line number.

grep -n Desk redirect.txt

87
New cards

It shows the last 10 lines of a file and filters them to display only lines containing the word "Desk."

88
New cards

It shows the last 10 lines of a file and filters them to display only lines containing the word "Desk."
What command is this?

tail redirect.txt | grep Desk

89
New cards

identify the largest file in the directory

ls -la/bin | sort -nk5 | tail -1

90
New cards

lists all running processes and then filters the list to show only the processes that have "Java" in their command or arguments

ps -ef | grep Java

91
New cards

Does it compile, link or both : g++ -o textr *.cpp

Both compilation and linking.

92
New cards

Does it compile, link or both : g++ -Wall -g -c main.cpp

Compilation only.

93
New cards

Does it compile, link or both : g++ -o myProg -L/usr/class/cs193/danLib -lDansFns *.o

Linking only.

94
New cards

Does it compile, link or both : g++ -I/usr/class/cs193/inc main.cpp src1.cpp src2.cpp

Both compilation and linking.