Post

Learn Basic Linux-Command | PART 2

Tuxnoob - In previously post have been discussed about [Learn Basic Linux-commandPART 1](https://tuxnoob.com/tags/bash-shell), now i will explain sequel.

File Descriptor

  1. td p { margin-bottom: 0in; }p { margin-bottom: 0.1in; line-height: 120%; } Output to monitor (standard output), input from system (kernel)

$ ps

  1. Output to monitor (standard output), input from keyboard (input standard)

$ cat hello, what’s up!!! hello, what’s up!!! exit with ^d [ctrl+d]

  1. Input from keyboard and output to internet address

$ mail arief-jr@gmail.com

  1. Input name directory, nothin output (create new directory), if an error then error display on screen (screen standard)

$ mkdir [dir name] $ mkdir mydir (there error message, because this directory already created)

Redirection

  1. Output standard redirect

$ cat 1> filename.txt this is a text created by me

  1. Notation 2>&1: Error standard redirection (2>) is identical with file descriptor 1.

$ ls newfile (there error message)
$ ls newfile 2> result.txt
$ cat result.txt
$ ls newfile 2> result.txt 2>&1
$ cat result.txt

  1. For standard output redirection to file, use operator >

$ echo hello $ echo helllo > output $ cat output

  1. Input standard redirect and output standard can combined but do not us sama file name as input standard or output

$ cat < output > out $ cat out $ cat < output >> out $ cat out $ cat < output > output $ cat outpit $ cat < out >> out (process won’t stop) $ cat out

Pipeline

  • Pipeline operator () used for make process execute by passing data driectly to other data

$ who $ who | sort $ who | sort -r $ who > tmp $ sort tmp $ rm tmp $ ls -l /etc | more $ ls -l /etc | sort | more

Filter

  • Pipeline also used for combines the utility system to form more complex functions

$ w -h | grep $ greo user /etc/passwd $ ls /etc | wc $ ls /etc | wc -l

Maybe that my explain about Linux-Command. So if you want learning, please. Because learning not need younger, smart or experience and other the most important we still understand.

“There is a will there is a way”

Thanks, may be useful and good luck!!! Arief

This post is licensed under CC BY 4.0 by the author.