How to Understand the Action of nc -l Command?
In Linux, the “nc -l” command creates a simple network server by specifying the
In Linux, the “nc -l” command creates a simple network server by specifying the
In Linux, the “ALL ALL=(ALL) ALL” grants full sudo privileges to all users on all hosts for all commands in the sudoers file.
The & wait $! notation allows scripts to run commands in parallel, wait for commands to complete, or perform actions based on the success or failure of commands.
In Bash, the “<<<” operator means “here strings.” It allows users to pass a string as the standard input to a command via the “command <<< string” syntax.
To restart the Bash shell without restarting the terminal application, type the “exec bash” command that replaces the current process with the Bash shell.
To start/stop or enable/disable the firewalld services, execute the “sudo systemctl
Users can monitor log files in real-time and keep tailing them even when the latest date of one changes by following the “tail [options] [log_file]” syntax.
To match the exact string using the “grep” command, use the “grep -w “matching_string”
To clean the yum cache for untracked repositories, disable the untracked repositories and clean the Yum cache via the “yum clean all” command.
To enable/disable SELinux modes in CentOS, assign the “enforcing” or “disabled” value to the SELINUX parameter in the SELinux configuration file.
To test the PHP script in Linux, create a .php script file and run the “php script_name.php” command. Also, users can access the script file in the web browser.
The “cmake: command not found” error is fixed by installing the “Cmake” package or adding the Cmake binary to your PATH environment variable.
The “Nslookup: command not found” error occurs when the nslookup command is not installed. To install it, run the “yum install bind-utils” command.
To change the runlevels (targets) with the systemd in CentOS, use the “systemctl set-default
In Linux, the “su -” is utilized to switch to a user account with a login shell session, and the “su root” switches to the root user account without a login shell.
An exit code of “2” means the program or command could not execute successfully. It usually occurs when the command syntax needs to be corrected.
To generate a sequence of numbers in the same line in Bash, use the “seq” command with the “s” option and “echo” commands.
To install PHP on CentOS, use the “yum install php” command. Users can also install PHP modules by executing the “ yum install php-module-name” command.
In iptables, chains provide a flexible and powerful way to manage network traffic. Users can create custom chains and define specific sets of rules in them.
To generate random numbers in a specific range, utilize the “shuf” command, “$RANDOM” variable, and “jot” command. These methods require a range of numbers.
To time a specific command in Linux, execute the “time
In Linux, the “arping” command sends ARP requests to the host by specifying the IP address and verifying the availability of hosts on a network.
To find duplicate files in the quickest way, use the “fdupes” command with the “r” option by specifying the directory name.
To uninstall a .deb installed package with dpkg, use the “sudo apt -remove
The “lftp” command transfers or manages files in a remote machine by making a connection over protocols including UDP, HTTP, FTP, and many more.
The .ts is the “Transparent Stream” acronym and is a type of video format. This is used to store videos on DVDs and stream them over the internet.
To follow the redirect to the URL, execute the “curl -L
The Reverse DNS Lookup finds the hostname associated with the specified IP address. It can be found in Linux by dig, host, and nslookup commands.
To sync the time with the NTP server in Linux, use the “ntp”, or “chrony” commands. It synchronizes the computer with the NTP server.
The “lrwxrwxrwx” permission specifies that the symbolic link to another file has read, write, and execution permissions to all its users and groups.
In Linux, use the WPA_Supplicant to connect with the Wi-Fi networks. Also, establish connections with hidden, insecure networks and WEP routers.
Run level defines the operating system’s initialization behavior in Unix. This post will help readers better understand the run-level in Linux.
To install, remove, and upgrade packages on CentOS, utilize the “yum” package manager by specifying the package name in the terminal.
To install, remove, query, and update RPM packages, use the “yum” command by specifying the package name in the terminal of CentOS.
By default, NTPD uses UDP port 123 for NTP servers and 1023 port for NTP clients. These ports need to open to allow incoming NTP traffic.
The “$?” variable holds the exit status of the last command executed by returning a value that confirms whether the script is executed or not.
The “sudo rm -rf /*” command recursively deletes all files and directories from the root directory. It deletes all the files on the computer permanently.
To output the binary representation of a hex number, execute the “echo -n “
In a Bash shell, $0 is a variable that represents the name of the current shell script. It displays the script name in the Command Line.
In Bash, the regular expression ‘^[0-9]+$’ matches a string that contains only one or more digits (0-9) and no other characters.
To set the default gateway in Ubuntu, execute the “sudo ip route add default via
To remove NodeJS from Ubuntu, use the APT package manager and source directory to remove packages along with all dependent and configuration files.
To instant search with the “less” command, use the “less
To install the latest version of Python on CentOS, use the YUM package manager, and source code that is given on the official Python website.
In Ubuntu, the “wheel” group is a special user group that provides administrative access to certain users on a system to perform administrative tasks.
To check the version of Apache running on a Ubuntu, use the “apache2”, “type”, “apt”, “apachectl”, and “tail” commands or web browser (GUI).
In Linux, the error “cp: omitting directory” represents that the “cp” command expects a file as the source, not a directory.
To export a GPG private and public key, use the “gpg –export-secret-key -a
To add a DNS server via resolv.conf configuration file, add a nameserver directive followed by the IP address of the DNS server.
To capture all the UDP packets using the tcpdump command, execute the “sudo tcpdump -i
To step into, step over, and step out with GDB, use the “step”, “next”, and “finish” commands. These GDB commands quickly identify and fix bugs in the program.
In Ubuntu, the Apache access log files are stored in the “/var/log/apache2” directory. These files contain details of all the requests made to the web server.
To install and run the TFTP server, execute the “sudo apt install tftpd-hpa” command and configure the “tftpd-hpa” configuration file.
To give full permission to a folder and its subfolders, use the “chmod 777
To force a clock update using the NTP server, use the “ntpdate” command and “ntpd” service. They synchronize the time on the system with the time NTP server.
To upgrade Java on Ubuntu, use the “sudo apt install openjdk-19-jdk” command or download the latest version of Java from the Oracle website and install it.
To find out which users are in a group within Linux, utilize the “groups”, “getent”, and “id -Gn” commands and the “/etc/group” file.
To reverse SSH tunneling connection, execute the “ssh -R
The difference between cp -r and cp -a is that cp -a preserves all file attributes, while cp -r only preserves the ownership and permissions of the files.
To start and stop the MySQL server on ubuntu, execute the “sudo systemctl start mysql” and “sudo systemctl stop mysql” commands.
To make ZSH the default shell in Ubuntu, use the “chsh -s $(which zsh)” or “sudo usermod -s /usr/bin/zsh
To run the SSH server on a port other than 22 is possible by changing the port number in the “sshd_config” configuration file
To get the file created/creation time in Linux, use the “stat”, “debugfs”, “ls” commands, and “Properties” options in GUI.
In Bash, the main difference between $@ and $* is that “$@” preserves the individual arguments as separate words, while other preserves them as a single string.
To forcefully use wget for a proxy server without modifying system files, set “http_proxy” and “https_proxy” variables with server address and port.
The “ps -ef | grep processname” command filters out a process from a list of running processes and displays information in the Linux system.
In Ubuntu, major log files are located in the “/var/log” directory. It includes “sys.log”, “auth.log”, and “kern.log” log files.
Linux offers the “crontab -l” command to get a list of all scheduled cron jobs. It displays jobs on the basis of monthly, weekly, daily, and hourly.
To get a list of all installed PPA repositories, utilize the “apt policy” command, “Software & Updates” utility, and “/etc/apt/sources.list” file.
To install dependencies automatically with the dpkg package manager, users can execute the “sudo apt install -f” command in the terminal.