Lesson 6A Managing Linux Flashcards
Shell
Provides a command environment by which a user can operate the OS and application.(Bash, zsh, and ksh(Korn Shell))
Terminal
Software that implements input and output for a command shell. The Terminal and the Shell are connected by a teletype device.
stdin(0)
Takes the user’s keyboard input and writes it as data to the tty device for processing by the shell command interpreter.
stdout(1)
Reads data generated by the shell from the tty device and displays it through the terminal.
stderr(2)
Carriers error information.
Console Switching
Device that implements input and output for a command shell.
CTRL+ALT+Fx keys can be used to switch consoles.
Commands
The first “word” input is interpreted as the command.
Options(switches) - Are used to change the operations of a commands.
Arguments- Values supplied to the command for it to operate on, such as file names.
Pipe command(|)- Allows the usage of two commands.
Case Sensitivity
Commands, Parameters, and files and directory names are all case sentitive in Linux.
ls -l and ls-L will produce different outputs.
Help System
Reports the functions and syntax when executed as –help. Ex. ls –help | more
Nano
Nano text editor. nano filepath or nano -| filepath showing line numbers.
CTRL+O writes changes to the files.
CTRL+X quits the editor.
Vi or Vim
Preferred by Administrators
Switches
i - switches to insert mode at the current cursor position.
a- appends text after the current position.
A- appends text at the end of the current line
o- insert text on a new line below the current line.
ESC key- switches from insert mode back to command mode.
: set number- Shows line numbers in command mode.
:w- saves the file.
:wq- saves and quits
:q! - quits without saving
Navigation Commands
pwd Command
Print the working directory that you are currently using.
cd Command
Used to change directory.
cd /etc leads to an absolute directory.
cd document leads to subdirectory(relative path) named documents.
cd ..
ls Command
List the contents of the directory
Switches
-l - displays a long list
-a - displays all files including the hidden ones.
cat Command
Returns the content of the files listed as arguments.
Switches
-n- adds line numbers to the output.
Overwrite = cat > file
Append = cat»_space; file
Search Commands
find Command
is used to search for files.
grep Command
Used to search and filter the contents of a file.
File Management Commands
cp Command
Used to create a copy of a file in the same or a different directory with the same name or a different name.
rm Command
Can be used to delete files.
-r can be used to delete a directory