What are some useful commands to know when working with Linux?
Navigate to the /etc/init.d folder.
Enter ./bcreporter start to start it.
Enter ./bcreporter stop to stop it.
Navigate to the /opt/bc/reporter folder.
Enter ./bcreporter.
NOTE: If you want Reporter to remain running after you terminate your SSH session, insert the nohup command in front; for example: nohup bcreporter.
Navigate to the /etc/init.d folder.
Enter ./bcreporter status.
Navigate to the /opt/bc/reporter folder and look for the Reporter binary; for example:
From any folder, enter RPM -qa | grep reporter.
Navigate to /opt/bc/reporter/journal/.
Enter cat jour and then press the Tab key. This action displays all of the journals.
NOTE: In some versions, this journal file is found in the installed root folder.
Enter cd to change directories.
Enter pwd to find out where in the file system you are.
NOTE: For a directory listing, enter ls -l.
Enter uname -a to display the kernel version.
Enter cat /etc/redhat-release to dispaly the Red Hat® version.
Enter jobs -l.
The result of this command might indicate bcreporter is running in the background but stopped:
[1] + Stopped (user) /opt/bc/reporter/bcreporter
NOTE: If you start Reporter in a terminal window (you used SSH to connect to the Linux server and started it that way) and you terminate the connection, Reporter also stops.
Enter fg 1.
This action immediately starts Reporter and displays the login screen (to the same screen you are currently on).
NOTE: You must use the number of the process that the jobs command showed was stopped.
Place Reporter in the Background
Enter bg 1.
This action restarts Reporter in the background.
NOTE: If you start Reporter in a terminal window (you used SSH to connect to the Linux server and started it that way) and you terminate the connection, Reporter also stops.
Enter uptime.
Enter cat /proc/meminfo.
Navigate to the opt/bc/reporter folder.
Enter df -h.
Navigate to where Reporter is installed.
Enter ldd bcreporter.
NOTE: If you start Reporter in a terminal window:
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ba56fc38000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002ba56fe52000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002ba570056000)
libm.so.6 => /lib64/libm.so.6 (0x00002ba570357000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002ba5705da000)
libc.so.6 => /lib64/libc.so.6 (0x00002ba5707e8000)
/lib64/ld-linux-x86-64.so.2 (0x00002ba56fa1c000)
Enter ps -aux | grep reporter.
Use the following wget command:
NOTE: Verify that you have downloaded the correct Blue Coat RPM to your LINUX service before executing the following step. See the article at the end of this document for more details.
From any location, enter rpm -Uhv Reporter_9*.rpm.
The action results in installation to /opt/bc/reporter.
For custom directory, execute the following command:
rpm -Uhv --prefix=<custom-directory> Reporter_9*.rpm
After installing, run the do-startup.sh script to configure the admin password, license, and start Reporter. The upgrade automatically begins the process.
From any location, enter rpm -e bcrep and press Tab (to find the correct syntax)
Navigate to /opt/bc/reporter.
Enter do-cleanup.sh.
NOTE: This action removes all the remaining folders.
Enter rpm -qfi /usr/lib/libldap.so.
NOTE: Whenever you run a executable in LINUX, you must prefix it with ./. This ensures that LINUX finds the executable in the same folder that you are currently in and runs it.
Enter ifconfig.
Enter netstat -a.
NOTE: You can pipe this to the grep command to find Reporter.
From the Terminal window, execute the following command:
cat /proc/cpuinfo
NOTE: At the bottom of the output, you'll see flags. If the server is a 64-bit server, it's an lm flag.
Example:
cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 1
cpu MHz : 2793.136
cache size : 1024 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss
TIP: To find out where Reporter is installed on LINUX without using an RPM command (because it was not installed by RPMS):
Navigate to the root of the file system and execute the following commands:
Enter [root@vm207 /]# find -type d -name reporter
NOTE: Substituting -name for -iname in the above command makes the Find Command insensitive to case.
To find any file (such as the httpd.conf file), use the following command
Enter root@vm207 /]# find / -name httpd.conf
If you need to remove the .done extension from previously processed logs, you can do this with a single command for all logs in a directory:
- Navigate to the directory containing the log files
- Run this command to remove ".done" from all logs that have previously been processed:
for i in `ls | grep '\.done$'`; do mv $i `echo $i | sed -e 's/\.done$//g'`; done