Skip to content


bash redirect output STDOUT STDERR

HOWTO redirect output: STDOUT / STDERR

examples:

output or stdout to screen
$ echo "test"

redirects stdout to afile.txt
$ echo "test" > afile.txt

0 is stdin.
1 is stdout.
2 is stderr.

also redirects stdout to afile.txt
$ echo "test" 1> afile.txt

redirect stderr to afile.txt
$ echo "test" 2> afile.txt

>& is the syntax to redirect a stream to another file descriptor

redirect stdin to stderr
$ echo "test" 1>&2
# or
$ echo "test" >&2

..or vice versa:

$ echo "test" 2>&1

So, in short.. 2> redirects STDERR to an (unspecified) file, appending &1 redirects STDERR to STDOUT

Posted in Code, Development.

Tagged with , , , , , .


Yum info | managing packages with yum


configuration yum:
$ cat /etc/yum.conf

list installed (and installed packagename)
$ yum list
$ yum list | grep -i packagename

info packagename
$ yum info packagename

search packagename
$ yum search packagename

dependency list
$ yum deplist packagename

install packagename
$ yum install packagename

update
$ yum update

remove packagename
$ yum remove packagename

links:
http://prefetch.net/articles/yum.html

Posted in News.

Tagged with , , .


CentOS version (commandline)


$ cat /etc/redhat-release

Posted in News.

Tagged with .