Tag Info

Hot answers tagged

11

No, the sd* names are assigned sequentially, based on which disk was detected first. If you need a persistent name, udev already provides them based on several properties such as filesystem labels / UUIDs; partition labels / UUIDs (GPT only); disk attachment paths; SCSI WWNs; and so on. Take a look at /dev/disk: ┌ rain ~ ┘ tree /dev/disk/ /dev/disk/ ├── ...


10

Another solution is to use Process Substitution in Bash. If your system has named pipes, you can use this feature. It is used like this: program_expecting_a_file <(list) where list is a sequence of shell commands (actually pipelines; the full details are here). list will be executed, and its output will be connected to the pipe. The name of the pipe ...


10

Use SetGID permissions on the web root directory, and propagate them to the children. When you apply SetGID on a directory, all new items in that directory will be created with the same group their parent has, regardless of the users default group membership. To apply SetGID to a filesystem object, use chmod with a 2 in front of the permission code. (eg: ...


9

tl;dr You don't need a quantifier, just grep for PROC: ls | grep PROC long version The asterisk in your ls line, is not the same as the one in your grep line. When you have an unescaped asterisk on the command line, the shell will expand it before ls sees it, this is called globbing. An asterisk alone expands to all files in the current directory, try ...


6

"add the binary to your path to make it available on the command line" In unix, the PATH is the environment variable which defines where the shell looks for executable programs to run when you enter them on the command line. If you do a: echo $PATH You can see what your PATH looks like. All of the directories on the PATH are then searched (in ...


6

Depending on what is in the script, you may be able to use the special filename - (minus) which stands for stdin $ mycmd - Line 1 Line 2 ^D Another method which may work for you is to open the file /dev/fd/0 which again stands for stdin. A third option may be to create a FIFO (First In First Out). That is like a file, but it has two ends to it - you ...


6

Of course. You can do it as a dual boot or using a virtual machine.


5

Argument list too long is not an error specific to tar. It is an error (E2BIG) of the execve(2) syscall (given by the kernel, which has to put some limitations on execve to avoid spoiling memory). So your shell (which fork-s then execve-s the /bin/tar program) tells you that error message. It could be difficult to increase that limit (perhaps some sysconf, ...


4

Put a linux version on a USB drive and restart your computer with the drive in the USB port. Go to the BIOS menu, choose "Boot from USB" and follow instructions for Linux installation. It comes with an option to be able to Dual Boot Windows and Linux, so choose that. You have the option to create a partition drive on your HDD for Linux.


4

You can use a bash here-doc. For example, $ cat -n <<<'a > b' 1 a 2 b If you have something in a bash variable you can also interpolate it: eg <<<"path is $PATH". If your command insists on a filename you can give it /dev/stdin. Eg: $ sed -f /dev/stdin <<<'s/a/b/' produces the output: s/b/b/.


4

Try Recuva. It is the the only Windows utility I have found which handles non-Windows friendly filenames. Enable Scan for non-deleted files (for recovery from damaged or reformatted disks) and scan your folder. On restore, enable Restore folder structure. Recuva will effectively "copy" the entire directory to another location while "santitizing" ...


4

The tutorial has you download PHP from a third party repository named webtatic. The operator of this repro has compiled the source tarballs of various versions of PHP that are not in the official CentOS repository. Presumably the 'w' stands for 'webtatic', to differentiate these packages from the official CentOS ones.


4

Sure: ProxyCommand "~/bin/connect-via-dropbox %h %p" …where the connect-via-dropbox script would look up the IP address from your Dropbox, then connect to it using nc, socat, or ncat. For example: #!/bin/sh host=$1 port=$2 file="$HOME/Dropbox/Server IPs/$host.txt" if [ ! -s "$file" ]; then echo "error: '$file' empty or not found" >&2; ...


4

In the line -rw-r--r-- 1 root root, the first dash character indicates a file without any special permissions on it. The next 3 characters "rw-" indicate that the owner of the file can read and write to the file, but the file is not executable. I.e., it isn't a program that you could run. If it was also executable, you would see "rwx" rather than "rw-". ...


3

On your command-line press Ctrl-u (it stores it in the kill-ring), issue the other one mkdir for example, and then press Ctrl-y.


3

The reasons could be various, of course. The most obvious answer is that, for one reason or another, you cannot be authenticated by the remote system. However, since you are outputting the directory permissions on the remote system, I assume you have the rights and ability to access it by some means (but perhaps not by ssh). So, the first thing to do is ...


3

In bash, you should use $(...) to store output of a command, not &(...). aux=&(...) is interpreted as aux= and (...) connected by &, i.e. it clears $aux in the background, and runs the bc in a subshell.


3

Recent Cygwin updates have changed its X server to not listen for TCP connections by default. Instead, Cygwin's X uses (the Cygwin implementation of) Unix domain sockets, and PuTTY (as a native Windows program) doesn't know how to use these. The Cygwin X FAQ and Cygwin mailing lists have more details. My solution was to take the standard Cygwin shortcut ...


3

I ran into this problem after upgrading my server to F21 from F20. Disabling the firewall altogether let Kodi find and mount the NFS shares, but I was uneasy about having no firewall at all on the server. I've done: firewall-cmd --add-port 1024-65534/tcp --add-port 1024-65534/udp --add-port 111/tcp --add-port 111/udp Which opens up everything above the ...


3

sudo -s runs the shell specified in your $SHELL environment variable as the superuser/root. You can specify another user using -u. The $SHELL environment variable contains the path to the user's default login shell. The actual setting for the default shell program is usually in etc/passwd. Depending on what you've done in your current session, the $SHELL ...


3

In your example, $var and ${var} are identical. However, curly braces are useful when you wish to expand the variable in a string: $ string=foo $ echo ${string}bar foobar $ echo $stringbar $ Thus the curly braces provide a means of substituting the variable in order to get the name of new variable, itself to be substituted.


3

$(command) is “command substitution”.  As you seem to understand, it runs the command, captures its output, and inserts that into the command line that contains the $(…); e.g., $ ls -ld $(date +%B).txt -rwxr-xr-x 1 Noob Noob 867 Jul 2 11:09 July.txt ${parameter} is “parameter substitution”.  A lot of information can be found in the shell’s man page, ...


3

No, you do not need it. Your disk and filesystem will work fine without partition table. Some older BSDs even did this by default if you selected dangerously dedicated. However it is highly recommended for compatability reasons. Somewhat more verbose: You can run mkfs.ext4 directly on /dev/sdb. That will work. You then can mount that without problems. ...


3

Good question. I tried what I now realise you must have tried- scheduling a shutdown and querying the systemd timers! That showed that the shutdown was not in the systemd timers, as you noted. So then a quick perusal of the systemctl source gives us this call, as part of halt_main(): r = sd_bus_call_method( b, ...


3

You can use the Bash command substitution feature: python test.py command --option 1 $(<file.txt) From man bash: Command substitution allows the output of a command to replace the command name. There are two forms: $(command) or `command` Bash performs the expansion by executing command and replacing the command substitution with the standard ...


2

It seems as though it is possible to at least get to a start of this. After grabbing R 3.2.1 sources and untarring I did the following: mkdir localinstall ./configure --prefix=`pwd`/localinstall \ --without-tcltk \ --with-cairo \ --without-aqua \ --without-x \ --enable-R-shlib \ ...


2

a1) The public key authentication can work in two phases (as described in [RFC4252]). The first one is "MAY type" and the message contains the public key to verify on server that the user is able to be allowed to access this account with this key. This is made to avoid unnecessary processing and user interaction, especially when you send your public keys on ...


2

Lubuntu 14.04 LTS requires only 128MB RAM. Lubuntu 14.04 is a Long Term Support release that will be supported by updates until April, 2017. It is also the last of its breed, the later releases of Lubuntu require a minimum of 512MB RAM. Lubuntu 14.04 32-bit is compatible with your computer. Download it from the official Lubuntu/GetLubuntu/LTS webpage. ...


2

Not sure what you mean, but if you take for example debian on X86 or ARM it will work the same. The binaries are not compatible because the CPU architecture is not the same and everything had to be recompiled. When you are only using OSS this will be no problem most of the time (unless the code uses X86 assembler and you want to compile it for ARM, for ...


2

There are surely many ways to change it. Here is but one: #!/bin/bash if [ ! -f proto.h ]; then touch proto.h if for file_to_parse in `find -type f -name "*.c"`; do cproto $file_to_parse >> proto.h 2> /dev/null done The error is in the redirection in the cproto... line: the simple > first wipes the destination file, then writes ...



Only top voted, non community-wiki answers of a minimum length are eligible