Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
Posted 11-19-2013 at 02:58 PM bythe dsc (linux-related notes)
In a script or routine usage, you may stumble for some reason with a file starting with "-".
"ls *.lol" command in that dir will return error if the next character doesn't happen to be an option of "ls", and/or if it is an option, but the next part isn't coincidentally an "argument", which is probably unlikely.
The same applies for commands such as mv and rm.
but to deal with it you can issue something like ...
Posted 10-18-2013 at 06:42 PM bythe dsc (linux-related notes)
Updated 10-22-2013 at 07:52 PM bythe dsc
Sometimes you may want to have some script periodically popping up some interface or something, but it may be somewhat abrupt, interrupt something you're doing with the mouse, or keyboard. So I came up with this tiny utility that will wait for the time given as a parameter, then exit.
Code:
#!/bin/bash
a=0
time=$1
if [ -z $time ] ; then time="1.2s" ; fi
while true ; do
mouse1=$( xdotool getmouselocation --shell
Posted 10-05-2013 at 12:06 AM bythe dsc (linux-related notes)
File association and default applications can be quite complicated, and hard to remember, specially if you have a hybrid environment, using stuff from Gnome, KDE, and whatever, while not being in none of the big ones, but on openbox or something.
One common source of problems are associations within web browsers, like firefox or chrome. They'll often have their own or use some secondary/wrong file association. I was having this problem with Google Chrome, "show in folder"...
Posted 09-21-2013 at 03:04 PM bythe dsc (linux-related notes)
Updated 09-21-2013 at 03:06 PM bythe dsc
Using echo "something" >> extantfile.wtv may be handy way to add something to a file, but it will only add to the end.
The closest thing one would more likely imagine to add something at the top would be something like combining echo/whatever and a cat into a temporary file, and then moving it into the old file. Or maybe something crazy with tac and rev.
But it's possible to skip the temporary file:
echo -e "$(grep -A 1 patternX source-of-bit-to-append)\n$(cat...
Posted 09-05-2013 at 04:44 PM bythe dsc (linux-related notes)
KFM is the best filemanager known to man. It may not be obvious to many because the defaults don't fully exploit its potential. But once you tweak it, and get used to it, you realize that everything else comparatively sucks.
In recent updates it had some feature reversals, losing italics for symlinks on the "normal" file listing, the instant dir filter, and in-line renaming, but all these features are back again, in recent Debian testing updates.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.