call the top command in non-interactive mode through other programs or scripts, often appear :
top: failed tty get error
solution: add the -b option to either
-b: Batch mode operation
Starts top in < A1> < AF> Batch mode< A1> < AF> You< which could be useful for sending output from top to other programs or to a file. In this mode, top will not accept input and runs until the iterations limit you< A1> < AF> ve set with the < A1> < AF> -n< A1> < AF> command-line option or until killed.
for example: top-bn 1
nohup top-b | grep init > > top.log & (Top. Log content is displayed slowly)
nohup /usr/bin/top -b | grep init > > top.log & (top. Log content appears fast)
Read More:
- QuartusII software exception: error: top level design entity “” is undefined
- Two methods of fixing WPF menu bar after scrolling to the top
- Invalidation of margin top property of nested box in CSS style box
- Top35: pychar reports an error when connecting to MySQL server returns invalid timezone. Need to set ‘servertimezone’ property
- Open the top left corner of the chrome page to display the volume and playback chrome.exe Problem solving
- The background object of thymeleaf is null, which solves the problem of error when the object is empty to get the property value
- Error kernel restart: restart failed was reported in the background of jupyter notebook
- Docker CentOS Failed to get D-Bus connection: Operation not permitted
- Execution failed for task ‘:app:processDebugManifest’.
- Execution failed for task :Test:lintVitalRelease/Lint found fatal errors while assembling a release
- Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’
- [problem solving] Error:failed to get canonical path of /cow
- Execution failed for task ‘:app:mergeDebugResources’.
- Running bat batch file in background
- Windows batch: File running in the background
- Error:Execution failed for task’:app:processDebugResources’. Personally resolved
- Execution failed for task ‘:app:stripDebugDebugSymbols‘.
- Failed to get D-Bus connection: No such file or directory
- Execution failed for task ‘:app:processDebugManifest’
- To solve the execution failed for task ‘: app:transformDexArchiveWithDexMergerForDebug ‘