Tag Info

Hot answers tagged

5

The information that df produces comes from the statvfs() system call. If your embedded system does not have the df command installed, perhaps it has one of the common scripting languages, using which you can write a one-liner to access the same system call? python -c 'import os; print os.statvfs("/")' If it doesn't have anything like that installed ...


4

The LSB, POSIX, and the Single UNIX Specification all significantly involve userland. Simply using a kernel that is also used as the basis of a "unix-like", "mostly POSIX compliant" operating system -- GNU/Linux -- is not sufficient to make Android such as well. There are, however, some *nix-ish elements, such as the shell, which is a "largely compatible" ...


4

Sounds like a hardware fault. Segfaults across the whole system can be caused by bad sectors on the disk or bad memory. Run a memory test and see if there's some faulty memory that is causing your issue. After that if the memory test does not find an issue, I would run a badblocks scan on your hard drive.


3

This can be a way: awk 'BEGIN{FS=OFS=","} # set input and output field separator as comma {for (i=5; i<=NF; i++) { # loop from 5th field gsub("\"","", $i); # remove " gsub(/^[ \t]+/,"", $i); # remove leading spaces gsub(/[ \t]+$/,"",$i)} # remove trailing spaces }1' file Removing ...


3

There are several reasons a piece of RAM would not be used by Linux: If Linux detects it as belonging to a hardware peripheral. Most computers need RAM for the display, and thus reserve some RAM for the graphics card. It's also possible for the graphics card to contain its own RAM; as graphics cards have relatively high memory requirements, they tend not ...


3

If all goes well, your kernel should decide to "do the right thing" all by itself. It uses a lot of fancy heuristics to decide what to swap out and what to keep when there is memory pressure. Those heuristics have been carefully built by really smart people with a lot of experience in memory management and are already good enough that they're pretty hard to ...


3

It's historical, sort of like the question, "Why is there more than one nation state?". Presumably, at some point a few hundred thousand years ago, there was only one, singular population of homo sapiens, and yet now there are many. The original UNIX was a singular entity that was written in non-portable assembly for the PDP-11 as a AT&T Bell Labs ...


2

Could also ask, why can't there just be one type of car? Wouldn't we all be happy driving a Gremlin? Or maybe an El Camino? There are some historical reasons for some of the deviations between the proprietary flavors in Unix and Linux that would make for some interesting reading (finding all those resources would be out of scope for such an open-ended ...


2

The word “Linux” has two meanings. The most common meaning, by far, is the Linux operating system, also known as GNU/Linux or GNU/X11/Apache/Linux/TeX/Perl/Python/FreeCiv, which is an imitation of the Unix operating system. The word “Linux” can also mean the Linux kernel, which is the kernel of the Linux operating system. Android is a completely different ...


2

The link /dev/$disk points to the whole of a block device, but, on a partitioned disk without unallocated space, the only part which isn't also represented in /dev/$disk[num] is the first 2kb or so - $disk's partition table. It's just some information written to the raw device in a format that the firmware and/or OS can read. Different systems interpret it ...


2

cgroup's are meant to control applications, not filesystems. What you're wanting would need to either be a sysctl or a mount option since it's for an entire filesystem. Unfortunately it doesn't look like either of those two features has been created for this problem. That's probably due to how unique an issue like this is. To work around this, you may try ...


2

The [[:alnum:]] character class represents alphabetic and numeric characters, you can use [^[:alnum:]] for non alpha numeric so for your goal: my target is to work with all kind of characters non alpha numeric and alpha numeric you can use this expression [[:alnum:]] | [^[:alnum:]] so the awk command will be something like this: awk 'gsub(/("[ ...


2

This line: -su: 29: /usr/share/bash-completion/bash_completion: [[: not found tells me that /bin/sh isn't a bash shell (on modern Debian, it's almost certainly dash), but it's trying to source a bash script. So, the question you need to answer is why a non-bash shell is trying to source the bash_completion script. I'm guessing that the problem is one of ...


2

You can do this via PAM configuration. For example, if you use XScreenSaver, you'd edit /etc/pam.d/xscreensaver and change the @include common-auth line. Rather than repeat all the details, I'll point you to my answer to Set sudo password differently from login one. The procedure is almost exactly the same, except that you'll be editing the PAM config for ...


2

Try while read column1 column2 do something with $column1 something more $column2 ... done < test.txt Using the read directly from a while & redirected file saves you the cat (completely unnecessary use of ;}) and changing IFS.


2

Can the disk (ATA) be setup so that a failing read doesn't take too long, so that it can be dropped, and the reading process and the disk wouldn't be blocked, and the next read could be attempted? No. My understanding of this is that it's a logical problem resulting from a design choice (not unique to linux) that favours performance and stability for ...


1

You can't #include two headers with an identical path, but you can install one outside of the normal paths and have it supersede those when you compile by using the appropriate switch (for gcc, -I). I think you understand that stuff already, so it should not take too much thinking to recognize that you if you place more than one asm/fcntl.h in normal ...


1

I have same settings on our server. We use same config of SSHD. Users' home directories are owned by root and within them there are folders documents and public_html owned by respective users. Users then login using SFTP and write into those folders (not directly into home). As SSH is not allowed for them, it perfectly works. You can adjust which directories ...


1

Put this at the top: if [ -z "$1" ]; then echo "Argument required." exit fi -z tests the argument string to see if it is of zero length. If it's not zero length, execution will continue.


1

You probably want: for i in n5 n25 do if [ ${#i} -eq 2 ]; then python two.py n5 elif [ ${#i} -eq 3 ]; then python three.py n25 fi done Note that: for goes with do ... done. if goes with then ... [elif; then] ... [else; then] ... fi. the integer comparisons need -eq (equal) instead of = (for strings) and are written within ...


1

I would suggest reading this article: http://delightlylinux.wordpress.com/2014/04/16/3492/ From what I understand, you may see some performance improvement, but overall the difference isn't hugely noticeable. I can't say I've every really noticed enough of a difference to justify migrating to SSDs, other than for the sake of not using mechanical drives.


1

Does root have SFTP access? Can you sftp root@remote? If so, you should be able to download the /etc/sshd/sshd_config from the remote to your local machine, fix it, and push the corrected version back.


1

Despite what file says, it turns out to be debugging symbols after all. A thread about this on the LKML led me to try: make INSTALL_MOD_STRIP=1 modules_install And low and behold, a comparison from within the /lib/modules/x.x.x directory; before: > ls -hs kernel/crypto/anubis.ko 112K kernel/crypto/anubis.ko And after: > ls -hs ...


1

The names actually match up, but sar and free don't show exactly the same fields. Your first ??? isn't kbcommit, it's shared memory, the same as Shmem from /proc/meminfo. The second row shows the memory usage if the memory used by buffers and cache was treated as free rather than used. $ free total used free shared buffers ...


1

In order for two machines to communicate, they need to know each other's IP address. That's how they know where to send packets. You can't communicate with someone if you don't know where to send their messages. Tunneling allows machines to communicate without knowing each other's IP address by embedding packets inside another communication layer and using ...


1

Since /tmp is a separate filesystem, you want to get an unblemished view of the contents of that filesystem (without the interference from the /dev/sda1 filesystem, which is mounted on the subordinate /tmp/FOO mount point), so you need to do a bind mount on /tmp: mount --bind /tmp /tmp/BAR Now /tmp/BAR should show you the contents of /tmp, and ...


1

As I understand it, you want to see the files, if any, hidden by the mount /dev/sda1 /tmp/somefolder command. Assuming that /tmp is part of the / filesystem, run: mount --bind / /tmp/anotherfolder ls /tmp/anotherfolder/tmp/somefolder If /tmp is not part of / but is a separate filesystem, run: mount --bind /tmp /tmp/anotherfolder ls ...


1

First of all, is the host machine network interface is connected to the trunked port ? you can test this simple with the command vconfig to create the vlan interface on the fly, # vconfig add [interface-name] [vlan-id] # ( you will need 8021q module loaded ) # -e.g. vconfig add em1 100 ip addr show ... 12: em1.100@em1: ...


1

You can try this in terminal: sudo lscpu This will give you an overview of your cpu physical trait. As for turbo boost or not, this is purely hardware control than the OS itself, so unless Intel has a specific drivers for Linux that can tune your processor speed, there's no solid lead to check the turbo boost state (unless there's a command code for it. ...


1

For what it's worth, I needed to check the level of skew between two linux systems myself yesterday. Before going digging for tools, I used this unscientific method which gave me good enough results for my purposes (comparing timestamps of log outputs from the two systems). Launch a Putty session on each system and align them side-by-side Run the ...



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