Reputation
857
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
5 16
Newest
 Yearling
Impact
~151k people reached

Apr
7
comment Bash Script to Drag and Drop a File to New Location
This is the "obvious" way to do it and answers the question. But, if you use a script, that script can be arbitrarily complex and do different things depending on what file it is passed - like putting music files one place and documents in another place - or just changing the destination without having to replace the symlink.
Mar
16
comment Request root privilege from within a script
If you have a decent timeout value set in /etc/sudoers, then you can optionally put sudo in front of each command in the script which really needs root access and it will only ask once. One thing I often mess up is that calling such a script from a gui won't work because sudo gets /dev/null for password input and fails. That's what gksudo and kdesudo were designed to handle because they'll use the gui to ask for the password.
Mar
2
comment Print return value after program execution
+1 That actually works. I'm not doubting anybody with a 27k reputation, but apparently the prompt isn't a "command", so using $? in it doesn't get $? reset to zero like I thought it might be - even using the first method which executes echo with no errors.
Mar
2
comment Why do Windows & Ubuntu have similar shell commands?
While there's some truth to your answer, it's way too oversimplified to be useful. (And we used monitors or terminals with CP/M - not TVs ;) ) When I'm trying to figure out some obscure bash or sed command, I sometimes think back to those days when the OS hardly did anything for you, but it was easy to do - and I never ran out of memory on a 64k machine.
Feb
25
comment Difference between $'$foo' and $“$foo”
+1 Good answer. I would just add that quoting variables should be the default unless you have a specific reason not to - not just to handle possible null values. See unix.stackexchange.com/questions/171346/… for more than you ever wanted to know about this. ;)
Feb
17
comment Sharing SWAP and /home beteween Ubuntu 15.10 and Kali Linux 2.0
As Oli says, sharing /home sounds a lot better than it actually is. I tried it between 2 versions of the same distro - kubuntu - and had things go a bit crazy. One other thing to note: /home isn't the only issue. I currently dual boot between 12.04 and 15.04 which use different versions of grub. Every time I get a kernel update in one, it updates a grub menu that the other one doesn't look at. Have to keep fixing it manually or rewriting the mbr.
Feb
13
comment How to quickly get the reason for the most recent update of a package from the command-line?
+1 as promised. For icing on the cake: Is there a way to do that before installing an update - to see if I really need it, etc. - like if I have a modified version and want to know if it's worth the trouble of reapplying the modification to a new version.
Feb
12
comment How to quickly get the reason for the most recent update of a package from the command-line?
@mikewhatever - If you make that an answer, I'll upvote it. It works and I didn't know about it previously.
Jan
28
comment No more updates for Google Chrome | apt-get update error
You may also want to consider the Vivaldi browser. It's relatively new and under active development. It supports some chrome add-ons. Some of the folks are from the Opera browser community. vivaldi.com/download
Jan
20
answered Why should I move everything in /opt?
Jan
14
answered How to make custome shortcuts to work on key release than key press
Jan
14
comment Prevent all commands from being defined as an alias
+1 in general, but also specifically for classifying this as an X/Y problem.
Jan
3
comment How to use manual partitioning during installation?
Although many people go this route (and it works fine), I prefer to just boot up a standalone gparted distro and do all my partitioning first. I especially like that it "does" everything and shows you how it will turn out before it actually writes anything to the disk. That way, it's easy to say "oops" and just start over if you make a mistake or change your mind about any of the details.
Dec
29
awarded  Yearling
Dec
27
revised Bash script checking if specific Canon printer is online
Qualified it as applying only to Canon printers
Dec
27
suggested approved edit on Bash script checking if specific Canon printer is online
Dec
18
revised Where should I keep my personal files while keeping the pathname short?
added content
Dec
18
revised Where should I keep my personal files while keeping the pathname short?
added content
Dec
18
comment Where should I keep my personal files while keeping the pathname short?
Right. Generally, you would add the alias definition in .bashrc in your home directory, or , if you have it setup to be read, you can add it to .bash_aliases in your home directory. An alias only works at the start of a command line, but a function will work anywhere. They're just a bit more tricky to use for something like this.
Dec
17
answered Where should I keep my personal files while keeping the pathname short?