search
HomeSystem TutorialLINUXDetailed explanation of commonly used FAQs in Ubuntu operating system

1. Record how to view the crontab log on ubuntu server

crontab logging

Modify rsyslog

sudo vim /etc/rsyslog.d/50-default.conf

cron.* /var/log/cron.log #Remove the comment character in front of cron

Restart rsyslog

sudo service rsyslog restart

View crontab log

less /var/log/cron.log

2. Reset the default editor of crontab -e in ubuntu

Ubuntu System Admin Set up scheduled tasks on the first-line server, and accidentally selected nano. Since I have been exposed to the redhat series before, I was not used to using nano, so I wanted to reset it. I checked online, and it seemed that it was not available. .

In desperation, I reinstalled a server to test, and found that when you select the editor with crontab -e for the first time, you will be reminded: If you want to change the selection in the future, enter select-editor. Alas, you are still not careful enough. . . sudo select-editor select vim to get it done. .

root@ubuntu:/var/www# select-editor

Select an editor. To change later, run 'select-editor'.

1. /bin/ed

2. /bin/nano

3. /usr/bin/vim.basic

4. /usr/bin/vim.tiny

The selected number is "3", /usr/bin/vim.basic.

3. Change ubuntu dash shell to bash

The default script parser under ubuntu shell is dash, which will cause some bash scripts to fail to execute.

Change back to bash as follows:

sudo dpkg-reconfigure dash

Choose NO

4. How to modify resolv.conf

unbuntu will reset resolv.conf every time it restarts

1. Write the dns-nameservers in the /etc/network/interfaces file into resolv.conf

2. Copy the contents of /etc/resolvconf/resolv.conf.d/base to resolv.conf

Therefore, if we want to ensure that resolv.conf remains unchanged after each restart, we must start by modifying the above two files

5. How to modify the IP

Just modify the following configuration file

cat /etc/network/interfaces

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

# The loopback network interface

auto lo

iface lo inet loopback

# The primary network interface

auto eth0

iface eth0 inet static

address 192.168.1.100

netmask 255.255.0.0

network 192.168.0.0

broadcast 192.168.255.255

gateway 192.168.1.1

# dns-* options are implemented by the resolvconf package, if installed

dns-nameservers 192.168.0.1

6. Modify the host name

Just modify the following two files

/etc/hostname

/etc/hosts

The above is the detailed content of Detailed explanation of commonly used FAQs in Ubuntu operating system. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:脚本之家. If there is any infringement, please contact admin@php.cn delete
How does the command line environment of Linux make it more/less secure than Windows?How does the command line environment of Linux make it more/less secure than Windows?May 01, 2025 am 12:03 AM

Linux'scommandlinecanbemoresecurethanWindowsifmanagedcorrectly,butrequiresmoreuserknowledge.1)Linux'sopen-sourcenatureallowsforquicksecurityupdates.2)Misconfigurationcanleadtovulnerabilities.Windows'commandlineismorecontrolledbutlesscustomizable,with

How to Make a USB Drive Mount Automatically in LinuxHow to Make a USB Drive Mount Automatically in LinuxApr 30, 2025 am 10:04 AM

This guide explains how to automatically mount a USB drive on boot in Linux, saving you time and effort. Step 1: Identify Your USB Drive Use the lsblk command to list all block devices. Your USB drive will likely be labeled /dev/sdb1, /dev/sdc1, etc

Best Cross-Platform Apps for Linux, Windows, and Mac in 2025Best Cross-Platform Apps for Linux, Windows, and Mac in 2025Apr 30, 2025 am 09:57 AM

Cross-platform applications have revolutionized software development, enabling seamless functionality across operating systems like Linux, Windows, and macOS. This eliminates the need to switch apps based on your device, offering consistent experien

Best Linux Tools for AI and Machine Learning in 2025Best Linux Tools for AI and Machine Learning in 2025Apr 30, 2025 am 09:44 AM

Artificial Intelligence (AI) is rapidly transforming numerous sectors, from healthcare and finance to creative fields like art and music. Linux, with its open-source nature, adaptability, and performance capabilities, has emerged as a premier platfo

5 Best Lightweight Linux Distros Without a GUI5 Best Lightweight Linux Distros Without a GUIApr 30, 2025 am 09:38 AM

Looking for a fast, minimal, and efficient Linux distribution without a graphical user interface (GUI)? Lightweight, GUI-less Linux distros are perfect for older hardware or specialized tasks like servers and embedded systems. They consume fewer res

How to Install Wine 10.0 in RedHat DistributionsHow to Install Wine 10.0 in RedHat DistributionsApr 30, 2025 am 09:32 AM

Wine 10.0 stable version release: Running Windows applications on Linux to a higher level Wine, this open source and free application, allows Linux users to run Windows software and games on Unix/Linux operating systems, ushering in the release of the 10.0 stable version! This version has been provided with source code and binary package downloads, and supports various distributions such as Linux, Windows and Mac. This edition embodies a year of hard work and over 8,600 improvements, bringing many exciting improvements. Key highlights include: Enhanced support for Bluetooth devices. Improve support for HID input devices. Optimized performance of 32-bit and 64-bit applications.

How to Install and Configure SQL Server on RHELHow to Install and Configure SQL Server on RHELApr 30, 2025 am 09:27 AM

This tutorial guides you through installing SQL Server 2022 on RHEL 8.x or 9.x, connecting via the sqlcmd command-line tool, database creation, and basic querying. Prerequisites Before beginning, ensure: A supported RHEL version (RHEL 8 or 9). Sudo

How to Install Thunderbird 135 on a Linux DesktopHow to Install Thunderbird 135 on a Linux DesktopApr 30, 2025 am 09:26 AM

Mozilla Thunderbird 135: Powerful cross-platform mail client Mozilla Thunderbird is a free, open source, cross-platform email, calendar, news, chat and contact management client designed to efficiently handle multiple email accounts and news sources. On February 5, 2025, Mozilla released the Thunderbird 135 version, introducing a number of new features, performance improvements and security fixes. Thunderbird 135 main features: XZ Packaging for Linux Binaries: Smaller files, faster unpacking, and better integration with modern distributions. Cookie storage support: when creating space

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),