How to See Full Log From systemctl status service?
To see the full log from systemctl status services, execute the “systemctl status service_name -l” command in the system.
To see the full log from systemctl status services, execute the “systemctl status service_name -l” command in the system.
In Bash, the “eval” command evaluates its arguments as a shell script including “commands”, “variables”, “arithmetic expressions”, and “strings”.
To find the last login on Linux, use the “last”, “lastlog”, “/var/log/auth.log”, “who” and “lastb” commands that display username, terminal, date, and time.
To install the “tar.gz” files using sudo, extract the files, configure the binaries, then compile them, and lastly install the executable using sudo in Linux.
Load average is the measure to determine the processes running or waiting to be run on the CPU. Three different methods can find the load average.
Ubuntu offers the “apt-cache search”, “apt search”, “apt list”, and “dpkg” commands to search available packages from the command line.
To run the getent command in Linux, follow the general syntax “getent [Options] [Database] [Key]”. It finds the information from the computer’s databases.
Ubuntu offers the “.bashrc”, “.profile”, and “/etc/environment” files to add a path to the PATH environment variable permanently.
To find and change the MAC address, the ifconfig command, ip command, and “/sys/class/net/*/address” file are used in the system.
The passwd command is used by following the general syntax of the “passwd [Options] [User name]” to set and change the password of user accounts.
The Xmax scan can be performed using the nmap command in the system. This scan displays the status of the ports of the target machine.
In Linux, the 6 best ways to view files are by using the commands, i.e., cat, more, less, nl, xdg-open, and text editors, i.e., nano.
To enable and disable the root user account in Ubuntu, utilize the “sudo -i” and “sudo -s”, “usermod”, “passwd” commands, and “sshd_config” files.
The “/dev/null” is a powerful tool in Linux that allows users to discard unwanted data, suppress error messages, make files disappear, and many more.
CentOS / RHEL offers the “clean all” command to clean the entire YUM cache, including “metadata ”, “package headers”, and “packages” from the system.
CentOS offers the “rpm -ql
CentOS offers the “yum” package manager to install the telnet via the “sudo yum install telnet” command. To configure it, enable the “telnet.socket” services.
CentOS offers the “firewall-cmd –permanent –add-port=80/tcp” command to open a port in the system. For this, configure the firewall to allow traffic.
CentOS offers the “YUM” to install a specific version of an RPM package on a system. For this, specify the “package name” and the “version”.
CentOS / RHEL offers the “sysctl” configuration file and “kernel” module to disable IPv6 in the system. For this, setting the disable_ipv6 parameter to 1.
CentOS offers the “ntpdate” command with the “ntpd” service to synchronize the NTP server forcefully. It sets the system time with the time of the NTP server.
To configure Docker to use a proxy, set the proxy information in the Docker daemon configuration file or pass the proxy information as environment variables.
Linux offers the “taskset” command to set or retrieve the CPU affinity of a running and a new process or thread in the operating system.
Linux offers the “echo “Body” | mailx -a attachment.pdf -s “Subject” [email protected]” command to send and receive email messages.
Linux offers the “sudo mkfs.xfs
Linux offers the “chmod” command with the “x” permission to make a Bash script executable. Also, you can set permission using the octal numbers.
Linux offers the “quotes”, “backslashes”, and “tab-completion” methods to read a filename with spaces in a specified directory.
To show the PATH of an environment variable, execute the “echo”, “cat”, “env”, “set”, and “printenv” commands with the “PATH” variable.
Linux offers the “sshpass -p [password] ssh [user]@[host]” command to connect to the remote host using a non-interactive SSH login.
The “utmp”, “wtmp”, and “btmp” files store the info of currently logged-in users, historical logs of all logins and logouts, and the failed login attempts.
Ubuntu offers the “hosts” file to map the hostnames to IP addresses. Ubuntu’s default location of the hosts file is “/etc/hosts”.
To enable any service, use the “sudo systemctl enable service_name” and to disable any service, use the command “sudo systemctl disable service_name”.
Linux offers “mount”, “df”, “cat /proc/mounts”, “lsblk”, and “findmnt” commands to check the mounted filesystem along with the mount point.
To mount the exFAT drive on Ubuntu Linux, create a mount point and specify the drive name. Lastly, use the mount command to mount it.
Linux offers the “sudo gpasswd -d
Linux offers the “history” command with the “c” option to clear the bash history. It removes all the records of previously entered commands in the terminal.
CentOS / RHEL offers the “clean all” command to clean the entire YUM cache, including “metadata ”, “package headers”, and “packages” from the system.
The absolute path gives the exact location of a file or directory, while the relative path refers to the file and directory in the current working directory.
Linux offers the “nice” commands to run a program with a modified scheduling priority and “renice” for an already-running process.
Linux offers the “mount” command to mount the file system or partition on a specific directory. It is useful to access and control the file system from the OS.
Linux offers the “nstat” command to display real-time network statistics in the terminal. Also, you can visualize the information about specific kernels.
Linux offers the “pdftk” and “ghostscript” command-line tools to merge multiple or all PDF files into a single file on Ubuntu.
Linux offers the “cat”, “less”, “more”, “head”, and “tail” commands to display the contents of a text file on the Linux command line.
Linux offers the “sestatus”, “getenforce” commands, and “etc/selinux/config” files to check whether SELinux is enabled or disabled.
Linux offers the “/etc/resolv.conf” file and the “Network Settings” in CLI and GUI methods to change the DNS server IP address in the system.
Linux offers the “smbpasswd” command with “-a” and “-x” options to add and delete samba users in Linux. For this, it is necessary to install the “samba” package.
Linux offers the “sysctl.conf” configuration file to permanently and temporarily disable the IPv6 services on Ubuntu 22.04 Jammy Jellyfish Linux.
Linux offers the built-in “OpenSSL” library to create the “.crt” file that establishes a secure connection between a server and a web browser.
The crontab offers the “MAILTO” parameter to set the mail address to send notifications. Once the job is executed, an email will be sent to the address.
Linux offers the “free”, “top”, “vmstat”, and “cat /proc/meminfo” commands and “System Monitor” application (GUI) to check the available memory.
The “yum –downloadonly [options] [package]” command downloads a package without installing them in CentOS. Also, specify the location to download the package.
Linux offers the “tar” command with the “tvf” option to view the contents of a tar file. It displays the “file names”, “date and time”, and “file location”.
Linux offers the “lsusb” command to display a list of all USB devices connected to the system, including the device’s vendor ID, product ID, and device class.
Linux offers the “scp” command to copy/transfer files between remote systems. Also, you can copy a file from the local to a remote machine and vice versa.
Linux offers the “curl -A” option, the “.curlrc” file, and the “CURL_USER_AGENT” environment variable to set the user agent.
Linux offers the “curl” command to make REST API requests to the server. Different HTTP methods, GET, POST, PUT and DELETE, are used to manage data.
Linux offers the “nemo” command to install the Nemo file manager in the system. Also, you can configure it as a default and perform many actions.
Linux offers the “fallocate” command to create a swap file in the operating system by specifying the file name and desired size.
Linux offers the “nmap” command to scan the subnet by displaying the connected devices over the IP addresses in the same network.
Linux offers the “hexdump” command to visualize the contents of a file in a hexadecimal and ASCII, canonical, and custom format string.
To install the GNOME desktop environment and minimal version, run the “ubuntu-gnome-desktop” and “ubuntu-desktop-minimal” commands in the system.
The docker “run” command starts a new container from a docker image. The users can set up the new container, the password, and the volume of the container.
To kill a process in Linux, the “kill”, “kilall”, “pkill”, “xkill” and “top” commands are used.
They require the process name or id to kill the process.
To install MySQL on CentOS 7, the “mysql-server” package is required after enabling the repository of MySQL 8.0. It installs all dependencies in the system.
To reload the changes to Systemd unit files, execute the “systemctl daemon-reload” command. Also, you can reload the specific unit files in the system.
To change the GRUB timeout in Linux, open the “/etc/default/grub” configuration file and set the “GRUB_TIMEOUT” value in seconds.
The boot loader loads the OS into memory and starts it. It is responsible for initializing the system, performing hardware tests, and giving control to the OS.
The “sshfs” command mounts the remote directory by specifying the local mount point. This command requires the “username” and “hostname” of the remote machine.
To unban an IP in fail2ban, the “fail2ban-client” utility is used by specifying the banned IP Address in IP List. This utility prevents unauthorized activity.
Linux offers the “cat” command to display the “MOTD” in the terminal. Also, users can display the custom MOTD after accessing the /etc/motd file.