03072014 Flashcards Preview

LPIC > 03072014 > Flashcards

Flashcards in 03072014 Deck (8)
Loading flashcards...
0

Internal return code generated

echo $?

# a return of zero means success
# a non zero means error

1

Run a command and save the output in a file

# the redirection (>) operator is used instead of sending the output to the screen

e.g.

ifconfig > file1.txt
cat file1.txt
sort < file1txt
sort output-file.txt

2

pipe (|) operator:

Display only the lines from route that contain the phrase eth0

route | grep eth0

3

Build and execute command lines from standard input

And then sample locating a file and provide long list

xargs

locate file1.txt | xargs ls -la

4

Print lines matching a pattern

grep, egrep, fgrep

5

SENDING OUTPUT FROM ONE TERMINAL TO ANOTHER



1. Open two terminals
2. in one terminal run tty
3. in the other terminal run route command
4. route > /dev/pts/1
the output will go to that terminal

6

Print the file name of the terminal connected to standard input.

tty

7

USING THE SCREEN PROGRAM

Screen is a full screen window manager that shares a physical terminal with other processess


1. screen -L
2. Ctrl +A the press C
3. Ctrl + A + 0
4. Ctrl + A + 3