Sonic Linux
1.command -v
root@leaf2:/tmp# command -v supervisorctl
/usr/local/bin/supervisorctl
root@leaf2:/tmp# command -v ls
/usr/bin/ls
/usr/local/bin/supervisorctl
root@leaf2:/tmp# command -v ls
/usr/bin/ls
2.vtysh -f /etc/frr/frr.conf
equivalent to
vtysh
conf t
<all config lines from file>
conf t
<all config lines from file>
3.vtysh -c "show bgp summary"
4.File Descriptors in Linux
What is a File Descriptor?
A file descriptor (FD) is just a number that Linux uses to represent an open I/O stream. Everything in Linux is treated as a file — including input, output, and errors.
The 3 Standard File Descriptors
Number Name Meaning Default destination
A file descriptor (FD) is just a number that Linux uses to represent an open I/O stream. Everything in Linux is treated as a file — including input, output, and errors.
The 3 Standard File Descriptors
Number Name Meaning Default destination
0 stdin Standard Input Keyboard
1 stdout Standard Output Terminal screen
2 stderr Standard Error Terminal screen
Example:-
2>/dev/null # FD2 → /dev/null (file)
2>out.txt # FD2 → out.txt (file)
2>&1 # FD2 → FD1 (file descriptor, because of &)
Comments
Post a Comment