User Tools

Site Tools


Writing /app/www/public/data/meta/databaseandnetworkmanagement/useful_commands.meta failed
databaseandnetworkmanagement:useful_commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
databaseandnetworkmanagement:useful_commands [2017/05/05 16:34] mmccdatabaseandnetworkmanagement:useful_commands [2021/06/25 10:09] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Useful Commands ======
 +
 +===== File Search =====
 +
 +''locate SnmpManagerConfig.groovy''
 +
 +Will search for the file and display its directory.
 +
 +----
 +
 +===== Tailing Logs =====
 +
 +  * It is possible to tail the logs in real time using the following command: '' tail -f NameOfLogFile.log ''
 +  * It is also possible to tail and grep for a keyword using the following command: '' tail -f NameOfLogFile.log | grep 'myKeyword' ''
 +
 +----
 +
 +
 +===== Cat & Grep =====
 +
 +The following command is used to search all SnmpManager.log files in the current directory for the term 'myNetworkElement'. The results are then inputted into the text file 'myOutput.txt'.
 +
 +''cat SnmpManager.log* | grep 'myNetworkElement' > myOutput.txt ''
 +
 +----
 +
 +===== VI =====
 +
 +Vi has 2 modes:
 +  1. Command Mode - commands which cause action to be taken on the file
 +  2. Insert Mode - where text is inserted into the file
 +ESC key turns off insert mode
 +
 +**Exiting Vi**
 +     :x <Return> - quit vi, writing out modified file named in original
 +     :wq <Return> - quit vi, writing out modified file named in original
 +     :q <Return> - quit/ exit vi
 +     :q! <Return> - quit vi even though latest changes have not been saved
 +
 +**Window Motions**
 +  <ctrl>d Scroll down  (half a screen)
 +  <ctrl>u Scroll up  (half a screen)
 +  <ctrl>f Page forward
 +  <ctrl>b Page backward
 +  /string Search forward
 +  ?string Search backward
 +  <ctrl>l Redraw screen
 +  <ctrl>g Display current line number file information
 +  n Repeat search
 +  N Repeat search reverse
 +  G Go to last line
 +  nG Go to line n
 +  :n Go to line n
 +  z<CR> Reposition window: cursor at top
 +  z. Reposition window: cursor in middle
 +  z- Reposition window: cursor at bottom