Reputation
2,174
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
13 32
Impact
~332k people reached

Apr
5
comment Bash Script to Drag and Drop a File to New Location
It should be emphasised that you always need to quote the variables, as shown. Using $file instead of "$file" (or "${file}") can get you in a heap of trouble.
Apr
5
answered How to add accents etc to letters using the “English (UK)” input source?
Feb
22
comment Is there a way, ideally using the command line, to convert multiple .csv files to one multi-sheet .xls spreadsheet?
It is vital to quote the variables, as "$i" "${i%.*}".xls, otherwise any file name containing a space will break the command (and potentially overwrite an unrelated file).
Feb
22
comment How can I get my laptop's monitor size?
As a side note, one inch equals 25.4 mm exactly.
Feb
16
comment Is swap area required? Can we install Ubuntu without a swap area?
I have 4Gb RAM, and my machine uses swap when I use memory-intensive tasks. For example, I have a large LibreOffice document with many large images, and when I edit this, my swap is used. Without swap, my machine crashes. So, I recommend swap regardless.
Feb
16
comment Ubuntu settings after adding additional RAM
On a system with 8Gb, swap may be used for high memory-intensive tasks such as extensive editing of large videos. However, swap is also used for hibernation. If you want to hibernate, your swap must be at least as large as your RAM. If you intend never to hibernate, 4Gb will be plenty for normal use.
Feb
7
comment How can I further secure my system using 2 factor authentication?
@TheBrownOne I've just realised why the login doesn't work with one of the accounts. It has an encrypted home folder, so LightDM is unable to see ~/.google-authenticator. There must be a way around this, but I haven't (yet) figured out how. So, it's only the gksudo problem that remains. Also, pkexec works (although it's a poor replacement for gksudo).
Feb
7
comment How can I further secure my system using 2 factor authentication?
@TheBrownOne Thank you for your reply. I have tested this in VirtualBox with two test accounts. (It appears that you can turn off two-factor authentication by deleting ~/.google-authenticator). One account works for login, while the other ignores two-factor and allows login without it. Both accounts work for sudo. Neither account works for gksudo, which asks for the password and then fails. Do you have an easy answer for the two problems, or shall I post a new question? Thanks again for your time and effort.
Feb
6
comment How can I further secure my system using 2 factor authentication?
@TheBrownOne Thank you for such a well-written solution. Regarding your note under the System-Wide and TTY Log-In: Are you saying that if I do this step, I should omit the steps for SSH, sudo Requests and LightDM (GUI Log-In)? Also, have I correctly understood that any user who has not set up Google Authenticator will not notice any difference, even if he is an administrator? Finally, how does a user turn off two-factor authentication?
Jan
12
comment giving a short name for frequently opened directory via terminal
I use autojump, and it works well. The best thing is that it learns from your use. I didn't know about jc, so that's something for me to look at.
Jan
12
comment Prevent all commands from being defined as an alias
I'd still like to know why you'd want to do this, @Afshin.Hamedi. For example, I might want to alias grep to grep --color=always so that it always shows colour, or rm to rm --interactive so that it always prompts me. What makes you want to prevent this?
Jan
12
comment Delete PPA after install the software?
@cmyk If you mean the PPA for the source code, I always delete that PPA, even before installing or updating the package, because I have no need or use for the source code. (You've probably noticed that adding a PPA usually adds the PPAs for both the executables and the source code.) If you don't use the source code, you can safely delete the PPA for the source code.
Dec
22
comment 000 permission for a single file is not working well
You don't need to use sudo to change the permissions for your own files. Hence, chmod 000 Desktop/*.gif will do just as well.
Dec
15
comment Merge files using a common column
Thanks, but where can I get this q package? I don't seem to be able to install either python-q-text-as-data or python3-q-text-as-data. "E: Unable to locate package python3-q-text-as-data". My system already has installed python, python2.7, python3, and python3.4.
Dec
8
comment Why does ^C, ^V etc. appear in the terminal when I use the Ctrl+character keyboard shortcut?
The use of the caret ^ as a symbol for "control" dates back to pre-graphic times when terminals were text-only, and I believe even before then when we had cards and paper, no terminals. I'd love to know why the caret was chosen as the symbol.
Dec
3
comment Why doesn't Ubuntu remove old kernels automatically?
@idbrii, that's interesting, because the last time that I tried it, it did remove kernels other than the most recent two. I wonder what could differ between our systems?
Nov
3
comment Will Ubuntu replace dpkg with snappy?
@RobieBasak, thanks for answering. Once Snappy has been fully developed, will it replace dpkg and apt? If so, will it still handle '.deb' packages (to install the many applications still not available in repositories)?
Oct
15
awarded  Notable Question
Oct
13
comment Is there any way to allow user to execute commands for 2 days only
I am horribly confused. How does piping the output of a command through at prevent the command from running until the specified time? In my tests, the command runs immediately, and the at command has nothing to run (which is what I expect). Surely it needs to be more like this: echo 'sudo mv /etc/sudoers.d/yourfile /etc/sudoers.d/.yourfile' | at 2pm + 2 days ? What have I misunderstood?
Sep
29
comment What's the difference between <<, <<< and < < in bash?
Another example of where piping cannot be used: echo 'foo' | read; echo ${REPLY} will not return foo, because read is started in a sub-shell — piping starts a sub-shell. However, read < <(echo 'foo'); echo ${REPLY} correctly returns foo, because there is no sub-shell.