# ethtool nic0 | grep "Link detected"
Link detected: yes
# ethtool nic7 | grep "Link detected"
Link detected: no
# ethtool nic0 | grep -E 'Duplex|Speed|Auto-nego|detect'
Speed:
100Mb/s
Duplex: Full
Auto-negotiation: on
Link detected: yes
# dladm show-dev
e1000g0 link: unknown speed: 0 Mbps duplex: half
ixgbe0 link: up speed: 1000 Mbps duplex: full
ixgbe1 link: up speed:
100 Mbps duplex: full
ixgbe2 link: unknown speed: 0 Mbps duplex:
unknown
ixgbe3 link: unknown speed: 0 Mbps duplex: unknown
#
dladm show-link
e1000g0 type: non-vlan mtu: 1500 device: e1000g0
ixgbe0 type: non-vlan mtu: 1500 device: ixgbe0
ixgbe1 type: non-vlan
mtu: 1500 device: ixgbe1
ixgbe2 type: non-vlan mtu: 1500 device:
ixgbe2
ixgbe3 type: non-vlan mtu: 1500 device: ixgbe3
If you
are running solaris versions older then 10, then try following
ndd –get /dev/ixgbe0 link-status
ndd –get /dev/ixgbe0 link-speed
ping 10.10.10.10 -t
ping -s 10.10.10.10
# find /var/opt -name myfile.html
# find /var/opt -name
"myfile.html"
Case insensitive search
# find /var/opt -iname
MyFiLE.Html
Find files based on content of file
# find . -type
f -exec grep -l "moduleName" '{}' \;
Above command will show
only file names containing pattern, use this if you want to see matched
lines as well
# find . -type f -exec grep -H "moduleName" '{}' \;
Use this if you know the filename
# find /var/opt -type f -iname
myfile* -exec grep "Some Content in file" '{}' \;
You don't
want to see error messages like "Permission denied". Redirect the error
output (stderr) to /dev/null.
# find / -name myfile.xml 2>/dev/null
Find all .xml files (ignoring text case) modified in the last 5 days
by a user named dbuser.
# find /var/opt/ -user dbuser -mtime 5 -iname
".xml"
Search for Directory
find /var/opt/ -type d -iname
MyDirectory
-> show /SP/network
-> cd /SP/network
-> set pendingipaddress=10.96.151.40
-> set pendingipnetmask=255.255.255.0
-> set pendingipgateway=10.96.151.1
-> set pendingipdiscovery=static
-> set commitpending=true
-> set state=enable
-> reset /SP
-> Start SYS
tcpdump -i any
tcpdump -i any host 10.10.15.20
tcpdump -i nic0
tcpdump -i any host 20.25.10.19 -w /tmp/failover11.pcap
Ring buffer capture (rotating capture) running in background.
Leave SSH session open or close out of the SSH session by typing "exit"
. Note: if you close out the SSH session by simply closing Putty, the
process will stop.
tcpdump -i any -n -s 0 -C 1 -W 3 -w
/tmp/rotateCapture.pcap &
exit
snoop –o x42d port 2427 filepath
snoop -d ixgbe0 -o /tmp/mytrace1.pcap host 10.10.10.10
snoop -d ixgbe0 -o /tmp/hpsbc1.pcap host 205.252.10.230 or host 205.252.10.2
snoop -d ixgbe0 -o /tmp/mytrace2.pcap port 5060
snoop -d ixgbe0 port 2905
snoop -dV ixgbe2 port 5060
sudo dmidecode -t system
smbios -t SMB_TYPE_SYSTEM
ipmitool fru
hostid
hostid
sysdef -h
tar xfvz myfile.tar.gz
or
gzip -dv myfile.tar.gz
tar xfv myfile.tar
#tar and zip a folder and remove original folder
tar -zcvf
backupDir.tgz backupDir --remove-files
/sbin/service sendmail stop
/sbin/service sendmail start
/sbin/service sendmail status
svcadm enable ssh
svcadm disable ftp
svcs ftp
User adminA of server A.A.A.A wants to do password less ssh to server B.B.B.B user adminB
1. Login on server A.A.A.A with user adminA
2. ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -q -N ""
3. ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
Now try ssh [email protected]
fallocate -l 10G gentoo_root.img
du /path -skh
# du /config/ -skh
3.8G /config/
Size of directory in human readable units
# du -sh /tmp
720M /tmp
Size of directory in kb
# du -sk /tmp
737172 /tmp
du -h --max-depth=1 /path
start with root and repeat command for biggest folder
[root@admin]# du -h --max-depth=1 /
2.4G /usr
4.0K /home
4.0K /srv
14M /sbin
661M /root
4.0K /mnt
16K /lost+found
1.3G /var
4.0K /cgroup
3.8G /config
4.0K /media
[root@admin]# du -h --max-depth=1 /config
3.8G /config/myconfig
16K /config/lost+found
4.0K /config/fms
8.0K /config/kvm
3.8G /config
Find size of root in kb
# du -sk /
1610313648
Find size of each file and sub directory in root. output sorted by max size
dir in the end
# du -sk /* | sort -n
Use following if you want
max size file/folder first
# du -sk /* | sort -nr
Repeat for
biggest folder
# du -sk /reserved/* | sort -nr
Use -h switch to get human readable output. Don't use sort with -h
switch, it will not give you size sorted output
# du -sh /reserved/*
cat /etc/redhat-release
cat /etc/centos-release
cat /etc/release
uname -a
isainfo -b
grep -E string1\|string2 my_file.txt
grep -v -E string1\|string2 my_file.txt
grep -e string1 -e string2 my_file.txt
grep -v -e string1 -e string2 my_file.txt
Search pattern in
file and print 2 lines after it
grep -A 2 CCL AppParams.xml
Search pattern in file and print 2 lines before it
grep -B 2 CCL
AppParams.xml
Search pattern in file and print 2 lines after and
2 line before it
grep -C 2 CCL AppParams.xml
Print filename
in output
grep -H CCL AppParams.xml
Remove comments and see
just uncommented config parameters
# grep -v '^ *#' /etc/myconfig.txt
Search pattern in zip file
# zgrep myPattern
myfile.gz
echo something > myfile.txt
echo something >> myfile.txt
echo something | tee myfile.txt
echo something | tee -a myfile.txt
Redirection
>
file redirects stdout to file
1>
file redirects stdout to file
2> file
redirects stderr to file
&> file
redirects stdout and stderr to file
# yum install --downloadonly --downloaddir=<directory> <package>
then test and install# rpm -U *.rpm --test
# rpm -U *.rpm
I am an IOT enthusiast with more than 20 years of experience in the IT sector. Specializing in telecom service's; follow me for some very innovative and best in class IOT products as I unfold my knowledge and passion for the subject.
Just me, myself and I, exploring the universe of uknownment. I have a heart of love and interests in technology, IOT and travel . And I want to share my world with you .