Linux
Linux
# Display free and used memory ( -h for human readable, -m for MB, -
g for GB.)
free -h
# Create a directory
mkdir directory
# Rename or move file1 to file2. If file2 is an existing directory, move file1 into directory file2
mv file1 file2
# Create an empty file or update the access and modification times of file.
touch file
# Display the last 10 lines of file and "follow" the file as it grows.
tail -f file
6 – PROCESS MANAGEMENT
# Display your currently running processes
ps
U G W
rwx rwx rwx chmod 777 filename
rwx rwx r-x chmod 775 filename
rwx r-x r-x chmod 755 filename
rw- rw- r-- chmod 664 filename
rw- r-- r-- chmod 644 filename
LEGEND
U = User
G = Group
W = World
r = Read
w = write
x = execute
- = no access
8 – NETWORKING
# Display all network interfaces and IP address
ip a
# Download http://domain.com/file
wget http://domain.com/file
# Install package.
yum install package
# Remove/uninstall package.
yum remove package
# Synchronize files/directories
between the local and remote system
with compression enabled
14 – DISK USAGE
# Show free and used space on
mounted filesystems
df -h
# Go to the $HOME
directory
cd
# Display SELinux details such as the current SELinux mode, the configured
mode, and the loaded policy.
sestatus
# Change the current SELinux mode to Enforcing. (Does not survive a reboot.)
setenforce 1
# Set the SELinux mode to enforcing on boot by using this setting in the
/etc/selinux/config file.
SELINUX=enforcing
# Set the SELinux mode to permissive on boot by using this setting in the
/etc/selinux/config file.
SELINUX=permissive
# Set the SELinux mode to disabled on boot by using this setting in the
/etc/selinux/config file.
17 – LOGGING AND
AUDITING
# Display messages in kernel ring
buffer.
dmesg