MidTerm Prep 2

.docx

School

Whatcom Community College *

*We aren’t endorsed by this school

Course

215

Subject

Information Systems

Date

Dec 6, 2023

Type

docx

Pages

5

Uploaded by BaronFlag6353

Report
Preparation for the Mid-Term Foundational Commands/Concepts: (14) Show me your present working directory “pwd” Suppose you were logged in as “root” instead of “student”, if you issued “cd”, what would your pwd be? “getting back to the student account” How do you find help on linux commands? “man /info /--help” Create a zero-byte file in your home directory called “midterm” “touch midterm Rename the midterm file midterm.txt “cp midterm midterm.txt” What character represents the root of the filesystem (the root directory)? “/” If you want all subsequently created user logins to have a “Basic Linux Commands” file, where would you put it? Show me an “absolute” path to “var” “log” “messages” (what is a path that is not absolute called?) “ls -l /var/log Create a directory “one/two/three four/five” (with a single command) and create a zero- byte file called five.txt in the “five” directory, and a second zero-byte file called 6.txt “mkdir -p one/two/three/four/five” touch five.txt. touch one/two/three/four/five/five.txt Touch 6.txt, touch one/two/three/four/five/6.txt
Erase five.txt without erasing all the directories. “rm one/two/three/four/five/five.txt” Erase directory “one”, and all subsequent directories with a single command. “rmdir -p one/two/three/four/five” Simplify < input.txt >> output.txt cat “cat Users, Groups and Permissions: (13) Set your umask to 022 “ umask 22” Create a new file, what are its permissions? why? “-rw-r—r—” Create a new group “sudo groupadd groupname” What do you expect the line added to /etc/group to look like? Add student to that new group as a supplementary (not primary) group “sudo usermod -aG myfirstgroup student” Add a user account using the non-Debian command. “sudo useradd username” What character will you find, and what file will you find it in, indicating the password for the new account has not been set? Sshd:!!: Now “unlock” the account. Delete the user account Show the permissions of all files in the current directory Change the permissions on midterm.txt so that the owner/user has read and write, group has read only, and other has no permissions. What command did you use? What is the numeric representation of -rwx-wxr-- What is the mnemonic (alphabetic) representation of 645
Shell: (6) What is the shell you are using called? “ Bash” shell Of all the login scripts that are run, which one is the first during an interactive login? “/etc/profile” I ask you to do something with ~/bin... what does the ~ mean? “in the home directory” login shell Add ~/bin to your PATH. Don't lose the current value of PATH. Make is usable by child sessions. PATH=$PATH:~/bin Add this custom PATH variable you just made to a file that guarantees the PATH will be defined for every child session. Open a tty (alt+f2) – what kind of login? interactive / login login Issue /bin/bash – what kind of login? interactive / nonlogin Use ssh or telnet to remotely access the system – what kind of login? interactive / login Start a terminal in a GUI – what kind of login? interactive / non-login Script running as a service noninteractive / non-login Login via telnet -- interactive / login Variables and aliases: (6) What does the PATH variable do? “It contains a list of the directories to be queried whenever a command is entered on the command line”. Display your environment variables “env | less” or “env | grep <some variable name> “env | sort | less” Display your session variables “set “ Create a new variable with a value, and then make it available to child sessions
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help