command-line


Maven command to determine which settings.xml file Maven is using

Start maven with -X option (debug) and examine the beginning of the output. There should be something like this: ... [INFO] Error stacktraces are turned on. [DEBUG] Reading global settings from c:\..... Read More


macos - How to copy to system clipboard from tmux output after mouse selection?

If you are using iTerm2, you can copy text in Tmux session, holding down the Option key while dragging the mouse to make selection. Then it should be possible to paste text anywhere with Cmd + V as u... Read More


accessibility - How can I make terminal UIs accessible?

You could check out the following links if it helps: https://www.smashingmagazine.com/2017/03/interactive-command-line-application-node-js/#chalk https://pa11y.org/ https://zapier.com/engineering/how... Read More


How to empty ("truncate") a file on linux that already exists and is protected in someway?

You have the noclobber option set. The error looks like it's from csh, so you would do: cat /dev/null >! file If I'm wrong and you are using bash, you should do: cat /dev/null >| file in bash, you ca... Read More


shell - Why do you need ./ (dot-slash) before executable or script name to run it in bash?

Because on Unix, usually, the current directory is not in $PATH. When you type a command the shell looks up a list of directories, as specified by the PATH variable. The current directory is not in t... Read More


bash - Capture stdout and stderr into different variables

Ok, it got a bit ugly, but here is a solution: unset t_std t_err eval "$( (echo std; echo err >&2) \ 2> >(readarray -t t_err; typeset -p t_err) \ > >(readarray -t t_std; typeset -p t... Read More


windows - Find Process Name by its Process ID

The basic one, ask tasklist to filter its output and only show the indicated process id information tasklist /fi "pid eq 4444" To only get the process name, the line must be splitted for /f "delims=,... Read More


python - What is the purpose of the -m switch?

The first line of the Rationale section of PEP 338 says: Python 2.4 adds the command line switch -m to allow modules to be located using the Python module namespace for execution as scripts. The mot... Read More


linux - how do I check in bash whether a file was created more than x time ago?

Only for modification time if test `find "text.txt" -mmin +120` then echo old enough fi You can use -cmin for change or -amin for access time. As others pointed I don’t think you can track creati... Read More


unix - How to pretty print XML from the command line?

libxml2-utils This utility comes with libxml2-utils: echo '<root><foo a="b">lorem</foo><bar value="ipsum" /></root>' | xmllint --format - Perl'sXML::Twig This command comes with XML::Twig perl m... Read More