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.

11
votes
4answers
86k views

How to kill a process which can't be killed without rebooting?

There are 5 processes which can't be killed by kill -9 $PID and executing cat /proc/$PID/cmdline will hang the current session. Maybe they're zombie processes. Executing ps -ef or htop will also hang ...
10
votes
1answer
13k views

How to disable keyboard?

Without unplugging my keyboard I'd like to disable it from the terminal; I was hoping that this could be done using rmmod but based on my currently loaded modules it doesn't look like it is possible. ...
9
votes
1answer
6k views

Why do my SATA devices show up under /proc/scsi/scsi?

I have 3 SATA devices on my system. They show up under /proc/scsi/scsi, although these are not SCSI devices. Why do my SATA devices show up under the SCSI directory? $ cat /proc/scsi/scsi Attached ...
12
votes
1answer
2k views

Log every invocation of every SUID program?

I would like to have a log file that contains an entry for every time a user runs any suid program, containing the user name, the program and any command line arguments passed to it. Is there a ...
7
votes
1answer
5k views

controlling priority of applications using cgroups

I would like to understand cgroups better and would like to understand the use-cases for applying cgroups. Are cgroups a good way for prioritizing different applications (i.e, giving higher priority ...
9
votes
2answers
9k views

64-bit kernel, but all 32-bit ELF executable running processes, how is this?

The output from uname: root@debian:~ # uname -a Linux 5asnb 2.6.32-5-amd64 #1 SMP Mon Jun 13 05:49:32 UTC 2011 x86_64 GNU/Linux However the /sbin/init executable shows up as 32-bit: root@debian:~ # ...
0
votes
1answer
422 views

rsync complication on sync

We have 2 Web Server node Primary and secondary, if the primary is down by any reason secondary will act as Prim. Now if we talk about the codes we which is on both the host. we should be ...
259
votes
9answers
623k views

How can I monitor disk io?

I'd like to do some general disk io monitoring on a debian linux server. What are the tools I should know about that monitor disk io so I can see if a disk's performance is maxed out or spikes at ...
54
votes
11answers
41k views

Recommended reading to better understand Unix/Linux internals [closed]

I've worked on *nix environments for the last four years as a application developer (mostly in C). Please suggest some books/blogs etc. for improving my *nix internals knowledge.
98
votes
3answers
44k views

Can I watch the progress of a `sync` operation?

I've copied a large file to a USB disk mounted on a Linux system with async. This returns to a command prompt relatively quickly, but when I type sync, of course, it all has to go to disk, and that ...
176
votes
7answers
219k views

How to display meminfo in megabytes in top?

Sometimes it is not comfortable to see meminfo in kilobytes when you have several gigs of RAM. In Linux, it looks like: And here is how it looks in Mac OS X: Is there a way to display meminfo in ...
86
votes
2answers
235k views

Mount cifs Network Drive: write permissions and chown

I have access to a cifs network drive. When I mount it under my OSX machine, I can read and write from and to it. When I mount the drive in ubuntu, using: sudo mount -t cifs -o username=${USER},...
102
votes
8answers
218k views

Manually generate password for /etc/shadow

I need to manually edit /etc/shadow to change the root password inside of a virtual machine image. Is there a command-line tool that takes a password and generates an /etc/shadow compatible password ...
67
votes
2answers
72k views

How to limit a process to one CPU core in Linux? [duplicate]

How to limit process to one cpu core ? Something similar to ulimit or cpulimit would be nice. (Just to ensure: I do NOT want to limit percentage usage or time of execution. I want to force app (with ...
132
votes
19answers
183k views

Determine the size of a block device

How can I find out the size of a block device, such as /dev/sda? Running ls -l gives no useful information.
44
votes
5answers
35k views

What is the difference between the following kernel Makefile terms: vmLinux, vmlinuz, vmlinux.bin, zimage & bzimage?

While browsing through the Kernel Makefiles, I found these terms. So I would like to know what is the difference between vmlinux, vmlinuz, vmlinux.bin, zimage & bzimage?
25
votes
6answers
44k views

How does a kernel mount the root partition?

My question is with regards to booting a Linux system from a separate /boot partition. If most configuration files are located on a separate / partition, how does the kernel correctly mount it at boot ...
47
votes
4answers
54k views

How to find the driver (module) associated with a device on Linux?

On Linux, given: a device, for example /dev/sda, and its major and minor numbers, for example 8, 0, how can I know which module / driver is "driving" it? Can I dig into /sys or /proc to discover ...
48
votes
3answers
35k views

What is a “loop device” when mounting?

I am mounting an iso file, and looking at this tutorial. They use the command: $ mount -o loop disk1.iso /mnt/disk I'm trying to understand the use of -o loop. I have two questions: When I look at ...
28
votes
3answers
146k views

How to set the resolution in text consoles (troubleshoot when any `vga=…` fails)

It is a common way to set the resolution of a text consoles (that are usually available by Ctrl-Alt-F1 thru Ctrl-Alt-F6) by using a vga=... kernel parameter. I'm using Ubuntu 10.04 Lucid, output of ...
57
votes
4answers
224k views

Using awk to sum the values of a column, based on the values of another column

I am trying to sum certain numbers in a column using awk. I would like to sum just column 3 of the "smiths" to get a total of 212. I can sum the whole column using awk but not just the "smiths". I ...
68
votes
3answers
58k views

Shell: how to go to the beginning of line when you are inside a screen?

I am inside a screen (screen -Ra). I have a long command, and I am at the end. Instead of keeping the left arrow, how can you go to the beginning of the line? CTRL-A works when I am in a normal ...
59
votes
5answers
62k views

Difference between cp -r and cp -R (copy command)

cp -r is meant to copy files recursively, and cp -R for copying directories recursively. But I've checked, and both appear to copy both files and directories, the same thing. So, what's the difference ...
27
votes
4answers
56k views

How to inject keystrokes via a shell script?

I'm trying to inject keystrokes into the input daemon so as to simulate typing from a Bash script. Is this possible, and if so, how can I make it happen?
41
votes
5answers
160k views

How can I change a user's default group in Linux?

Being new to Linux administration, I'm a little confused about the following commands: useradd usermod groupadd groupmod I've just finished reading the user administration book in the Linux/Unix ...
25
votes
6answers
47k views

Is there a way to set the size of the history list in bash to more than 5000 lines?

No matter how much I set the HISTSIZE environment variable to be larger than 5000, when printing the history list with the history builtin, it prints only the last 5000 commands. I need that because I ...
22
votes
6answers
82k views

How can I change the default “ens33” network device to old “eth0” on Fedora 19?

I've just installed a Fedora 19 on VMware workstation 9. The default network device is "ens33" instead of "eth0" on RHEL. The reason I have to use "eth0" is that the license component of one of our ...
52
votes
7answers
16k views

Why does mount require root privileges?

Why does Linux require that a user be root/using sudo/specifically authorized per mount in order to mount something? It seems like the decision as to whether to allow a user to mount something should ...
33
votes
3answers
17k views

Why doesn't mount respect the read only option for bind mounts?

On my Arch Linux system (Linux Kernel 3.14.2) bind mounts do not respect the read only option # mkdir test # mount --bind -o ro test/ /mnt # touch /mnt/foo creates the file /mnt/foo. The relevant ...
35
votes
3answers
37k views

How to undo sudo add-apt-repository?

I run sudo add-apt-repository ppa:noobslab/indicators to install my-weather-indicator but it requires GTK3 and I don't want to proceed. So I'd like to undo that command. I'd checked my /etc/apt/...
27
votes
5answers
8k views

How to start a new Linux distro? [closed]

Some of my friends and I are interested in starting a new Linux distro. How do we do that? What do we need to plan? Backstory I represent a community of Linux sysadmins/implementors whose special ...
18
votes
5answers
5k views

How do you properly fork a Linux distro? [closed]

I was wondering, how one would go about creating a Linux distro. LFS seems like overkill, I would rather fork an existing distro. I know there are several "respin" applications, but these only seem to ...
26
votes
3answers
36k views

ps: full command is too long

Good day! I use 'ps' to see command that starts process. The issue is that command is too long and 'ps' does not show it entirely. Example: I use command 'ps -p 2755 | less' and have following ...
23
votes
2answers
3k views

Why isn't GNU/Linux SUS v3+ compliant?

I am looking for specific details as to why isn't GNU/Linux currently SUS (Single UNIX Specification) v3 or even better SUS v4 compliant? What application APIs and user utilities does it miss or ...
21
votes
4answers
2k views

Is there a reason why 'owner' permissions exist? Aren't group permissions enough?

I think I rather understand how file permissions work in linux. However, I don't really understand why they are split into three levels and not into two. I'd like the following issues answered: Is ...
12
votes
9answers
6k views

Options to show images when on the console

When I am on the console (the tty, the virtual terminal, which you reach with Ctrl+Alt+F1-6, not a terminal emulator), what options do I have to view images, tiff, whatever that's not text?
9
votes
1answer
3k views

How do I get the creation date of a file on an NTFS logical volume?

I created an NTFS logical volume on my Linux system for Windows file storage because I want to retain the creation date of my files (I would probably zip them into an archive and then unzip them, ...
8
votes
2answers
19k views

Daemonize a process in shell?

http://linuxg.net/how-to-transform-a-process-into-a-daemon-in-linux-unix/ gives an example of daemonizing a process in bash: $ nohup firefox& &> /dev/null If I am corrrect, the command is ...
27
votes
12answers
42k views

How can I “cat” a file and remove commented lines?

I'd like to know if there is a way that I could cat file like php.ini and remove all lines starting with ; For example, if the file contained this: ; - Show all errors, except for notices ; ;...
26
votes
3answers
16k views

How to restrict an SSH user to only allow SSH-tunneling?

How can I restrict a user on the SSH server to allow them only the privileges for SSH TUNNELING? i.e. So they cannot run commands even if they log in via SSH. My Linux servers are Ubuntu 11.04 and ...
11
votes
1answer
3k views

How can I create a swap file?

I know how to create and use a swap partition but can I also use a file instead? How can I create a swap file on a Linux system?
26
votes
3answers
7k views

How can I keep control+d from disconnecting my session?

I regularly ssh to a centos 5 box. Somehow they keys are mapped so that control+d will log me out of my current shell. If I am sudo'ed to another use it puts me back to the previous user. If I am not ...
13
votes
3answers
132k views

Connecting Linux Mint to WiFi network

I just installed Linux Mint 17 (MATE) on an old laptop and everything works amazing, however I can't seem to get it to connect to my WiFi network. All my other computers can get access, plus, before ...
13
votes
4answers
2k views

Trouble with understanding the concept of mounting

Having read both What is meant by mounting a device in Linux? and understanding "mount" as a concept in the OS, I have a problem where it is stated that All accessible storage must have ...
9
votes
5answers
10k views

How to create a custom Linux distro that runs just one program and nothing else?

How I could go about creating my own "custom" Linux distro that will run just one program, pretty much exactly the same way as XBMCbuntu.
6
votes
2answers
14k views

Which process scheduler is my linux system using?

I'm not quite sure if stackoverflow or serverfault is the forum to use for this question, but ill try here. Is there some command I can use or a file I can check in order to find out which process ...
6
votes
1answer
2k views

Remapping Caps Lock to Compose

Because I now and then need to use scandinavian letters despite using US Dvorak as my layout, I would like to use Caps Lock as a compose key. (I don't need Caps Lock at all, I'm not a forum troll) ...
11
votes
1answer
9k views

Permanent Environment Variable for all users

I want to have all users on the system to have an environment variable named SPI that points to /usr/local/share_ideas directory. How do I do it?
8
votes
1answer
1k views

Why is lazy MNT_DETACH or `umount -l` unsafe / dangerous?

I've read in a few places that umount -l is unsafe: In an answer by @cas: don't use umount's --lazy option if you care about when the external drive can be safely unplugged A comment by @...
0
votes
2answers
5k views

rc.local Not working Debian 8

I'm trying to start a Shell Script on boot/startup I tried to edit the /etc/rc.local file, but it didn't work #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser ...