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

Just answering your first question. In the output of cat /proc/cpuinfo you can see the following information:- physical id : 0 siblings : 4 core id : 0 cpu cores : 2 You can see the count of siblings is 4 and cpu cores is 2. cpu cores being 2 is that total number of cores in the processor which can be checked from the spec given in the intel's ...


4

You can do yes | cp -rf myxx, Or if you do it as root - your .bashrc or .profile has an alias of cp to cp -i, most modern systems do that to root profiles. You can temporarily bypass an alias and use the non-aliased version of a command by prefixing it with \, e.g. \cp whatever


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" ...


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

A FILE structure in C is typically called the file handle and is a bit of abstraction around a file descriptor: The data type FILE is a structure that contains information about a file or specified data stream. It includes such information as a file descriptor, current position, status flags, and more. It is most often used as a pointer to a ...


3

The mouse is normally accessible under Linux as a device under /dev/input and there is a virtual device /dev/input/mice that allows you to receive input from all mice in the system through a single device. This mouse device is not normally connected to the standard input of any process though. If you are using a graphical environment then the X11 server is ...


3

The problem is /bin/ls don't just need the shared libraries, which you provided. It also needs the program that loads them; the linux loader. To solve your problem you can copy the loader from your system (usually /lib/ld-linux.so.2) to the location of your chroot (/mnt/foo/lib/ld-linux.so.2).


3

I'm not entirely sure what you're asking here. Yes, top shows CPU usage as a percentage of a single CPU by default. That's why you can have percentages that are >100. On a system with 4 cores, you can see up to 400% CPU usage. You can change this behavior by pressing I (that's Shift + i and toggles "Irix mode") while top is running. That will cause it to ...


3

The words “CPU”, “processor” and “core” are used in somewhat confusing ways. They refer to the processor architecture. A core is the smallest independent unit that implements a general-purpose processor; a processor is an assemblage of cores (on some ARM systems, a processor is an assemblage of clusters which themselves are assemblages of cores). A chip can ...


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 ...


2

grep --color=always -e pattern -e '$'


2

There is always a possibility of something going wrong with the files during or after transit, although in your case it might be more likely to be at the point things are written to tape. If the extra effort warrants it, I would calculate the MD5 or SHA1/SHA256 sums for the files on your Linux box and do that again on the Windows box on which the tape drive ...


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

You might see some information from here. Generally, a file descriptor is an index for an entry in a kernel-resident data structure containing the details of all open files. In POSIX, this data structure is called a file descriptor table, and each process has its own file descriptor table. The user application passes the abstract key to the kernel through a ...


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

It's all historical ;) The original UNIX was a singular entity that was written in non-portable assembly for the PDP-11 as a AT&T Bell Labs project paralleling (or spun off from) the MULTICS OS, to which Bell had previously contributed. Since this took a lot of work -- perhaps, an amount comparable to designing the PDP-11 itself, which wasn't a Bell ...


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

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

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 ...


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.


1

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 ...


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

You do realise that RHEL and CentOS have tried to protect novice users by setting up aliases for the root user to prevent accidentally overwriting and deleting files? alias cp='cp -i' alias mv='mv -i' alias rm='rm -i' The -i switch is what requires confirmation when modifying or removing existing files. Because alias expansion happens before execution of ...


1

Your new user new_username will not have root privileges after editing the sudoers file. This change only allows new_username to run sudo in order to run a task with superuser privileges: $touch testfile $chown new_username testfile chown: changing ownership of 'testfile': Operation not permitted $sudo chown new_username testfile [sudo] password for ...



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