more nix Flashcards
What command shows you all the yum repos?
yum repolist all
What command shows you all the enabled yum repos?
yum repolist
or
yum repolist enabled
In what directory can you read all the repo lists in order to enable one and disable another and so forth?
cat /etc/yum.repos.d
What’s the command for adding a new yum repo
yum-config-manager –add-repo=url
Command for checking linux version?
lsb_release -d
cat /etc/os-release
hostnamectl
Command to disable a specific repo?
yum-config-manager –disable repoidhere(thisisaname)
or
go into the file for that repo and change “enabled” to 0 instead of 1
Get the exact location of the executing thing of a PID
ll /proc/PID/exe
list several ways to get information about what’s going on with a port
lsof -i :22 netstat -tunlpe | grep :22 netstat -anp | grep :22 fuser -v 22/tcp cat /etc/services | grep 22
----- ss -tunlpe | grep :22 lsof -i -P -n | grep :22 iptables -L -n cat /etc/sysconfig/iptables
How could you test a site before dns is ready and resolving?
modify the /etc/hosts file to point to a specific place by ip
examples:
actualipaddress somefakedomain.com
255.43.32.21 cpanel.rocks
How do you change the hostname?
vim /etc/sysconfig/network
change the HOSTNAME in there
then go around and fix up the /etc/hosts file to reflect your change - althought your hostname will change whether or not you fix this
Two ways to check the current system runlevel
runlevel
who -r
Check what services are running on startup
chkconfig or chkconfig –list for cent6
systemctl list-unit-files for cent7
make a service run on startup
chkconfig servicename on
chkconfig sshd on
make a service not run on startup for your current runlevel
chkconfig servicename off
chkconfig sshd off
systemctl disable servicename
remove a service from the chkconfig list
chkconfig –del servicename
chkconfig –del sshd