Basic command-line: Difference between revisions

From Phobos Wiki
Jump to navigation Jump to search
No edit summary
 
(10 intermediate revisions by 2 users not shown)
Line 2: Line 2:
*Log in as super user
*Log in as super user
<pre>su</pre>
<pre>su</pre>
*Log out
<pre>exit</pre>
*Terminate a running process
<pre>Ctrl-C</pre>
*Display current software and hardware version
*Display current software and hardware version
<pre>cat /VERSION</pre>
<pre>cat /VERSION</pre>
*Display welcome screen
<pre>dynmotd</pre>
*Free storage on system
<pre>df -h</pre>
*Uptime of system
*Uptime of system
<pre>uptime</pre>
<pre>uptime</pre>
Line 14: Line 22:
*Display product processor type
*Display product processor type
<pre>cat /proc/cpuinfo</pre>
<pre>cat /proc/cpuinfo</pre>
*Free storage on system
 
<pre>df -h</pre>
==Time & GPS==
==Time & GPS==
*Show system time
*Show system time
Line 27: Line 34:
*Monitor PPS pulse received from GPS connected to C1 (or Com1 for GWM). More details: [[GPS in port C1]]
*Monitor PPS pulse received from GPS connected to C1 (or Com1 for GWM). More details: [[GPS in port C1]]
<pre>ppswatch -a /dev/gpspps0</pre>
<pre>ppswatch -a /dev/gpspps0</pre>
*Display time offset with ntp server ntp1.aso.ee
<pre>ntpdate -d 195.80.105.226</pre>
*Display connected NTP devices
ntpdc -n -c monlist
==Logs & files==
==Logs & files==
*Display content of console.log
*Display content of console.log
Line 36: Line 48:
*Save a TCP capture log from eth2, TCP port 2404, to file tcplog1.pcap (Wireshark compatible)
*Save a TCP capture log from eth2, TCP port 2404, to file tcplog1.pcap (Wireshark compatible)
<pre>tcpdump -i eth2 -n  tcp port 2404 -w tcplog1.pcap</pre>
<pre>tcpdump -i eth2 -n  tcp port 2404 -w tcplog1.pcap</pre>
In case of saving many additional logs to the device, please consider the amount of free flash space on the device (df -h) 
*Edit the file named log-conf.xml (changes will be lost after reboot)
*Edit the file named log-conf.xml (changes will be lost after reboot)
<pre> nano /usr/local/etc/telem/log-conf.xml</pre>
<pre> nano /usr/local/etc/telem/log-conf.xml</pre>
==Configs==
==Configs==
*List old GWS configs available
*List old GWS configs available
<pre>/etc/init.d/S11telem-config list-old</pre>
<pre>/etc/init.d/S11telem-config list-old</pre>
*Load old GWS configs number 3
*Load old GWS config number 3
<pre>/etc/init.d/S11telem-config old 3 </pre>
<pre>/etc/init.d/S11telem-config old 3 </pre>
==Application statistics==
==Application statistics==
*Display application start history
<pre>cat /var/local/telem/stats/app-start-time</pre>
*Display application start count
<pre>cat /var/local/telem/stats/app_start_count</pre>
*Display device boot count
<pre> cat /var/local/telem/stats/boot_count</pre>
==Networking==
*List available interfaces, IP addresses & Rx/Tx stats
<pre>ifconfig</pre>
*Dispaly active Internet connections (servers and established)
<pre>netstat -lna</pre>
*List current rules in iptables
<pre>iptables -L</pre>
*Display kernel IP routing table
<pre>route</pre>
==Modem Statistics (GWM)==
<pre> cat /var/log/modem.st</pre>

Latest revision as of 11:26, 3 March 2015

Basic

  • Log in as super user
su
  • Log out
exit
  • Terminate a running process
Ctrl-C
  • Display current software and hardware version
cat /VERSION
  • Display welcome screen
dynmotd
  • Free storage on system
df -h
  • Uptime of system
uptime
  • Display product name
 cat /usr/local/etc/telem/product 
  • Display product ID
 cat /usr/local/etc/telem/product_id 
  • Display product order code
 cat /usr/local/etc/telem/order_code
  • Display product processor type
cat /proc/cpuinfo

Time & GPS

  • Show system time
date
  • Show time from hardware clock (UTC)
hwclock -r
  • Manually set system time to 30.november 2015, 17:00 and reboot (date format MMDDhhmm[[YY]YY][.ss])
su -c "date 113017002015;hwclock -w -u;reboot" 
  • Monitor data received from GPS connected to C1 (or Com1 for GWM). More details: GPS in port C1
cat /dev/gps0
  • Monitor PPS pulse received from GPS connected to C1 (or Com1 for GWM). More details: GPS in port C1
ppswatch -a /dev/gpspps0
  • Display time offset with ntp server ntp1.aso.ee
ntpdate -d 195.80.105.226
  • Display connected NTP devices
ntpdc -n -c monlist

Logs & files

  • Display content of console.log
cat /var/log/telem/console.log
  • Follow the content of console.log
tail -f /var/log/telem/console.log
  • Follow the content of console.log, only show lines containing phrase "DI23"
tail -f /var/log/telem/console.log |grep DI23
  • Save a TCP capture log from eth2, TCP port 2404, to file tcplog1.pcap (Wireshark compatible)
tcpdump -i eth2 -n  tcp port 2404 -w tcplog1.pcap

In case of saving many additional logs to the device, please consider the amount of free flash space on the device (df -h)

  • Edit the file named log-conf.xml (changes will be lost after reboot)
 nano /usr/local/etc/telem/log-conf.xml

Configs

  • List old GWS configs available
/etc/init.d/S11telem-config list-old
  • Load old GWS config number 3
/etc/init.d/S11telem-config old 3 

Application statistics

  • Display application start history
cat /var/local/telem/stats/app-start-time
  • Display application start count
cat /var/local/telem/stats/app_start_count
  • Display device boot count
 cat /var/local/telem/stats/boot_count

Networking

  • List available interfaces, IP addresses & Rx/Tx stats
ifconfig
  • Dispaly active Internet connections (servers and established)
netstat -lna
  • List current rules in iptables
iptables -L
  • Display kernel IP routing table
route

Modem Statistics (GWM)

 cat /var/log/modem.st