Redirect Output “/dev/null”

/dev/null

มันคือการ redirect output ให้ไปอยู่ในที่ๆเราต้องการ
ปกติ เวลาเราเขียนโปรแกรมนะครับ
เวลาเราจะ output อะไรบางอย่างออกมา
มันจะมี 2 channel ที่ใช้กันคือ
stdout กับ stderr (1 กับ 2 ตามลำดับ)

สมมติผมรันคำสั่งนึง แล้วมีทั้ง stdout กับ stderr ออกมานะครับ
somecommand 1>1.txt 2>2.txt
output ของ stdout ทั้งหมดจะถูก redirect ไปยังไฟล์ที่ชื่อ 1.txt
output ของ stderr ทั้งหมดจะถูก redirect ไปยังไฟล์ที่ชื่อ 2.txt

การ redirect ไป /dev/null ก็คือ โยนมันทิ้งไปนั่นแหล่ะ
ฉะนั้น somecommand > /dev/null คือการโยน output ทิ้งไปให้หมด

2>&1 คือ สั่งให้ output จาก stderr ออกไปยัง stdout
> /dev/null คือการสั่ง redirect stdoutput โยนทิ้งไป

ฉะนั้นไม่ว่าจะมี output จาก stderr หรือ stdout ก็จะโดนโยนทิ้งหมด

Credit By http://www.dvdgameonline.com/forums/index.php?showtopic=295983

Install Samba On CentOS

How do I use samba as file server?

Samba is a free software re-implementation of SMB/CIFS networking. Windows XP/2000 use samba as file server. It runs on both Linux and UNIX oses.
First install samba on Linux using yum command:

 # yum install samba samba-client samba-common
# chkconfig smb –level 345 on
# chkconfig smb on
# /etc/init.d/smb start

 

How do I use NFS as file server?

Network File System (NFS), a protocol originally developed by Sun Microsystems in 1984. NFS server use to share files and directories from Linux system to rest of UNIX/Linux and Windows (using MS- UNIX services or third party tools) workstation.
First install NFS on Linux using yum command:

# yum install nfslock portmap nfs

1 2