Tag Info

Hot answers tagged

55

I'll answer your questions in three parts: file types, permissions, and use cases for the various forms of chmod. File types The first character in ls -l output represents the file type; d means it's a directory. It can't be set or unset, it depends on how the file was created. You can find the complete list of file types in the ls documentation; those ...


55

I ran this: strace -o spork.out bash -c "echo 1234 >> some-file" to figure out your question. This is what I found: open("some-file", O_WRONLY|O_CREAT|O_APPEND, 0666) = 3 No file named "some-file" existed in the directory in which I ran the echo command.


50

This is all due to the fact that the X server is out-dated, ill-suitable for today's graphics hardware and basically all the direct video card communication is done as an extension ("patch") over the ancient bloated core. The X server provides no builtin means of synchronization between user rendering the window and the screen displaying a window, so the ...


45

This is not only done in Bash, it's required by the standard. From the Single Unix Specification: Appended output redirection shall cause the file whose name results from the expansion of word to be opened for output on the designated file descriptor. The file is opened as if the open() function as defined in the System Interfaces volume of POSIX.1-2008 ...


38

Here are the commands you need to run, if you just want to get it done: sudo add-apt-repository ppa:git-core/ppa -y sudo apt-get update sudo apt-get install git git --version As of Dec 2014, I get git 2.2.0 that way, while the version in the Ubuntu Trusty repositories is 1.9.1. Note that add-apt-repository is installed via: sudo apt-get install ...


36

And now, the systemd answer. You're using, per the tag on your question, Red Hat Enterprise Linux. Since version 7, that has used systemd. None of the other answers are correct for the world of systemd; nor even are some of the assumptions in your question. Forget about runlevels; they exist, but only as compatibility shims. The systemd documentation ...


34

System 5 init will tell you only a small part of the story. There's a sort of myopia that affects the Linux world. People think that they use a thing called "System 5 init", and that is both what is traditional and the best place to start. Neither is in fact the case. Tradition isn't in fact what such people say it to be, for starters. System 5 init and ...


33

You should use the at command: $ sudo at 6:45 [sudo] password for root: warning: commands will be executed using /bin/sh at> poweroff at> <EOT> Don't type the <EOT>, but press Ctrl+D at the second at> prompt. The significant advantage of using at over using shutdown with a TIME argument, is that it involves real, persistent, ...


31

You can. You just have to set the executable bit on the /a/b directory. That will prevent being able to see anything in b, but you can still do everything if you go directly to a/b/c. % mkdir -p a/b/c % chmod 711 a/b % sudo chown root a/b % ll a/b ls: cannot open directory a/b: Permission denied % touch a/b/c/this.txt % ls a/b/c this.txt Beware that ...


29

Yes! This is a big deal, and incredibly common. And there are two basic approaches. One way is simply with scripted installs, as for example used in Fedora, RHEL, or CentOS's kickstart. Check this out in the Fedora install guide: Kickstart Installations. For your simple case, this may be sufficient. (Take this as an example; there are similar systems for ...


29

In a word: binfmt_misc. It's a Linux-specific, non-portable, facility. There are a couple of formats that are recognized by the kernel with built-in logic. Namely, these are the ELF format (for normal binaries) and the shebang convention (for scripts). (thanks to zwol for the following part of the answer). In addition, Linux recognizes a couple of esoteric ...


27

Looking in the source, it does use O_APPEND. For bash 4.3.30 in make_cmd.c line 710-713 read: case r_appending_to: /* >>foo */ case r_append_err_and_out: /* &>> filename */ temp->flags = O_APPEND | O_WRONLY | O_CREAT; break;


27

You can use the echo or find commands instead of ls: echo * or: find -printf "%M\t%u\t%g\t%p\n"


27

That library has a main() function or equivalent entry point, and was compiled in such a way that it is useful both as an executable and as a shared object. Here's one suggestion about how to do this, although it does not work for me. Here's another in an answer to a similar question on S.O, which I'll shamelessly plagiarize, tweak, and add a bit of ...


27

Execute as root: # swapoff -a And to make that change permanent, edit /etc/fstab and remove or comment-out the swap entry.


26

A new install will seldom break your system (unless you do weird stuff like mixing source and binary). If you use precompiled binaries in Ubuntu then you can remove them and not have to worry about breaking your system, because a binary should list what it requires to run and your package manager will list what programs rely on that program for you to ...


26

The tool to display inode detail for a filesystem will be filesystem specific. For the ext2, ext3, ext4 filesystems (the most common Linux filesystems), you can use debugfs, for XFS xfs_db, for ZFS zdb. For btrfs some information is available using the btrfs command. For example, to explore a directory on an ext4 filesystem (in this case / is dev/sda1): # ...


24

You can also use the printf command, instead of echo: printf '%s\n' * printf is superior to echo in this situation in that echo does not respect the "double dash" (--) to signify the end of the argument list (on some systems, including Ubuntu 14.04 which is what I tested it on): llama@llama:~$ mkdir -p Misc/unix210948 llama@llama:~$ cd !$ cd ...


24

I'll answer your questions out of order: the release team chooses code names; the next two releases are Stretch and Buster; and I don't think we're worried about running out of names yet... As pointed out by eyoung100, Strech is the octopus in Toy Story 3, and Buster is Andy's dog. Also, Sid is the name of the next-door kid who breaks all his toys. "Still ...


22

Yes, you can do this by accessing the master key while the volume is decrypted. The quick and dirty to add a new passphrase: device=/dev/sda5 volume_name=foo cryptsetup luksAddKey $device --master-key-file <(dmsetup table --showkeys $volume_name | awk '{ print $5 }' | xxd -r -p) device and volume_name should be set appropriately. volume_name is the ...


22

SCSI is not only a type of hardware interface, but also a command protocol, which is used for abstraction of most of the modern storage devices. Linux scsi driver is a high level driver that handles a variety of storage hardware. Protocol: http://en.wikipedia.org/wiki/SCSI_command Extract from SCSI on wikipedia: Other technologies which use the SCSI ...


22

This can easily be done using ImageMagick identify -format '%n %i\n' -- *.gif 12 animated.gif 1 non_animated.gif identify -format %n prints the number of frames in the gif; for animated gifs, this number is bigger than 1. (ImageMagick is probably readily available in your distro's repositories for an easy install)


20

There is a new HTML5 version, which runs fine under Chrome, no need to use phone for voice. Open it at: https://app.gotomeeting.com Or if you want to directly open the meeting using the ID: https://app.gotomeeting.com/index.html?meetingid=<id> Then you can create a Web App in Chrome, clicking in the sandwich icon, then More Tools > Create ...


20

The 1 GiB limit for Linux kernel memory in a 32-bit system is a consequence of 32-bit addressing, and it's a pretty stiff limit. It's not impossible to change, but it's there for a very good reason; changing it has consequences. Let's take the wayback machine to the early 1990s, when Linux was being created. Back in those days, we'd have arguments about ...


20

I checked uname manual (man uname) and it says the following for the "-a" option: print all information, in the following order, except omit -p and -i if unknown In Ubuntu, I guess, options "-m", "-p" and "-i" (machine, processor and hardware-platform) are returning the machine architecture. For example, if you use the command uname -mpi You will ...


19

**TODO** +editPic: Linux Kernel Developer -> (Ring Layer 0) +addSection: Kernel Virtualization Engine KERN_WARN_CODING_STYLE: Do not Loop unless you absolutely have to. Recommended Books for the Uninitialized void *i "Men do not understand books until they have a certain amount of life, or at any rate no man understands a deep book, ...


19

You can use shutdown: sudo shutdown -h 06:45 & And to check it: ps -aux | grep shutdown If you want to cancel it: sudo shutdown -c This assumes of course that the shutdown time has already passed.


19

fork() was the original UNIX system call. It can only be used to create new processes, not threads. Also, it is portable. In Linux, clone() is a new, versatile system call which can be used to create a new thread of execution. Depending on the options passed, the new thread of execution can adhere to the semantics of a UNIX process, a POSIX thread, ...


18

It is because of NPTL. Since it is part of the GNU C library nearly every modern linux distribution don't uses the first two real time signals anymore. NPTL is an implementation of the POSIX Threads. NPTL makes internal use of the first two real-time signals. This part of the signal manpage is very interesting: The Linux kernel supports a range of 32 ...


18

Answer to my question, from Qualys: During our testing, we developed a proof-of-concept in which we send a specially created e-mail to a mail server and can get a remote shell to the Linux machine. This bypasses all existing protections (like ASLR, PIE and NX) on both 32-bit and 64-bit systems. My compiled research below for anyone else ...



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