Questions tagged [linux]

These questions are about Linux in general (as apposed to and separate from any other Unix OS variant) – NOT specific to a particular distribution.  If the question just happens to be in a Linux environment, please instead specify your Linux distribution in the body of your question, but do NOT use the “linux” tag.

In a narrow sense, Linux is a Unix-like kernel started by Linus Torvalds in 1991.  For questions that are specifically about the kernel (e.g., how to configure and build it), use the tag .

The word “Linux” is commonly used to refer to an operating system built around the Linux kernel.  This operating system includes many other components, notably from the GNU project, so the term GNU/Linux is preferred.  This operating system can also be run without the Linux kernel, and is often, confusingly, still referred to as Linux.

There are many different GNU/Linux distributions (see ), including more or less the same programs but with different installers (see ), package managers (see ), and other customizations.  Examples of common distributions are: , , , , , , , and .

Use this tag for questions that are specific to Linux-the-operating-system (GNU/Linux), such as hardware support, networking setup, filesystems, etc. Most questions should have other tags to identify the area of interest, e.g., , , , , , etc.

The Linux kernel is used in some non-unix-like embedded operating systems, the best known being Android. These operating systems are off-topic here (you can ask questions about using Android on Android Stack Exchange).

Further reading

38955 questions
936
votes
2 answers

How do I make `ls` show file sizes in megabytes?

What commands do I need for Linux's ls to show the file size in MB?
837
votes
8 answers

Finding the PID of the process using a specific port?

I am installing hadoop on my Ubuntu system. When I start it, it reports that port 9000 is busy. I used: netstat -nlp|grep 9000 to see if such a port exists and I got this: tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN But how can I get the PID of the…
wuchang
  • 8,837
638
votes
30 answers

How can I resolve a hostname to an IP address in a Bash script?

What's the most concise way to resolve a hostname to an IP address in a Bash script? I'm using Arch Linux .
535
votes
9 answers

Execute vs Read bit. How do directory permissions in Linux work?

In my CMS, I noticed that directories need the executable bit ( +x ) set for the user to open them. Why is the execute permission required to read a directory, and how do directory permissions in Linux work?
Nick.h
  • 6,453
515
votes
15 answers

How to know whether Wayland or X11 is being used

I just installed the latest Kali Linux on my laptop which was based on Debian 7 (oldstable). I then dist-upgrad-ed the whole thing to Debian 8. I've always wanted Wayland instead of X11, so I installed the necessary packages. Then created a minimal…
Dehbop
  • 5,379
508
votes
2 answers

Compress a folder with tar?

I'm trying to compress a folder ( /var/www/ ) to ~/www_backups/$time.tar where $time is the current date. This is what I have: cd /var/www && sudo tar -czf ~/www_backups $time" I am completely lost and I've been at this for hours now. Not sure if…
qwerty
  • 5,221
  • 5
  • 19
  • 13
436
votes
9 answers

When should I not kill -9 a process?

I am always very hesitant to run kill -9 , but I see other admins do it almost routinely. I figure there is probably a sensible middle ground, so: When and why should kill -9 be used? When and why not? What should be tried before doing it? What kind…
Mikel
  • 59,012
419
votes
1 answer

How do you empty the buffers and cache on a Linux system?

Prior to doing some benchmarking work how would one free up the memory (RAM) that the Linux Kernel is consuming for its buffers and cache? Note that this is mostly useful for benchmarking. Emptying the buffers and cache reduces performance! If…
slm
  • 381,647
400
votes
3 answers

How to check OS and version using a Linux command

What is the Linux command to check the server OS and its version? I am connected to the server using shell.
sarath
  • 4,111
386
votes
14 answers

How to list all files ordered by size

I would like to list all files in the order of big to small in size and the files could be present anywhere in a certain folder.
Joe
  • 3,993
386
votes
12 answers

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: $ lscpu Architecture: x86_64 CPU op-mode(s):…
Achyuth23
  • 4,055
  • 4
  • 16
  • 11
379
votes
5 answers

How to set default file permissions for all folders/files in a directory?

I want to set a folder such that anything created within it (directories, files) inherit default permissions and group. Lets call the group "media". And also, the folders/files created within the directory should have g+rw automatically.
Chris
  • 8,710
378
votes
11 answers

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 certain time throughout the day?
camomileCase
  • 4,005
355
votes
27 answers

How can I get my external IP address in a shell script?

I need to find my external IP address from a shell script. At the moment I use this function: myip () { lwp-request -o text checkip.dyndns.org | awk '{ print $NF }' } But it relies on perl-libwww , perl-html-format , and perl-html-tree being…
319
votes
2 answers

how can I recursively delete empty directories in my home directory?

Possible Duplicate: How to remove all empty directories in a subtree? I create directories very often, scattered over my home directory, and I find it very hard to locate and delete them. I want any alias/function/script to find/locate and delete…
1
2 3
…
99 100