EightBitTony
  • Member for 10 years, 7 months
  • Last seen more than a month ago
File permission issues with shared folders under Virtual Box (Ubuntu Guest, Windows Host)
Accepted answer
198 votes

The regular way of getting access to the files now, is to allow VirtualBox to automount the shared folder (which will make it show up under /media/sf_directory_name) and then to add your regular ...

View answer
How to disable auto suspend when I close laptop lid?
Accepted answer
192 votes

Edit /etc/systemd/logind.conf and make sure you have HandleLidSwitch=ignore which will make it ignore the lid being closed. (You may need to also undo the other changes you've made.) Then, you'll ...

View answer
Kill many instances of a running process with one command
Accepted answer
136 votes

What's wrong with the good old, for pid in $(ps -ef | grep "some search" | awk '{print $2}'); do kill -9 $pid; done There are ways to make that more efficient, for pid in $(ps -ef | awk '/some ...

View answer
Logrotate: "log does not need rotating" why?
Accepted answer
76 votes

Most likely, the log file is less than a day old and/or has been rotated within the last day and logrotate remembers the history. If you add -f it'll force a rotation if you really want to (although ...

View answer
Is ~/Mary a relative path?
73 votes

No, it's not relative. It's a full path, with ~ being an alias. Relative paths describe a path in relation to your current directory location. However, ~/Mary is exactly the same, no matter which ...

View answer
What's the standard for indentation in shell scripts?
Accepted answer
55 votes

There is no standard indentation in shell scripts that matters. Slightly less flippant answer: Pick a standard in your team that you can all work to, to simplify things. Use something your editor ...

View answer
How to view a binary file?
51 votes

Various people have answered some aspects of the query, but not all. All files on computers are stored as 1's and 0's. Images, text files, music, executable applications, object files, etc. They ...

View answer
How to force ssh client to use only password auth?
47 votes

As well as the method posted by scoopr, you can set per host options in your ssh client configuration file. In your .ssh directory, create a file called config (if it doesn't already exist) and set ...

View answer
Why using more threads makes it slower than using less threads
47 votes

"Why does this happen?" is kind of easy to answer. Imagine you have a corridor that you can fit four people down, side by side. You want to move all the rubbish at one end, to the other end. The ...

View answer
Make multiple edits with a single call to sed
Accepted answer
43 votes

You can tell sed to carry out multiple operations by just repeating -e (or -f if your script is in a file). sed -i -e 's/a/b/g' -e 's/b/d/g' file makes both changes in the single file named file, ...

View answer
Allow user to run a command with arguments (which contains spaces)
40 votes

Write a script (writeable only by root) In that script, execute the grep you need In the sudoers config, allow only access to that script Configure whatever tool or advise whichever user to just run ...

View answer
Best way to use a shell with Cygwin in Windows 7
Accepted answer
37 votes

MinTTY - here. It makes Cygwin entirely usable on Windows. I would be lost without it. Based on the original PuTTY code, but integrates straight into Cygwin (and in fact, is bundled with Cygwin). ...

View answer
What is the difference between /etc and /usr/local/etc
Accepted answer
32 votes

/usr/local is usually for applications built from source. i.e. I install most of my packages using something like apt, but if I download a newer version of something or a piece of software not part ...

View answer
How to add a user to sudoers file?
Accepted answer
30 votes

You need to have root access to add a user to the sudoers file. So either su - root (and put the root password in) and then use visudo as root to make the relevant and correct changes, or ask ...

View answer
How to dump a man page?
29 votes

Man pages are usually troff pre-processed files, and you can get to the plain text with, groff -t -e -mandoc -Tascii manpage.1 | col -bx > manpage.txt groff is a wrapper for troff. More ...

View answer
Using /dev/random, /dev/urandom to generate random data
Accepted answer
28 votes

You can use od to get numbers out of /dev/random and /dev/urandom. For example, 2 byte unsigned decimal integers, $ od -vAn -N2 -tu2 < /dev/urandom 24352 1 byte signed decimal integer, $ od -...

View answer
Using wget, What is the right command to get gzipped version instead of the actual HTML
Accepted answer
24 votes

If you request gzip'ed content (using the accept-encoding: gzip header, which is correct), then it's my understanding that wget can't then read the content. So you will end up with a single, gzipped ...

View answer
Can I re-attach to a detached mosh session?
Accepted answer
23 votes

You can't. Once the client is dead, you can't re-attach to the server session. https://github.com/keithw/mosh/issues/394 For security reasons, you can only resume a connection to a mosh-server ...

View answer
Which folder should I write to for my intermediate files, as a dev?
Accepted answer
21 votes

I find the Filesystem Hierarchy Standard document invaluable when looking for this stuff. There are a few options, /tmp - 'non-permanent' temporary files /var/tmp - 'permanent' temporary files /var/...

View answer
How to read Word .doc files?
Accepted answer
19 votes

If you want a graphical solution, then you might be able to open them with Open Office or Libre Office. There's also antiword Antiword is a free MS Word reader for Linux and RISC OS. There are ports ...

View answer
How can I list all user names and/or home directories?
18 votes

A better way to list user home directories, is to parse /etc/passwd and extract them from there, and not make any assumptions about where they may be. And judging by your second comment, you actually ...

View answer
Stop ImageMagick from rotating image on append
Accepted answer
17 votes

Try adding -auto-orient to the command you're running, $ convert -auto-orient img1.jpg img2.jpg +append both.jpg Your images have EXIF data telling your viewer which way to present them, but without ...

View answer
How to chmod without /usr/bin/chmod?
16 votes

First things off the top of my head, Boot from any other source (network book, cd, etc.) and use the chmod on that source to set the permissions. Write a tiny C program to change the permissions. ...

View answer
Alternative to `pkill` or `pgrep -f` on cygwin?
16 votes

pkill and pgrep certainly exist within Cygwin, in the procps package (you can search cygwin packages here). It appears to work for me, tony:~$ nohup sleep 100983 & [1] 5476 tony:~$ nohup: ...

View answer
Why does "man" command disappear?
Accepted answer
13 votes

I doubt we'll ever be able to tell you where it went, but you should just be able to reinstall it using yum. yum reinstall man yum doesn't check to see if files exist when you run yum install, it ...

View answer
Is "/etc/issue" common for all Linux distributions?
13 votes

In addition to slm's answer, it's worth remembering that anyone (with root access) can edit the content of /etc/issue. Some organisations may do so to present pre-login warnings or disclaimers, and ...

View answer
Does AIX really beat Red Hat Enterprise Linux?
13 votes

If you're going to the expense of buying IBM pSeries servers, then generally, in broad terms, you may as well run AIX on them which is specifically crafted to drive the hardware as efficiently as ...

View answer
File permission execute only
Accepted answer
13 votes

You need both read and execute permissions on a script to be able to execute it. If you can't read the contents of the script, you aren't able to execute it either. tony@matrix:~$ ./hello.world ...

View answer
UID of a deleted account
Accepted answer
12 votes

By looking at /etc/passwd in the backups taken of your system from the day/week/period before the user deletion. If userdel was used with -r, then both the home directory and user's mail spool have ...

View answer
How can I call other shell script like a subroutine?
Accepted answer
12 votes

You don't say which shell you're using, so assuming bash, you just do #!/bin/bash /path/to/other/script arg1 arg2 rc=$? The variable rc now contains the return code from your other script. ...

View answer
1
2 3 4 5
8