Aquarius Power
  • Member for 9 years
  • Last seen this week
find does not work on symlinked path?
Accepted answer
24 votes

Here is the answer. But that question points to bash as the target of the problem. The explanation is that find finds "$HOME/MySymlinkedPath". It's a symbolic link, not a directory, so the recursive ...

View answer
How do I find the X window ID under the mouse pointer in bash?
10 votes

try this, it uses only xdotool, but its version is at least "2.20110530.1" xdotool getmouselocation --shell | grep WINDOW to get the window id directly you can use this: sedGetValue='s/.*=\(...

View answer
How to monitor CPU/memory usage of a single process?
9 votes

To use that information on a script you can do this: calcPercCpu.sh #!/bin/bash nPid=$1; nTimes=10; # customize it delay=0.1; # customize it strCalc=`top -d $delay -b -n $nTimes -p $nPid \ |grep $...

View answer
Which file compression software for linux offers the highest size reduction?
6 votes

(updated answer) If time doesn't matter, use ZPAQ v1.10 (or newer) ex.: zpaq pvc/usr/share/doc/zpaq/examples/max.cfg file.zpaq file.tar (the max.cfg file location may vary, check on your installed ...

View answer
How can I reverse a video clip?
6 votes

kdenlive reverse clip https://userbase.kde.org/Kdenlive/Manual/Project_Menu/Reverse_Clip right-click on the clip: clip jobs / reverse clip

View answer
Is Gobolinux active any more?
Accepted answer
4 votes

Does anybody have some info about its state? It's had some things updated in 2013, so I believe someone is still running it. I tried to find out who via their mailing lists, but the lack of a new ...

View answer
How to disable the Forward/Back buttons on my mouse
3 votes

just a quick command to fix it, not really different from other answers: xmodmap -e "pointer = 1 2 3 4 5 6 7 0 0 0 0 0 0" #the fix testing xmodmap -pp # check the changes xterm -e xev # test the ...

View answer
unkillable/unstoppable normal user process, how to forcedly control it?
3 votes

I can avoid rebooting using the commands below: sudo cgcreate -g cpu:/cpulimited sudo cgclassify -g cpu:cpulimited 2315444 #the `find` pid cd /sys/fs/cgroup/cpu/cpulimited echo 1000000 |sudo tee cpu....

View answer
how to get the size of an indirect array in bash?
3 votes

From a tip here, I managed to do this: astr=(a b c) declare -n astrRef="astr" echo ${#astrRef[@]} This allows also to create such array or simply assign values thru indirection: declare -n astrRef="...

View answer
Storing output of command in shell variable
3 votes

This is yet another way to assign a variable, good to use with some text editors that are unable to correctly highlight every intricate code you create. read -r -d '' str < <(cat somefile.txt) ...

View answer
Escaping strings in associative arrays (bash)
Accepted answer
2 votes

First, create an array with the parameters. Then, store the array string value (found with declare -p) at parameters, and recover and use it as an actual array later on like in: #!/bin/bash ...

View answer
Colorizing your terminal and shell environment?
2 votes

You can try a project that helps on colorizing scripts output also, its named ScriptEchoColor at source forge: http://scriptechocolor.sourceforge.net/ ex.: echoc "@{lr}text output in light red" ...

View answer
is there some simple/clean way to make an "empty boolean variable" be evaluated as `false` on bash scripts?
2 votes

The simplest way is this: if ${bTest:?};then echo "is active";fi So I simply go from $bTest to ${bTest:?} and no need to deal with anything more complex like functions and aliases. Be concerned ...

View answer
how to make Tabs Outliner, for Chromium Browser, popup on mouse move to screen edge?
2 votes

ok, I managed to code a script for that, you may find it usefull to provide similar functionality to other situations. If yo do so I would like to know too :) Also if there is a better way to do that ...

View answer
is there some way to speed up gparted devices/partitions scanning?
1 votes

no, no need to patch. it is documented in the manual, and it took me more than a 2 decades (I think) to look at the manual: EXAMPLES You can run gparted from a command line and specify one or ...

View answer
Is it possible to resume fsck.ext4 using offset X?
1 votes

in case you only need to look for bad blocks, you can call badblocks directly. From the manual: first-block is an optional parameter specifying the starting block number for the test, which allows ...

View answer
Add autocompletion in dash
1 votes

Suggesting an alternative (@...) why dash? for me is the resident memory usage. (I use yakuake and each bash tab is 34MB here. dash is 708KB.) The problem is I am often typing bash to have ...

View answer
drop_caches fixes AUFS, why?
1 votes

Answering to: 'Is there some way to make the cache work properly?' (well to actually make aufs writes work properly) when mounting the aufs, it seems to ONLY work properly if we use -o sync toguether ...

View answer
how to determine how many times pid_max wrapped?
1 votes

This code is possibly precise enough for most common situations: #!/bin/bash count=0;pidPrev=0; while true;do echo -n & pidMax=$!; if((pidMax<pidPrev));then ((count++)); fi;...

View answer
How do I find which files are missing from a list?
1 votes

I think this can be useful too. This is a one line solution, in case you opt for your "list" be real files that you want to synchronize with another folder: function FUNCsync() { local fileCheck="$...

View answer
Blender can't copy text to WM clipboard, how to fix it?
0 votes

It was a problem related to parcellite. To make blender and parcellite cope, you have to disable parcellite's "Clipboard/UseCopy(Ctrl+C)" option, and let it work only using the "Primary(...

View answer
Unable to delete files to trash in a bind-mounted filesystem
0 votes

On nemo you can use this: place this file at: ~/.local/share/nemo/actions/trash.nemo_action [Nemo Action] Active=true Name=Move to Tra_sh(cli) Comment=Trash even on mount binds Exec=xterm -title "...

View answer
unable to list/access files inside schroot from a `mount --bind`
0 votes

schroot actually uses /run/schroot/mount/ubuntu_i386-... and for each new chroot on it, it uses a new huge ID after ubuntu_i386- just check the auto mount/binds already there with: mount |grep ...

View answer
"DxvkMemoryAllocator: Memory allocation failed" while running any WineHQ dxvk (d3d) game
0 votes

well, the way I am workarounding it is to run this: stress-ng --vm-bytes 5000M --timeout 15 --vm-keep --vm 1 --verbose as I have only 6GB of RAM. but before, it is good to SIGSTOP the wine game, and ...

View answer
how to change k4dirstat folder browsing action?
0 votes

configuring mimeopen -d SomeFolder wont affect xdg-open... so: $xdg-mime query filetype SomeFolder inode/directory $xdg-mime query default "inode/directory" nautilus-folder-handler.desktop $locate ...

View answer
how to let part of the regex (that is variable) be matched literally, ignoring control characters?
0 votes

I change the matcher this way: sedExact='s"(.)"[\1]"g'; strRegex=".*$(echo "$strFilenameToCheck" |sed -r "$sedExact").*";

View answer
Is it possible to control which monitor is considered the primary monitor?
0 votes

The OP speaks about ATI card, so I would like to suggest an alternative, specific to NVidia cards, but consider that the accepted answer more generic and would work for both... My monitors have ...

View answer
how to get the indexes of a referenced array in bash?
Accepted answer
0 votes

declare -n astrR="astr" from tips here: https://unix.stackexchange.com/a/390763/30352 (answered mainly to not be left as unanswered and calling unnecessary attention from other questions needing it)

View answer
filesystem/directory merging mount points as layers
0 votes

The flexibilest and most straight forward option I found was AUFS, ex.: mount -t aufs -o "br=CustomFolderToWriteAt:CustomTopOverriderFolder:CustomInBetweenOverriderFolders:CustomLowestPriorityFolder" ...

View answer
how to determine in what viewport (compiz/unity) a window is placed?
0 votes

It is actually very simple, the window viewport position information is relative to the current viewport. So, just type xwininfo and select a window. Now, change the viewport and type xwininfo -id 0x....

View answer