CS131 Week 3

RefinedBowenite avatar
RefinedBowenite
·
·
Download

Start Quiz

Study Flashcards

19 Questions

Which graphical editor is the default text editor for Gnome?

gedit

Which graphical editor is the graphical version of vim?

gvim

Which graphical editor is a Microsoft Word alternative?

AbiWord

Which file contains the user account information for your system?

/etc/passwd

What does the 'alias' command do in the previous example?

Replaces a simpler word for the command given

What is the purpose of the '.bashrc' file?

To configure Bash to personal needs

What is the purpose of the 'sudo' command in Linux?

To switch to root-level access

Which character is used to reference the contents of a variable in a shell script?

$

What is the purpose of the 'export' command in a shell script?

To make a variable available to child processes

What is the difference between 'echo pwd' and 'echo "pwd"'?

The first prints the string 'pwd', the second prints the current working directory

What is the purpose of the 'exit' function in a C program?

To terminate the program

According to the text, what is the purpose of the 'sudo' command?

To execute specific commands with elevated privileges

What is the main difference between the 'sudo' and 'su' commands?

'sudo' is used to execute specific commands with elevated privileges, while 'su' is used to switch to another user's shell session

If a user 'alice' creates a file named 'linux_intro.txt' using 'vi' in their home directory, who will be assigned as the owner of the file?

The user 'alice'

Which command can be used to change the group that owns a file or directory?

chgrp

Which command is used to create a new group in Linux?

groupadd

True or False: Chown can only change ownership of a file, not a directory.

False

Why does Linux use groups?

For security reasons

Which command is used to add a user to a particular group in Linux?

usermod

Study Notes

Default Text Editor

  • Gnome's default text editor is Gedit.

Graphical Editors

  • Gvim is the graphical version of Vim.
  • LibreOffice is a Microsoft Word alternative.

User Account Information

  • The /etc/passwd file contains user account information for the system.

Bash Commands

  • The alias command is used to create a shortcut for a command or a set of commands.
  • The .bashrc file is used to store Bash shell configurations and settings.

Sudo Command

  • The sudo command allows a user to execute a command with superuser privileges.
  • The main purpose of sudo is to provide temporary elevated privileges to a user.

Shell Scripting

  • The dollar sign $ is used to reference the contents of a variable in a shell script.
  • The export command is used to set an environment variable in a shell script.

Echo Command

  • echo pwd`` outputs the current working directory.
  • echo "pwd" outputs the string "pwd".

C Programming

  • The exit function is used to terminate a C program.

Linux File Management

  • When a user creates a file, they are assigned as the owner of the file.
  • The chgrp command is used to change the group that owns a file or directory.
  • The groupadd command is used to create a new group in Linux.
  • Chown can be used to change ownership of both files and directories.
  • Linux uses groups to manage file permissions and access control.
  • The usermod command is used to add a user to a particular group in Linux.

Test your knowledge of configuring Bash in UNIX/Linux and learn about the different login files and their functions. Determine if it is true or false that configuring Bash to your personal needs is a good reason to use UNIX/Linux.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Use Quizgecko on...
Browser
Browser