• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/28

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

28 Cards in this Set

  • Front
  • Back

How to I permanently delete a variable from my system for all users?

NOTE If you want a variable assignment to be removed permanently, you must remove the assignment from the configuration file and from memory. You would issue the command unset <variable_name> and then delete the statement that creates the variable in the configuration file (/etc/profile or ~/.bash_profile).

When you execute a command, be sure to test the results. For example, if you are asked to open a child shell, you should follow this procedure:

1. Verify the process ID (PID) of the current shell using the ps or ps -f command.


2. Create the child process (bash).


3. Verify you are in a child shell by executing the ps -f command and then look for a PID whose parent process (PPID) is the same as you verified in step 1.

Can you name the five bash configuration files?

/etc/profile


/etc/bashrc


~/.bash_profile


~/.bashrc


~/.bash.logout

What are four important variables found in /etc/profile?

HOSTNAME


HISTCONTROL


HISTSIZE


umask

What directory contains application files for operation?


What are two examples of application files?

/etc/bashrc


~/.toprc configures how top command operates


~/.exrc. Configures how vi operates

What are the four configuration elements found in /etc/bashrc?

Aliases


Functions


Shell configuration options


PS1 prompt configuration

What does the ~/.bash_profile contain and when is it read?

It contains user specific customizations to the bash environment, such as time zone, locale, and editor).



It is only read if the user logs onto the system and his default shell is bash. This, changes will not be read until the users next logon OR the command


source~/.bash_profile


is run.

What is /etc/profile.d


What does it contain?


When is it read?


What suffix of files does it read?

It contains configuration information for certain programs


They are read during the login process


etc/profile contains a statement to read files with the suffix .sh for bash/bourne,/Korn users. For C shell users, csh.login contains a statement to read files with the suffix .csh


Configuration files are not active until...


How is this done?

They are stored in memory.


source<filename> or .<filename>

What is the default standard input device?


What is the default standard output device?


What is the default standard error device?

The keyboard


The monitor


The monitor

What is redirection in relation to default devices?

It allows the user to alter the stdin, stdout, or stderr device or file.

A file descriptor is...


And what are the file descriptor numbers?

A reference, also known as a handle, used by the kernel to access a file.


fd0 for stdin


fd1 for stdout


fd2 for stderr


fd255 this file descriptor keeps track of controlling terminal information

How can I see the terminal devices? (There are two ways)











in the filling directories:/dev/pts


/#/dev/tty


/dev/console


/dev/ttyS



Or command:


tty

What is the /dev directory used for?


Why is this significant for the test?

It provides a path to a device.



The test uses the dircoties as the terminal device name /dev/tty0 and /dev/tty1



More accurate names for the devices would be tty0 and tty1

How many virtual text terminals does Linux provide? How are they named?

62


Either /dev/tty# or /dev/vc/#

What file names are attached to the current process?

/dev/tty and /dev/tty0

What does /dev/ttyS refer to?

The systems serial ports

How can I change, or specify, or add multiple console devices?

console=<device>, <deviceoptions>

How can I have message printed on tty1 and and the current terminal device (tty0)?


Add


console=/dev/tty1 console=/dev/tty0 to the kernel command line

What is the purpose of /dev/null?

To prevent stdout and stderr message from being written to tty0.

What is the keyboards file descriptor number?


Device name?

0


fd0

How can I choose an alternate standard input device for a particular command?

< <<


For example cat < /etc/hosts makes cat recieve input from the /etc/hosts rather than the keyboard.

What parameter can I set to avoid accidently overwriting a file?


Hwo can I check if this parameter is set?


How can I turn the parameter off?

command:


noclobber



Set -o | grep noclobber



set +o noclobber

What is the default standard error device?



Whats the name of the device, in the context of stderr?

The monitor



fd2

What are the names for


The stdin


The stdout


The stderr

fd0


fd1


fd2

What is the difference between the output file and the standard device for stdin, stdout, and stderr?

None. If > or >> for stdout and 2> and 2>> are used to redirect the output to another "device" that is the same as choosing another file.



Thus, the default device is no longer the monitor, bit is the file or new device, whatever you want to call it. Everything is a file.

What is the functional name of


>


2>


2>&1

Control operators

How do I write the standard output and the standard error to the same file?



How do I redirect them? (So that I don't overwrite the new device)

2>&1



For example


ls -ld /etc /roses 2>&1 errorfile


(Roses doesn't exist in the above example so it will have an error message)



The same command as above but replace 2>&1 with >&