LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices

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.
Old

mimeopen: a nice tool to setup default applications

Posted 10-05-2013 at 12:06 AM by the 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"...
Member
Posted in Uncategorized
Views 480 Comments 0 the dsc is offline
Old

Append something to the top of a file, in bash, without a temporary file

Posted 09-21-2013 at 03:04 PM by the dsc (linux-related notes)
Updated 09-21-2013 at 03:06 PM by the 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...
Member
Posted in Uncategorized
Views 307 Comments 0 the dsc is offline
Old

News: Konqueror file manager is as awesome as it was before

Posted 09-05-2013 at 04:44 PM by the 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.

The only...
Member
Posted in Uncategorized
Views 225 Comments 0 the dsc is offline
Old

Tip: creating symlinks to another folder

Posted 09-01-2013 at 07:46 PM by the dsc (linux-related notes)
Tags symlink

The syntax of "ln" requires full path information of the "source" file. Therefore, if you issue something like "for file in *.foo ; do ln -s ./$file /other-folder/somewhere/$(echo $file | sed s/foo/bar/) ; done", the produced symlinks will be empty.

To avoid that, the command must be:

for file in *.foo ; do ln -s $PWD/$file /other-folder/somewhere/$(echo $file | sed 's/foo/bar/') ; done

$PWD, the environment variable of the...
Member
Posted in Uncategorized
Views 236 Comments 0 the dsc is offline
Old

Ignoring lines starting with space, and other patterns in bash_history

Posted 08-25-2013 at 11:18 PM by the dsc (linux-related notes)
Updated 08-25-2013 at 11:22 PM by the dsc

It may be a little bit unsafe to have "rm something" commands in your bash history, if you also have the history easily accessible through up and down keys.

The following line will make bash history ignore "rm" and "shutdown":

Code:
export HISTIGNORE="&:rm *:shutdown *"
I don't know the syntax, but it works.

Some people have add there an expression to make bash's history ignore any line starting with...
Member
Posted in Uncategorized
Views 417 Comments 0 the dsc is offline

  



All times are GMT -5. The time now is 08:55 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration