1/152
Looks like no tags are added yet.
passwd
sudo -i
environment. (Login shell.)
sudo -s
(Non-login shell.)
sudo -l
visudo
getenforce
sestatus
SELinux mode
setenforce 0
Permissive. (Does not survive a reboot.)
setenforce 1
Enforcing. (Does not survive a reboot.)
SELINUX=enforcing
by using this setting in the /etc/selinux/config file.
SELINUX=permissive
by using this setting in the /etc/selinux/config file.
SELINUX=disabled
using this setting in the /etc/selinux/config file
cd ..
the parent directory.)
cd
cd /etc
alias goto='cd /etc/'
yum search keyword
yum install package
yum info package
rpm -i package.rpm
yum remove package
yum update package
tar zxvf sourcecode.tar.gz cd sourcecode ./configure make make install
apt-get update
apt-get upgrade
apt-get install package
apt-remove package
grep pattern file
# Search for pattern in file
grep -r pattern directory
# Search recursively for pattern in directory
locate name
# Find files and directories by name
find /home/john -name 'prefix*'
# Find files in /home/john that start with "prefix"
find /home -size +100M
# Find files larger than 100MB in /home
whereis program
# Display the location of the binary, source and
manual page files of program
which program
# Display the path of executable that would run if
program is executed
df -h
df -i
fdisk -l
du -ah
du -sh
du -a directory
findmnt
ssh host
ssh user@host
ssh -p port user@host
ssh-keygen
ssh-copy-id user@host
scp file.txt server:/tmp
scp server:/var/www/*.html /tmp
/tmp folder
scp -r server:/var/www /tmp
rsync -a /home /backups/
rsync -avz /home server:/backups/
ftp host
chown john /path/to/file
Change ownership of /path/to/file to
john
chgrp sales /path/to/file
Change group ownership of
/path/to/file to group sales
dmesg
Display messages in kernel ring buffer
journalctl
Display logs stored in the systemd
journal
journalctl -u servicename
Display logs for a specific unit (service)
ip a
ip addr show dev eth0
ethtool eth0
ping host
whois domain
dig domain
dig -x IP_ADDRESS
host domain
hostname -i
hostname -I
wget http://domain.com/file
netstat -nutlp
ifconfig
traceroute host
tcpdump
tar cf archive.tar directory
directory
tar xf archive.tar
tar czf archive.tar.gz directory
tar xzf archive.tar.gz
tar cjf archive.tar.bz2 directory
tar xjf archive.tar.bz2
ls -al
pwd
mkdir directory
rm file
rm -r directory
rm -f file
rm -rf directory
cp file1 file2
cp -r source_directory destination
mv file1 file2
ln -s /path/to/file linkname
touch file
cat file
less file
head file
tail file
tail -f file
ps
Display currently running processes
ps -ef
Display all currently running processes on the system
ps -ef | grep processname
Display process information for processname
top
Display and manage the top processes
htop
Interactive process viewer (top alternative)