Questions tagged [centos]

Community ENTerprise Operating System; a Linux distribution based on Red Hat Enterprise Linux widely used on web servers.

Filter by
Sorted by
Tagged with
202 votes
11 answers
35k views

I accidentally typed password into bash command line

I accidentally typed my password into bash command line, mistaking the Last login: ... line for Wrong password (I was in a hurry). What do I do to cover my trace? What I did was editing .bash_history ...
user avatar
  • 1,963
136 votes
2 answers
250k views

create tar with multiple directories and file locations

I have some scripts and files located in various locations like: /etc/dir1 /var/www/html /home/somedir I want to make a tar file so that it copies files and folders with the location structure. ...
user avatar
  • 1,463
106 votes
4 answers
477k views

Checking what PHP version I'm running on Linux?

I'm running Centos 5 and I need to know what version of PHP I'm running, is there a command for this which I can run?
user avatar
  • 2,874
92 votes
8 answers
211k views

How to Install gcc 4.7.x/4.8.x on CentOS

What would be the easiest way to install gcc 4.7.x/4.8.x on a system with CentOS 6.2+? The default RPM package contains an older version of gcc.
user avatar
  • 3,022
87 votes
4 answers
164k views

yum install gcc-g++ doesn't work anymore in CentOs 6.4

Today installed CentOs 6.4 fresh new on my workstation. I wanted to install g++. With my surprise I didn't succeed by using yum install gcc-g++ The thing is that even by doing a search I don't ...
user avatar
61 votes
4 answers
130k views

CentOS 7 VirtualBox no internet access

I am having trouble connecting my CentOS 7 guest to the internet. My VirtualBox Network configuration is as follows: Adapter 1: NAT; Adapter 2: Host-Only (vboxnet0) vboxnet0 is connected set up with ...
user avatar
  • 745
59 votes
3 answers
119k views

What is the difference between CentOS "DVD" vs "Everything" ISOs

What is the difference between the DVD ISO and the Everything ISO? These options are presented on the CentOS download page but there is no explanation as to what the difference is.
user avatar
52 votes
9 answers
160k views

How to stop kernel messages from flooding my console?

I'm using Centos 6, rsyslog logging. Console is flooded with kernel messages. Klogd is not running (I'm using rsyslog) Rsyslog config does not direct anything to the console Even tried stopping ...
user avatar
  • 21.4k
51 votes
4 answers
445k views

SSH permission denied on correct password authentication

I could successfully SSH into my machine yesterday with the exact same credentials I am using today. The machine is running CentOS 6.3. But now for some reason it is giving me permission denied. Here ...
user avatar
  • 1,382
47 votes
8 answers
282k views

How do you automatically detect a new network card in CentOS 6 / RedHat?

I'm using CentOS 6 in a virtual environment. When cloning a virtual version of CentOS, the old eth adapters are "removed" and replaced with new ones and net MAC addresses. However, the ifcfg-ethn ...
user avatar
  • 4,352
44 votes
3 answers
167k views

xrdp session: Login failed for display 0

I have just installed xrdp on my CentOs 7 following the steps in this article but could get as far as inputing my user name and password. Here's a screenshot of the error that I get after trying to ...
user avatar
  • 543
43 votes
3 answers
93k views

Difference between ${} and $() in a shell script

$ echo $(date) Thu Jul 2 16:33:11 SGT 2015 $ echo ${date} $ name=foo $ echo $(name) ksh: name: not found $ echo ${name} foo Seems like ${variable} is the same as $variable, while $() is to execute ...
user avatar
  • 1,385
43 votes
3 answers
93k views

Bidirectional clipboard not working in VirtualBox

I'm using VirtualBox Version 5.2.6 r120293 (Qt5.6.1). Guest OS: Windows 7 Ultimate (32-bit) Host OS: CentOS 7 I tried enabling bidirectional clipboard by going to Settings -> General -> Advanced and ...
user avatar
42 votes
10 answers
170k views

How can I add additional search domains to the resolv.conf created by dhclient in CentOS

When my CentOS virtual machine boots it uses DHCP to get an IP address. It also overwrites resolv.conf with the DNS settings provided by the DHCP server. The DHCP server doesn't supply any search ...
user avatar
42 votes
1 answer
75k views

what is run-parts in /etc/crontab, and how do I use it

I have been digging through my Linux system. To try and understand how it all works In the /etc/crontab file. I see the following # run-parts 01 * * * * root run-parts /etc/cron.hourly 02 4 * * * ...
user avatar
  • 11.7k
41 votes
5 answers
83k views

How to view history of Yum commands (update, install, remove)?

I'm seeing some errors in my apache logs and they may (or may not) be related to some packages that I recently installed/removed using Yum. Is there a way to view the history of Yum packages that ...
user avatar
  • 513
40 votes
4 answers
209k views

Where Linux places the messages of boot?

I want to find place to where Linux writes all boot messages. You know: facility one [STARTED] facility two [STARTED] facility three [FAILED] I searched with find . -print0 | xargs -0 grep -...
user avatar
  • 2,019
39 votes
6 answers
98k views

How to combine the 'tar' command with 'find'

The find command gives this output: [root@localhost /]# find var/log/ -iname anaconda.* var/log/anaconda.log var/log/anaconda.xlog var/log/anaconda.yum.log var/log/anaconda.syslog var/log/anaconda....
user avatar
  • 3,661
38 votes
1 answer
11k views

Why is unzipped directory much smaller (4.0 K) than zipped (73.0 G)?

I unzipped a zipped file using zip -l <filename> but what get is a dir much smaller than what it was before unzipping. Unzipped dir has all the files mostly videos. Why is the unzipped ...
user avatar
  • 457
38 votes
6 answers
117k views

yum hangs and won't respond

I am running yum check-update and it freezes after a 2 lines of output: Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile I'm not sure what is happening. The last things I ...
user avatar
  • 1,629
36 votes
6 answers
94k views

How to automatically run commands on SSH login?

Whenever I login to my Linux server I'd like to have several commands run automatically (set some variables, change location, etc.) This needs to be done on user login, not on system start. How can ...
user avatar
  • 755
36 votes
12 answers
112k views

what causes “systemd: Failed at step USER spawning /usr/sbin/opendkim: No such process”

How can I remove following error: systemd: Failed at step USER spawning /usr/sbin/opendkim: No such process It occurs when I try to start opendkim service on Centos.
user avatar
  • 461
32 votes
5 answers
144k views

How to disable ipv6 on a specific interface in Linux?

Could someone tell me how to disable ipv6 auto-config on a specific network interface in CentOS? The current situation is: A PC has two network adapters eth0 and eth1 that are connecting to the same ...
user avatar
29 votes
6 answers
66k views

Check if a DHCP server existing in my network using bash

using CentOS with static IP, Is there any way to determinate if a DHCP server running on the network using bash ?
user avatar
  • 513
29 votes
3 answers
28k views

sshfs is failing with "remote host has disconnected"

I'm running sshfs with the following: sshfs basicuser@192.168.1.111:/var/www/myapp /home/basicuser/code -o sftp_server="/usr/bin/sudo /usr/libexec/openssh/sftp-server" I have also created RSA keys ...
user avatar
28 votes
3 answers
71k views

systemctl access denied when root

When I run sudo systemctl disable avahi-daemon.socket I get Failed to execute operation: Access denied But it's run as root, how can access be denied? (CentOS 7)
user avatar
  • 1,840
28 votes
8 answers
78k views

Are we supposed to manually delete the contents of /tmp?

I was under the impression that “old” files in /tmp will be regularly deleted. However, it seems to me that /tmp will just grow as long as it wants to, and nothing will be deleted. Some people say it’...
user avatar
  • 5,257
28 votes
5 answers
61k views

To use ssh-id-copy do you need both id_rsa.pub and id_rsa?

I am trying to setup a second access ssh key for a friend. He sent me his id_rsa.pub. ssh-copy-id -i id_rsa.pub root@123.123.123.123 /usr/local/bin/ssh-copy-id: ERROR: failed to open ID file './...
user avatar
26 votes
3 answers
13k views

what is diff bentween xargs with braces and without in linux

I want to know what is the difference between this ls | xargs rm ls | xargs -i{} rm {} Both are working for me
user avatar
25 votes
4 answers
99k views

Where to find SSH Login log files on centos

I have shared a .pem file with few a developers and now something went wrong on the server. I would like to track logins in a log so that I can see who (IP) made changes and when (if even possible) ...
user avatar
  • 353
25 votes
3 answers
16k views

Install emacs without sudo?

I have been using vim for years, and I don't really like it. I'd like to try emacs for a while, but it's not installed on any of the linux servers I use regularly. I don't have root so apt-get ...
user avatar
25 votes
4 answers
163k views

Centos 7 - ping 8.8.8.8 (connect: Network is unreachable)

I think I have a routing problem. I have set up a CentOS VM, it is connected to my network and I can ping other machines. I cannot however ping anything outside of my network. [root@localhost ~]# ...
user avatar
  • 395
25 votes
3 answers
133k views

How to completely uninstall a package (including all extra files that came with it) using yum (or rpm)?

When I do yum remove, it sometimes keeps a package's configuration files. Is there anyway to remove a package completely, without keeping any file that belonged to the package? I am running CentOS.
user avatar
  • 1,956
24 votes
10 answers
147k views

How to install pip and easy_install on CentOS

I tried to install pip and easy_install on my CentOS but could not find them. How can I install them? Also, I have two versions of Python, 2.4 and 2.7. How will pip make sure to link newly installed ...
user avatar
  • 2,753
24 votes
3 answers
122k views

How to find which files and folders were deleted recently in Linux?

I am having one particular folder (/home/sam/officedocuments) which is having hundreds of folders and files. I think I deleted some files and folders by mistake but I'm not sure. How to find which ...
user avatar
  • 405
23 votes
4 answers
32k views

How to find which package certain command belongs to on CentOS?

For example I can easily find locate command belongs to mlocate.i386 package. yum search locate mlocate.i386 : An utility for finding files by name [mirror@home /]$ rpm -qa | grep locate mlocate-0.15-...
user avatar
  • 2,129
21 votes
3 answers
7k views

Moving 2TB (10 mil files + dirs), what's my bottleneck?

Background I ran out of space on /home/data and need to transfer /home/data/repo to /home/data2. /home/data/repo contains 1M dirs, each of which contain 11 dirs and 10 files. It totals 2TB. /home/...
user avatar
  • 343
20 votes
3 answers
35k views

how to stop cp: overwrite './xxx' ? prompt

How can I stop the cp command from prompting to overwrite. I want to overwrite all the files with out having to keep going back to the terminal. As these are large files and take some time to complete....
user avatar
  • 11.7k
20 votes
1 answer
20k views

Remove port aliases in iptables

How can I make iptables show me port numbers instead of aliases for well known port numbers (eg. http for 80, https for 443 etc.). Is there a way to make it show just port numbers at all times?
user avatar
  • 389
20 votes
3 answers
15k views

Is sendmail an smtp server? Is there any difference between MTA and mail server?

I am new to mail and do not exactly know how it works. I have seen administrators use sendmail to send out email. Is sendmail an smtp server or is it a client that relies on smtp server to relay ...
user avatar
  • 1,385
19 votes
1 answer
141k views

How to know the directory size in CENTOS [duplicate]

I have a website on my server and I own it. The size of the website is around a whopping 170GB. This shouldn't be this much. At most, it should be around 20GB. I don't know what makes it that big. I ...
user avatar
  • 1,824
19 votes
3 answers
26k views

What does an empty iptables mean?

I’m using CentOS and when type in the following iptables command: iptables -L -v The output is as follows: Chain INPUT (policy ACCEPT 19614 packets, 2312K bytes) pkts bytes target prot opt in ...
user avatar
19 votes
3 answers
24k views

How can I perform a full texlive installation (all packages) in CentOS?

Title say it all, how can I install texlive and all the packages so I can run tex2pdf on CentOS? I'm rather used to Ubuntu and all this yum business is driving me nuts.
user avatar
  • 361
18 votes
4 answers
110k views

Adding --no-check-certificate to yum repositories

I have added virtio-win.repo according to this guide. The content of /etc/yum.repo.d/virtio-win.repo is now [virtio-win-stable] name=virtio-win builds roughly matching what was shipped in latest RHEL ...
user avatar
  • 995
18 votes
1 answer
31k views

Using colour schemes with vim and putty

I am trying to use the desert color scheme with VIM 7.0 on CentOS 5.6 x64 located here: http://hans.fugal.net/vim/colors/desert.vim I've downloaded the file and saved it in my ~/.vim/colors ...
user avatar
  • 2,090
17 votes
4 answers
4k views

How to edit .bashrc without logging in

This is probably a duplicate question, but I'm not familiar enough with the login/boot process of CentOS (especially on a VM) to know what to search for. I'm running CentOS 7 in VirtualBox. I ...
user avatar
17 votes
5 answers
21k views

Execute a command if Linux is idle for 5 minutes

I would like to execute a command such as notify-send 'a' if my Linux machine has been idle for 5 minutes. By idle, I mean the same thing a screen saver that gets activated would use to define "...
user avatar
17 votes
1 answer
64k views

How do I copy/paste into a minimal installation of CentOS on VirtualBox?

I am trying to copy&paste from my local Windows machine into my CentOS guest machine, running on VirtualBox. The CentOS installation is minimal (only the console). I followed this guide, and ...
user avatar
  • 271
16 votes
4 answers
115k views

How can I determine the MAC address for a NIC in CentOS without using ifconfig?

CentOS 5.5 One of my CenTOS systems recently booted with the following error: "Bringing up interface eth0: Device eth0 has difference MAC address than expected. ignoring." When I run ifconfig -a ...
user avatar
  • 2,590
16 votes
5 answers
50k views

Can't kill a sleeping process

I don't seem to be able to kill -9 a process which is in an interruptible sleep (S) state: [root@jupiter ~]# ps -elf | grep yum 4 S root 16790 1 0 75 0 - 73779 - Jan15 ? 00:00:...
user avatar
  • 502

1
2 3 4 5
64