Tag Info

Hot answers tagged

36

A couple of things come to mind: Recover from a kernel panic A kernel panic, by definition, cannot be recovered from without restarting the kernel. Recover from hangs which leave you without terminal access If the system is unresponsive and you're stranded without a way to issue commands to recover, the only thing you might be able to do is to reboot. ...


31

You can do this directly from the shutdown command, see man shutdown: SYNOPSIS /sbin/shutdown [-akrhPHfFnc] [-t sec] time [warning message] [...] time When to shutdown. So, for example: shutdown -g 21:45 That will run shutdown -h at 21:45. For commands that don't offer this functionality, you can try one of: A. Using at The at daemon ...


29

These /dev nodes appear because the standard PC serial port driver is compiled into the kernel you're using, and it is finding UARTs. That causes /sys/devices/platform/serial8250 (or something compatible) to appear, so udev creates the corresponding /dev nodes. These UARTs are most likely one of the many features of your motherboard's chipset. Serial UARTs ...


22

If you use strace you can see how a shell script is executed when it's run. Example Say I have this shell script. $ cat hello_ul.bash #!/bin/bash echo "Hello Unix & Linux!" Running it using strace: $ strace -s 2000 -o strace.log ./hello_ul.bash Hello Unix & Linux! $ Taking a look inside the strace.log file reveals the following. ... ...


20

Lemma: sl prints a steam locomotive Lemma: The steam locomotive contains forward slashes: $ touch ' ( ) (@@) ( ) (@) () @@ O @ O @ O > (@@@) > ( ) > (@@@@) > > ( ) > ==== ________ ...


18

ARM is huge for linux. Aside from the Rasberry Pi and other hobbyist ARM SoC you have every Android phone and tablet and many of the Chromebooks running Linux on ARM. I couldn't find any hard numbers on total devices in use, but total android activations number somewhere north of 1 billion. The Chromebooks are Amazon's best selling laptops, though not ...


17

The term "field" is often times associated with tools such as cut and awk. A field would be similar to a columns worth of data, if you take the data and separate it using a specific character. Typically the character used to do this is a Space. However as is the case with most tools, it's configurable. For example: awk = awk -F"," ... - would separate by ...


17

You can check the source code here - https://github.com/mtoyoda/sl, alas there is no other options other than the ones documented and sadly nothing that will actually print the names of files. So it looks like @sfyn's answer is the correct one.


14

Here's a patch to fix that bug :) diff --git a/sl.c b/sl.c index 2eeceb3..f2213ad 100644 --- a/sl.c +++ b/sl.c @@ -37,6 +37,7 @@ #include <curses.h> #include <signal.h> #include <unistd.h> +#include <stdlib.h> #include "sl.h" int ACCIDENT = 0; @@ -71,6 +72,13 @@ void option(char *str) int main(int argc, char *argv[]) { ...


13

There are DST-free timezone definitions provided which just define the GMT-offset, called Etc/GMT±X: $ date Mon Apr 7 11:08:56 CEST 2014 $ TZ=Etc/GMT-1 date Mon Apr 7 10:09:16 GMT-1 2014 $ Just link/copy the one you need to /etc/localtime and you should be fine and DST-free: $ ln -s /usr/share/zoneinfo/Etc/GMT-1 /etc/localtime Edit: For non-integer ...


12

There's a partial list of platforms in the Linux Kernel FAQ, under the platforms section titled: What Platforms Does Linux Support?. excerpt Ports are currently available for: Compaq Alpha AXP Sun SPARC and UltraSPARC Motorola 68000 PowerPC PowerPC64 ARM Hitachi SuperH IBM zSeries and S/390 MIPS HP PA-RISC Intel IA-64 DEC ...


10

That actually depends on what you did after that. crontab - is interpreted as a variation on the crontab file invocation, where you change the current user's crontab with that contained in the specified file. - in this case, as is common practice, means to read from stdin instead of an actual file. The result of this is that if you pressed ctrl-c or ...


9

This is more shell dependent than OS dependent. ksh read the script on demand by 8192 bytes block. bash read the script line by line. However, given the fact lines can be of arbitrary lenght, it reads each time 8176 bytes from the beginning of the next line to parse. This is for simple constructions, i.e. a suite of plain commands. If shell structured ...


9

Per @Kevin in the comments below, the --file - |pipe syntax is redundant. So I've removed it. This can also be done with tar: sudo tar -C${SRC_DIR} --remove-files --group=unicorn --owner=unicorn -c ./* | sudo tar -C${TGT_DIR} -pvx


8

File /proc/bus/pci/devices might help: $ cut -f1,2,18 /proc/bus/pci/devices 0000 808627a0 0008 808627a1 pcieport 00d8 808627d8 snd_hda_intel 00e0 808627d0 pcieport 00e1 808627d2 pcieport 00e2 808627d4 pcieport 00e3 808627d6 pcieport 00e8 808627c8 uhci_hcd 00e9 808627c9 ...


8

A field according to POSIX is any part of a line delimited by any of the characters in IFS, the "input field separator (or internal field separator)." The default value of this is space, followed by a horizontal tabulator, followed by a newline.


8

There is a solution using partprobe from parted software. More information here: http://www.gnu.org/software/parted/ After using your fdisk command and having done your modifications, do a partprobe or partprobe /dev/sdx and it should inform the kernel of the change without reboot.


8

You can use awk for this: $ awk -F'[]]|[[]' \ '$0 ~ /^\[/ && $2 >= "2014-04-07 23:00" { p=1 } $0 ~ /^\[/ && $2 >= "2014-04-08 02:00" { p=0 } p { print $0 }' log Where: -F specifies the characters [ and ] as field separators using a regular expression $0 references a complete line $2 ...


7

s=/home/poney/; f=folderfulloffiles; d=/home/unicorn/ sudo mv $s$f $d && sudo chown -R unicorn:unicorn $d$f About the same length as the other answers, and note since they're all using the same library calls under the hood, they're all doing exactly the same thing -- unless, as Gilles notes, this is on the same filesystem and device, in which case ...


6

The reason that things were merged to /usr and not to / are noted in The Case for the /usr Merge: Myth #11: Instead of merging / into /usr it would make a lot more sense to merge /usr into /. Fact: This would make the separation between vendor-supplied OS resources and machine-specific even worse, thus making OS snapshots and network/container ...


6

That's because there must be a Defaults requiretty in /etc/sudoers or any file it includes. RedHat systems (RHEL, fedora...) have been known to have that in their default sudoers file. That provides no real security benefit and can be safely removed. RedHat has acknowledged the problem and it will removed in future releases.


6

First off, if you delete a folder that inotifywait is watching, then, yes, it will stop watching it. The obvious way around that is simply to monitor the directory one level up (you could even create a directory to monitor especially and put your work_folder in there. However this won't work if you have a folder underneath which is unmounted/remounted ...


6

I am surprised no-one else found this, but there is a Wikipedia page dedicated to the architectures supported by Linux. There are too many to list here, but I will list the Linux architectures officially supported by Debian, since this is a good indication of what is commonly used: i386: x86 architecture designed for Intel/AMD 32-bit PCs. Also compatible ...


6

No, the contract with cron is that it starts each job at the specified time. Cron doesn't keep track of which successive jobs are “the same job”. If you want to avoid starting a job when the previous one isn't finished, you need to put something at the beginning of your job that makes it exit early. For example, you can arrange for your job to hold a lock ...


6

No. Trivial counter example, this will interact with the kernel: int main() { volatile char *silly = 0; *silly = 'a'; } That'll call the kernel's page fault handler, ultimately resulting in your process getting a SIGSEGV (presuming the compiler doesn't "optimize" that code to do something other than the obvious, since that's undefined behavior by ...


5

It will shutdown your system at 12:00 : $ sudo shutdown -h 12:00 Options: -h, -P, --poweroff Power-off the machine. -r, --reboot Reboot the machine. -c Cancel a pending shutdown.


5

To get this information from sysfs for a device file, first determine the major/minor number by looking at the output of ls -l, eg $ ls -l /dev/sda brw-rw---- 1 root disk 8, 0 Apr 17 12:26 /dev/sda The 8, 0 tells us that major number is 8 and the minor is 0. The b at the start of the listing also tells us that it is a block device. Other devices may ...


5

That depends on how the interpreter running the script works. All the kernel does is to notice the file to execute starts with #!, essentially runs the rest of the line as a program and gives it the executable as argument. If the interpreter listed there reads that file line by line (as interactive shells do with what you type), that is what you get (but ...


5

The 'x' file: cat<<'dog' >xyzzy LANG=C T=`tty` ( sleep 2 ; ls -l xyzzy >$T ) & ( sleep 4 ; rm -v xyzzy >$T ) & ( sleep 4 ; ls -l xyzzy >$T ) & echo alive. ; sleep 1 echo alive. ; sleep 1 echo alive. ; sleep 1 echo alive. ; sleep 1 echo alive. ; sleep 1 echo alive. ; sleep 1 echo alive. ; sleep 1 echo alive. ; sleep 1 dog sh ...


5

Supported platforms: Alpha, ARC, ARM, AVR32, Blackfin, C6x, ETRAX CRIS, FR-V, H8/300, Hexagon, Itanium, M32R, m68k, META, Microblaze, MIPS, MN103, OpenRISC, PA-RISC, PowerPC, s390, S+core, SuperH, SPARC, TILE64, Unicore32, x86, Xtensa More information can be found here: http://en.wikipedia.org/wiki/Linux



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