Looks like no one added any tags here yet for you.
what command to use switch back and forth with files in VI editor
:bp and :bn
what symbol indicates file is empty in vi editor
~
to go to start of a file and to go to bottom of a file use what commands
G and gg
Insert before char which command
i
Insert after char which command
a
Switch from command to input in VI. You have to use what command
a,i,o
Switch from input to command. You have to use what command
Esc
How to move to line 89
:89
what can we do to recover a file
vi -r filename
how to globally replace one word with another
:%s/.../.../g
Steps to copy a test
ma
y'a
p
y'a
p
Steps to move a text
ma
d'a
p
d'a
p
Name the two modes in the vi tutor
command and insert mode
Count the files that you own in all your directories (where your userid is myusername)
ls -lR | grep myusername | wc -l
What UNIX command is used to update the modification time of a file and/or change the file's access?
touch
To list the permissions on files, which of the following commands will work?
ls -l
When you use the ln command, which of the following occurs?
a file is created that points to an existing file
(T/F)The command "grep -i hello" prints all the lines in file, not containing the string "hello".
false
Which of the following is not a UNIX file type?
plain file
special file
batch file
Which of the following is not a UNIX file type?
plain file
special file
batch file
directory file
batch file
How do you rename file "new" to be "old"?
mv new old
To delete a file called mynotes.txt, which command do you use?
rm -i mynotes.txt
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
What is the generic syntax for all UNIX commands?
command name, followed by options, followed by arguments
Which command is used to create the directory "abc" in the previous (parent) directory?
mkdir ../abc
Make a copy of file "upper" in the directory two levels up.
cp upper ../..
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.
(T/F)The command "grep hello file" prints all lines in "file" that contains hello.
true
What is a shell in UNIX?
a program through which users can issue commands to UNIX
How do you print the first 15 lines of all files ending by ".txt"?
head -15 *.txt
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
To match all your .files (that is, any hidden files begins with a period).
ls .*
Use this as a last resort to destroy any jobs or programs that you suspended and are unable to restart
kill
This displays information about programs that are currently running
Displays process status
ps
Sorts and/or merges files
sort
This displays the beginning of a file
head
This joins lines from two files based on a common field
join
With this option of chmod command,
Owner can read, write, and execute the file; group and other can execute the file.
0711
Displays the last part (tail) of a file
tail
outputs content of a text file, read through brief files, concatenate files together
cat
This displays text files, one screen at a time
less
This reports file system disk usage (i.e., the amount of space taken up on mounted file systems).
df
This searches for a pattern in files
grep
Owner can read, and write the file; group can read the file, and other cannot access the file.
0640
To run a program or command in background, use this symbol at the end of the command line.
Ampersand ("&")
Pipe ("|")
Percent ("%")
Dollar ("$")
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 ("&")
This terminates a process by PID
kill
terminate
pskill
stop
This terminates a process by PID
kill
terminate
pskill
stop
procterm
kill
Which one of the following methods is NOT correct for two processes to communicate each other?
pipe
What is the acronym for the unique id given to each running process
PID
All directories are in a _________ structure
hierarchical
What is the symbol for root directory
/
/bin
Holds the files needed to bring the system up and run it when it first comes up in single-user/recovery mode.
/dev
Device files Contains all the files that represent peripheral devices, such as disk drives, terminals, and printers.
/boot
Static files of the boot loader Contains all the files needed to boot the system.
/opt
Add-on (optional) software packages
/sbin
Essential system binaries and used only by superuser
Special user for administrator is called
superuser
change directory
cd
pwd
show current position/working direcotry
what command can we use to navigate one up in the directory hierarchy?
cd ..
List all files/folders that end in ".bashrc"
ls -l .bashrc
hidden filenames start with
.
switch user command
su
change password
passwd
list all
ls -a
detailed list of all files and directories
ls -la
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
It shows the last 10 lines of a file and filters them to display only lines containing the word "Desk."
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
identify the largest file in the directory
ls -la/bin | sort -nk5 | tail -1
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
Does it compile, link or both : g++ -o textr *.cpp
Both compilation and linking.
Does it compile, link or both : g++ -Wall -g -c main.cpp
Compilation only.
Does it compile, link or both : g++ -o myProg -L/usr/class/cs193/danLib -lDansFns *.o
Linking only.
Does it compile, link or both : g++ -I/usr/class/cs193/inc main.cpp src1.cpp src2.cpp
Both compilation and linking.