Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [linux]

These questions are about Linux in general -- NOT specific to a particular distribution. If the question just happens to be in a Linux environment, please specify your Linux distribution in the body of your question, but do NOT use the /linux tag.

20
votes
3answers
29k views

What do the “buff/cache” and “avail mem” fields in top mean?

Within the output of top, there are two fields, marked "buff/cache" and "avail Mem" in the memory and swap usage lines: What do these two fields mean? I've tried Googling them, but the results only ...
13
votes
2answers
551 views

`test` and `[` - different binaries, any difference?

I noticed while answering another question that test and [ are different binaries, but the [ manpage pulls up test's. Besides the requirement for an ending ], is there any difference? If not, why are ...
8
votes
3answers
4k views

Remapping caps-lock to escape, and menu to compose, on the linux console

When running X I use a .xmodmaprc to remap certain keys thusly: ! Make it so that both Caps Lock and Escape do Escape clear Lock keysym Caps_Lock = Escape ! Remap the menu key as Compose keysym Menu =...
6
votes
1answer
256 views

`dd` is running at full speed, but I only see 20% disk utilization. Why?

sudo dd if=/dev/sda of=/dev/null bs=1M iflag=direct atopsar -d 5 # in a second terminal top # in a third terminal Results from atopsar : 19:18:32 disk busy read/s KB/read ...
5
votes
2answers
3k views

Configure SELinux to allow daemons to use files in non-default locations

I have a daemon (apache/samba/vsftpd/...) running on SELinux enabled system and I need to allow it to use files in a non-default location. The standard file permissions are configured to allow access. ...
3
votes
2answers
3k views

Key mappings in Linux

What do people mean when they point out that the "keys are not properly mapped" in a Linux installation when working on the command line? Isn't the default installation OK? What extra/specific ...
3
votes
2answers
2k views

Installation on debian 5 32-bit without being a root

I am trying to install Skype and Google Chrome on my desktop. It runs Debian 5 32-bit. I downloaded the packages from the web but I have no idea how to install them.
4
votes
2answers
11k views

Disable direct login for normal users (like oracle) in linux but allow scp and sftp?

Is it possible to disable direct login for normal users (like oracle) in linux but allow scp and sftp for that use?
4
votes
2answers
636 views

Mounting new filesystem affects non-recursive bind mounts?

It hasn't always behaved this way, but nowadays I get this inconsistent behaviour. Bind mounts don't copy existing mounts (unless you use --rbind), but new mounts (and unmounts) get copied ...
3
votes
1answer
934 views

What is the exact purpose of `mask` in file system ACL?

When I apply default ACL in a directory I see default:mask or just mask in the following two scenario. Scenario 1 -bash-4.2$ ls -ld test/ drwxr-x---. 2 test test 4096 Oct 15 19:12 test/ -bash-4.2$...
1
vote
1answer
2k views

How to configure kiosk with Wayland / Xorg?

Self - answered now, see below: I am setting up a kiosk system with a browser. Now my manjaro system is updating and it seems that Xorg is replaced by Wayland. With Xorg it was clear I could use ...
132
votes
8answers
322k views

What to do when a Linux desktop freezes?

I'm a Windows guy, dual booted recently, and now I'm using Linux Mint 12 When a Windows desktop freezes I refresh, or if I am using a program I use alt + F4 to exit the program or I can use ctrl + ...
213
votes
12answers
439k views

How to know number of cores of a system in Linux?

I wanted to find out how many cores my system has, so I searched the same question in Google. I got some commands such as the lscpu command. When I tried this command, it gave me the following result: ...
52
votes
7answers
41k views

Linux Kernel: Good beginners' tutorial [closed]

I'm interested in modifying the kernel internals, applying patches, handling device drivers and modules, for my own personal fun. Is there a comprehensive resource for kernel hacking, intended for ...
63
votes
6answers
56k views

What is the difference between kernel drivers and kernel modules?

When I do a lspci -k on my Kubuntu with a 3.2.0-29-generic kernel I can see something like this: 01:00.0 VGA compatible controller: NVIDIA Corporation G86 [Quadro NVS 290] (rev a1) Subsystem: ...
89
votes
12answers
166k views

List partition labels from the command line

Is there a command that will list all partitions along with their labels? sudo fdisk -l and sudo parted -l don't show labels by default. EDIT: (as per comment below) I'm talking about ext2 labels - ...
107
votes
2answers
324k views

How to see process created by specific user in Unix/linux

I want to see list of process created by specific user or group of user in Linux Can I do it using ps command or is there any other command to achieve this?
60
votes
6answers
106k views

Allowing a user to let listen to a port below 1024

I need to allow a user (different from root) to run a server listening on port 80. Is there any way to do this?
63
votes
2answers
30k views

Will Linux start killing my processes without asking me if memory gets short?

I was running a shell script with commands to run several memory-intensive programs (2-5 GB) back-to-back. When I went back to check on the progress of my script I was surprised to discover that some ...
70
votes
7answers
84k views

Creating a ram disk on Linux

I have a machine with 62GB of RAM, and a trunk that's only 7GB, so I thought I would create a RAM disk and compile there. I am not a Linux expert. I found instructions on the internet to create the ...
67
votes
11answers
297k views

ssh_exchange_identification: Connection closed by remote host (not using hosts.deny)

I'm not using hosts.allow or hosts.deny, further more SSH works from my windows-machine (same laptop, different hard drive) but not my Linux machine. ssh -vvv root@host -p port gives: OpenSSH_6.6, ...
32
votes
6answers
143k views

How do I partition a USB drive so that it's bootable and has a Windows-compatible data storage partition?

split from here I have a 16gb flash drive, which I want a live ISO to boot from (via unetbootin or something similar). It'll be some 32bit distro that I can plug-in and boot on whatever computer I ...
28
votes
11answers
10k views

Erasing a Linux laptop

I have a laptop with Debian on it, and I am going to sell this laptop. Would it suffice to erase the Debian installation before selling it to completely clean up my laptop from my personal data, and ...
74
votes
6answers
356k views

Linux: set date through command line

How to change the system date in Linux ? I want to change: Only Year Only Month Only Date Any combination of above three
46
votes
6answers
58k views

Why does Linux allow ‘init=/bin/bash’?

I recently found out that if I edit GRUB before booting and I add rw init=/bin/bash I end up with a root shell. Being in a condition that I want to understand everything I would like to know why this ...
104
votes
3answers
258k views

linux + add X days to date and get new virtual date

I have Linux ( RH 5.3) machine I need to add/calculate 10 days plus date so then I will get new date (expiration date)) for example # date Sun Sep 11 07:59:16 IST 2012 So I need to get ...
44
votes
7answers
108k views

How to allow non-superusers to mount any filesystem?

Is it possible to allow some particular users (e.g. members of a group) to mount any filesystem without superuser privileges on Linux? Another question might have been "in what ways a user can harm a ...
34
votes
4answers
28k views

How to mitigate the Spectre and Meltdown vulnerabilities on Linux systems?

Security researchers have published on the Project Zero a new vulnerability called Spectre and Meltdown allowing a program to steal information from a memory of others programs. It affects Intel, AMD ...
75
votes
9answers
191k views

How to output only file names (with spaces) in ls -Al?

I should echo only names of files or directories with this construction: ls -Al | while read string do ... done ls -Al output : drwxr-xr-x 12 s162103 studs 12 march 28 12:49 personal ...
42
votes
3answers
133k views

How to shutdown Linux at a specific datetime from terminal?

It seems I can shutdown using sudo shutdown by specifying a time or minutes. Is there a way to specify datetime for shutdown?
23
votes
4answers
31k views

How to execute a shellscript when I plug-in a USB-device

I want to execute a script when I plug in a device in my Linux machine. For example, run xinput on mouse or a backupscript on a certain drive. I have seen a lot of articles on this, most recently ...
100
votes
10answers
98k views

How can I tell what version of Linux I'm using?

Often times I will ssh into a new client's box to make changes to their website configuration without knowing much about the server configuration. I have seen a few ways to get information about the ...
90
votes
1answer
102k views

What is a tainted kernel in Linux?

Under certain conditions, the Linux kernel may become tainted. For example, loading a proprietary video driver into the kernel taints the kernel. This condition may be visible in system logs, kernel ...
76
votes
2answers
62k views

What is this folder /run/user/1000?

What is this folder: /run/user/1000 on my Fedora system and what does it do? ~ $ df -h Filesystem Size Used Avail Use% Mounted on tmpfs 1.2G 20K 1.2G 1% /run/user/1000 EDIT: 7 ...
61
votes
7answers
17k views

Are threads implemented as processes on Linux?

I'm going through this book, Advanced Linux Programming by Mark Mitchell, Jeffrey Oldham, and Alex Samuel. It's from 2001, so a bit old. But I find it quite good anyhow. However, I got to a point ...
49
votes
15answers
141k views

Checking if HyperThreading is enabled or not?

How can I check if hyperthreading is enabled on a Linux machine, using a perl script to check for it? I'm trying the following way: dmidecode -t processor | grep HTT Let me know if I'm on right ...
39
votes
7answers
21k views

Can ps display only non kernel processes on Linux?

How can I ask ps to display only user processes and not kernel threads? See this question to see what I mean...
17
votes
3answers
7k views

Are Linux kernel threads really kernel processes?

I've read in many places that Linux creates a kernel thread for each user thread in a Java VM. (I see the term "kernel thread" used in two different ways: a thread created to do core OS work and a ...
44
votes
3answers
54k views

How much RAM does the kernel use?

This question is motivated by my shock when I discovered that Mac OS X kernel uses 750MB of RAM. I have been using Linux for 20 years, and I always "knew" that the kernel RAM usage is dwarfed by X (...
19
votes
2answers
56k views

How to recover a crashed Linux md RAID5 array?

Some time ago I had a RAID5 system at home. One of the 4 disks failed but after removing and putting it back it seemed to be OK so I started a resync. When it finished I realized, to my horror, that 3 ...
65
votes
2answers
87k views

How to display the Linux kernel command line parameters given for the current boot?

In the grub.conf configuration file I can specify command line parameters that the kernel will use, i.e.: kernel /boot/kernel-3-2-1-gentoo root=/dev/sda1 vga=791 After booting a given kernel, is ...
47
votes
5answers
62k views

How to safely turn off swap permanently and reclaim the space? (on Debian Jessie)

I installed Debian Jessie with default partitioning on my SSD drive. My current disk partitioning looks like this: As I have 16GB of RAM, I assume I don't need swap. But since I have other disk ...
28
votes
6answers
53k views

How to completely disable swap?

I am using Debian sid, hard drive formatted with ext4, running on linux 3.1 I remember on previous linux versions (maybe before 3.0), if I run out of memory, and swap is not enabled, programs will ...
25
votes
2answers
5k views

Where is the fork() on the fork bomb :(){ :|: & };:?

Warning: Running this command in most shells will result in a broken system that will need a forced shutdown to fix I understand the recursive function :(){ :|: & };: and what it does. But I don'...
26
votes
8answers
64k views

How to determine which sd* is usb? [duplicate]

Possible Duplicate: How to know if /dev/sdX is a connected USB or HDD? The output of ls /dev/sd* on my system is - sda sda1 sda2 sda3 sda4 sda5 sda6 sda7 sdb sdc sdc1 sdc2 How ...
26
votes
5answers
34k views

Block Particular Command in Linux for Specific user

How to block command, let say mkdir for specific user ? What I did just created read-only function and store in users profile ~/.bashrc /bin/mkdir() { echo "mkdir command not allow for you" ...
16
votes
6answers
52k views

Parallelise rsync using GNU Parallel

I have been using a rsync script to synchronize data at one host with the data at another host. The data has numerous small-sized files that contribute to almost 1.2TB. In order to sync those files, ...
38
votes
5answers
127k views

How do I kill all a user's processes using their UID

I want to kill all running processes of a particular user from either a shell script or native code on a Linux system. Do I have to read the /proc directory and look for these? Any ideas? Is there a ...
34
votes
3answers
9k views

What does the vm.swappiness parameter really control?

Per the kernel documentation: This control is used to define how aggressive the kernel will swap memory pages. Higher values will increase aggressiveness, lower values decrease the amount of swap. ...
30
votes
6answers
24k views

Is there any reason why I get ^[[A when I press up arrow at the console login screen?

Whenever I'm at the console login, I press up arrow intentionally to see the previously typed commands. But I see this ^[[A. But when I press Ctrl Alt Print Screen Scroll Lock Pause Break Page Up ...