Linux Shell Flashcards
39 Questions
100 Views

Linux Shell Flashcards

Created by
@MarvelousPascal

Questions and Answers

What is the Linux shell?

It is the Command Line Interface (CLI) or Text User Interface (TUI) that administrators use to control a Linux operating system.

What does TUI stand for?

Text User Interface

What is the Bourne-again shell (bash)?

The standard shell used in most Linux computers, similar to a UNIX shell.

What is 'sh'?

<p>The Bourne shell, an earlier version of the Bash shell.</p> Signup and view all the answers

What does 'ksh' stand for?

<p>Korn shell</p> Signup and view all the answers

What does 'csh' represent?

<p>C-shell</p> Signup and view all the answers

What is 'tcsh'?

<p>An improved version of csh.</p> Signup and view all the answers

A list of shells is stored in the ______

<p>/etc/shells file</p> Signup and view all the answers

What is the Kernel?

<p>The core component of an operating system that interfaces with all shells.</p> Signup and view all the answers

What does the tilde symbol (~) indicate in a prompt?

<p>It indicates the present working directory is the home directory of the current user.</p> Signup and view all the answers

What is a command path?

<p>The set of directories in which Linux searches to find executable files.</p> Signup and view all the answers

How do you see the command path?

<p>By typing 'echo $PATH'.</p> Signup and view all the answers

How do you add a directory to a path?

<p>By typing 'PATH=$PATH:directory_path'.</p> Signup and view all the answers

How do you execute programs in Linux?

<p>Type the executable name in the present working directory.</p> Signup and view all the answers

What command do you type to run an executable in the present working directory?

<p>Type './filename'.</p> Signup and view all the answers

What does the '/' symbol indicate?

<p>It indicates the present working directory.</p> Signup and view all the answers

What is a pathname?

<p>The path to the file to run an executable from anywhere.</p> Signup and view all the answers

File names and paths in Linux are case sensitive.

<p>True</p> Signup and view all the answers

What key do you press to complete a file, command, or directory name?

<p>Tab</p> Signup and view all the answers

What command shows the present working directory?

<p>pwd</p> Signup and view all the answers

What command displays the current username?

<p>whoami</p> Signup and view all the answers

What is the purpose of the 'uname' command?

<p>To print system information.</p> Signup and view all the answers

What does the '-a' option of 'uname' do?

<p>It prints all system information.</p> Signup and view all the answers

What does the '-o' option of 'uname' print?

<p>It prints the operating system.</p> Signup and view all the answers

What does the '-p' option of 'uname' do?

<p>It prints the processor's architecture type.</p> Signup and view all the answers

What does the 'su' command do?

<p>Switches users in the shell prompt.</p> Signup and view all the answers

What does 'su -l user_name' do?

<p>Switches to the specified user in a login shell.</p> Signup and view all the answers

What does 'su user_name' do?

<p>Switches to the specified user without loading environmental variables.</p> Signup and view all the answers

What is the difference between 'su - user_name' and 'su user_name'?

<p>'su - user_name' loads the user's environmental variables while 'su user_name' does not.</p> Signup and view all the answers

The '#' symbol indicates the current user is a normal user.

<p>False</p> Signup and view all the answers

The '$' symbol indicates the current user is a normal user.

<p>True</p> Signup and view all the answers

What is the purpose of the 'exit' command?

<p>To exit the login shell or return to the original user after using the su command.</p> Signup and view all the answers

What does 'exec' do?

<p>It executes an executable and replaces the shell with the new process created by the executable file.</p> Signup and view all the answers

What does 'cd' command do?

<p>Change directories.</p> Signup and view all the answers

What does 'cd bin' do?

<p>Changes to the bin directory in the current directory.</p> Signup and view all the answers

What does 'cd /usr/bin' do?

<p>Changes to the bin directory from anywhere in the file system.</p> Signup and view all the answers

What command shows names of files and directories in the current directory?

<p>ls</p> Signup and view all the answers

What does 'ls -a' command do?

<p>Shows all files and directories, including hidden files.</p> Signup and view all the answers

What does 'ls -l' command show?

<p>Shows information about files including size, permissions, and timestamps.</p> Signup and view all the answers

Study Notes

Linux Shell Overview

  • The Linux shell serves as the Command Line Interface (CLI) or Text User Interface (TUI) for interacting with the Linux operating system.
  • Users and programs send commands to the system through the shell.

Types of Shells

  • Bash (Bourne-again shell): The default shell in most Linux systems; features include command completion, command history, and improved arithmetic functions.
  • sh (Bourne shell): The original shell created by Steve Bourne; predecessors to Bash.
  • ksh (Korn shell): Developed by David Korn; includes unique features not found in Bash and is an evolution of the Bourne shell.
  • csh (C shell): Utilizes syntax similar to C programming language.
  • tcsh: An enhanced version of csh, featuring command line editing and completion.

Shell Configuration

  • /etc/shells file: Contains a list of shells recognized by the system.
  • The kernel interacts with all shells and isolates their functionality from the core system.
  • The tilde symbol (~) in the prompt denotes that the current working directory is the user's home directory.
  • The command path defines directories where executable files for commands are located.
  • Enter echo $PATH to display the current command path.

Executing Programs

  • To run an executable in the current directory, type ./filename.
  • The pathname allows execution of files from any location in the filesystem.

File Handling

  • File names and paths in Linux are case-sensitive.
  • The Tab key can be used for auto-completing file, command, or directory names.

Useful Shell Commands

  • pwd: Displays the present working directory.
  • whoami: Shows the username of the current user.
  • uname: Prints system information; options include -a for all info, -o for operating system, and -p for processor architecture.

User Management

  • su: Switches users without loading new environmental variables; requires the user's password.
  • su -l username and su - username: Switch to a specified user with or without loading user-specific environment settings.
  • Root user: Identified by the # prompt; normal users are indicated by the $ prompt.
  • exit: Exits the current shell or logs out from a user session.

Directory Management

  • cd: Changes directories; can change to subdirectories or absolute paths (e.g., cd /usr/bin).
  • ls: Lists files and directories; variations include ls -a for all files and ls -l for detailed information about files.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Description

Test your knowledge of Linux shell terminology with these flashcards. This quiz covers key concepts like the Command Line Interface, Text User Interface, and the Bourne-again shell (bash). Enhance your understanding of Linux environments and their command structures.

More Quizzes Like This

Use Quizgecko on...
Browser
Browser