command-line-interface

Sorting down processes by memory usage

…衆ロ難τιáo~ 提交于 2019-12-13 05:01:06
问题 I am able to see the list of all the processes and the memory via ps aux and going through the VSZ and RSS column data. Is there a way to sort down the output of this command by the descending order on RSS value ?. PS : This is a newbie question as I am very much new to Unix/Linux. ubuntu 回答1: RSS is the 6th column, so you can do it as follows: ps aux | sort -k6,6 -rn sort based on column 6 only (the comma on 6,6 makes it, thanks twalberg), numerically and reverse (the biggest number first).

Screencapture -l : illegal option?

不问归期 提交于 2019-12-13 04:33:15
问题 I've seen in many pages here on SO (for example here: https://apple.stackexchange.com/questions/56561/how-do-i-find-the-windowid-to-pass-to-screencapture-l) that you have to use the command: screencapture -l in order to capture a single window given its ID. However when I try to enter screencapture -l into the terminal I get this error: screencapture: illegal option -- l I've checked a reference and actually I can't see -l as a possible attribute for screencapture: http://guides.macrumors.com

Objective-C: Comparing user input with object's instance variable

断了今生、忘了曾经 提交于 2019-12-13 04:32:07
问题 I have been learning Objective-C for a while, and I decided to try and take on a little bigger project without any real "guidelines" as in the learning books but now I have got stuck. What I'm trying to do is helping a friend digitalising a few documents he have, by creating a searchable commandline-tool for these documents. I think I have gotten pretty far, I have created a custom class for documents with three variable; name of the author, number of the article and the path to the file on

Reading values into a List object - Object reference not set to an instance of an object

筅森魡賤 提交于 2019-12-13 04:29:54
问题 Trying to load values into a List object, I get the "Object reference not set to an instance of an object" error. (edited question to simplify it) MyVec.h listing (essentials only): ref class MyVec { public: List<double>^ MyVector; MyVec(void); }; MyVec.cpp listing (essentials only): #include "MyVec.h" MyVec::MyVec(void) { } Form.h listing (essentials only): MyVec^ TestVec = gcnew MyVec(); double MyDouble = 1.002; TestVec->MyVector->Add(MyDouble); textBox1->Text = TestVec->MyVector[0]

Convert many argparse conditional arguements to a more pythonic solution

為{幸葍}努か 提交于 2019-12-13 04:26:28
问题 I am working on a cli application using python. I have a set of arguments that are mutually exclusive and a set of arguments that must be there if one of those mutually exclusive arguments is passed. I have got it working using brute force and lengthy if conditions, but I feel like there is a neat way to do this. Researching about that told me subparsers might be useful, however I am not able to correctly use subparsers at all. The conditions I want are the following- Main activities +-----+-

Commands color in spring shell 2

时光毁灭记忆、已成空白 提交于 2019-12-13 04:20:06
问题 In SPRING SHELL 2 the default incorrect command and error output colors are red. Is it possible to define custom colors for these purposes? Thank you! 回答1: What happens when execution of a command ends up throwing an exception is handled by ThrowableResultHandler , whose implementation use RED to display text. If you want to customize this, just override that result handler. 来源: https://stackoverflow.com/questions/52187292/commands-color-in-spring-shell-2

Why cannot run an executable file with exec() or system() functions?

邮差的信 提交于 2019-12-13 04:14:13
问题 I'm trying to run notepad on the server ( localhost for now). exec() and system() functions are working fine when for example write ping 127.0.0.1 . But this does not work (working fine if I write the command directly in the command prompt): $command = "C:\WINDOWS\system32\notepad.exe"; $result = system($command); print_r($result); Using Windows XP with xampp . Probably I don't have permissions because the command is executed from some other account but I don't know how to check this. Any

How to add data to last column of CSV using PowerShell?

有些话、适合烂在心里 提交于 2019-12-13 03:57:39
问题 I have a requirement to add data to the last column of a CSV file. The test file I have looks like: NAME,AGE,OFFICE,DEPT,SKILL jack,24,IBM,Retail tom,32,MS,BFSI SAM,44,MGR,Test I have managed to parse the CSV but then adding data to the last column "SKILL" is difficult. The requirement is to add the word 'Java' to the last column on each row NAME,AGE,OFFICE,DEPT,SKILL jack,24,IBM,Retail,Java tom,32,MS,BFSI,Java SAM,44,MGR,Test,Java Please note that the value added to the last column remains

When useing PHP CLI - APC crashes apache - apc_fcntl_lock failed errno:6

梦想的初衷 提交于 2019-12-13 03:18:37
问题 I've already solved the problem, but I'll post it here for future reference and maybe it will help someone :) The Problem: After running PHP from command line with custom php.ini Apache crashes and throws this error apc_fcntl_lock failed errno:6 . My configuration: I've got easyPHP with PHP 5.3.8 and APC installed. APC works fine for my applications run by easyPHP (Apache server). I am useing Symfony2 framework and it comes out with nice code generators run from command line, for example: php

CTRL+Z command in a batch file

霸气de小男生 提交于 2019-12-13 01:31:05
问题 I looked up for answer to my question on many different websites but nothing. I am creating a batch file which is as follow: @echo off md C:\Users\John\Desktop\languages cd C:\Users\John\Desktop\languages md italian md french md german md spanish cd C:\Users\John\Desktop\languages\tedesco copy con kartofeln.txt This is the message I want to add into my text file ***CTRL + Z*** how can I now write an executable command "CTRL + Z" in order to close this file and continue my coding?? I want to