How to Unzip a .gz File Without Removing the Gzipped File?
To unzip a .gz file without removing the gzipped file, use the gunzip with the c option. To unzip a .gz file in Linux, use the gzip utility with the d option.
To unzip a .gz file without removing the gzipped file, use the gunzip with the c option. To unzip a .gz file in Linux, use the gzip utility with the d option.
To fix the “ls command not found” error, check the spelling and case letter of the command, add an environment PATH variable, and check file permission.
The & ampersand operator and && AND operator in Linux commands are used to run processes in the background or in a conditional way.
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.
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 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.
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.
In Linux, multiple edits with a single call to the sed command are performed on a string or a file by repeating the multiple sed patterns (single call to sed).
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.
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.
To install, remove, and upgrade packages on CentOS, utilize the “yum” package manager by specifying the package name in the terminal.
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 “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 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 update the NodeJS versions in Ubuntu, use the “NVM(Node Version Manager)”, “NPM(Node Package Manager)”, and “Binary Packages”.
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.
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.
To unzip the “.tgz” file in the Linux terminal, utilize the “tar”, and “gunzip”, commands. They required the zip file to have the “.tgz” extension.
To generate random strings in Linux, use the “Random Number Generator”, “OpenSSL library”, “UUID generator”, and “mktemp” commands.
To upgrade Docker on Ubuntu, first, uninstall Docker’s old version. Then, download and install the latest Docker package from the official Docker repository.
To uninstall MySQL in Ubuntu, remove the “mysql-server”, “mysql-client” and “mysql-common” packages from the operating system.
The “chmod +x” command modifies the file permissions and makes it executable. Also, make multiple files executables via the “chmod +x
To change the password on the root user and user account in Linux, execute the “sudo passwd root” and “sudo passwd
To set the date through the command line, utilize the “date”, “hwclock”, “timedatectl” and “ntpdate” commands by specifying the “YYYY-MM-DD hh:mm:ss” format.
The “export PATH=something:$PATH” command changes the “PATH” environment variable of the current system by specifying the path in the “something” variable.
To find all large files in the root filesystem, you can utilize the “find”, “du”, and “ncdu” commands. Also, you can specify the size limit, and sorting order.