File 1 that is frequently modified in linux

Source: Internet
Author: User
Linux files that need to be modified frequently 11 system settings article 1001 modify the host name: vi/etc/sysconfig/network, change the HOSTNAME line to & quot; HOSTNAME host name & quot; (no such line? Add this line), and then run the Command & quot; hostname host name & quot ;. Modify/etc/h... files frequently to be modified in linux 1 system settings article 1001 modify the host name: vi/etc/sysconfig/network, change the HOSTNAME line to "HOSTNAME = host name" (no such line? Add this line), and then run the command "hostname host name ". You must modify the host name in the/etc/hosts file. In this way, no matter whether you restart or not, the host name is modified successfully. 1002 modify the linux startup mode (text mode or xwindow mode): vi/etc/inittab and find the id: x: initdefault: one line, x = 3 indicates the text mode. x = 5 indicates the xwindow mode. restart the machine to apply the setting. 1003 mount usage (sakulagi, sxsfxx, aptkevin) fat32 partition mount-o codepage = 936, iocharset = cp936/dev/hda7/mnt/cdromntfs partition mount-t ntfs-o codepage = 936, iocharset = cp936/dev/hda7/mnt/cdromiso file mount-o loop/abc. iso/mnt/cdrom floppy disk mount/dev/fd0/mnt/floppyusb mount/dev/sda1/mnt/cdromcd optical drive Mount-t iso9660-o iocharset = cp936, ro/dev/cdrom/mnt/cdromdvd drive mount-t iso9660-o iocharset = cp936, ro/dev/dvd/mnt/cdrom or mount-t udf/dev/dvd/mnt/cdrom note: the dvd format is usually iso9660 or one of the UDFs is on a computer with a scsi hard disk, should I use fdisk-l/dev/sd first? Let's see which device the usb flash drive is on (generally sdb1 or sdc1 ). Mount-a for all/etc/fstab content. this command can also specify the file format "-t format", which can be vfat, ext2, and ext3, for example, to automatically mount windows drive d to/mnt/d, open/etc/fstab with vi, add the following line/dev/hda5/mnt/d vfat ULTS ults, codepage = 936, iocharset = cp936 0 0 note: first you must manually create a/mnt/d directory chown nobody/mnt/d1004 to access the remote shared directory and put the following rows in/etc/fstab: ip/share1/mnt/d smbfs defaults auto username = name password = pass 0 0 where the ip address is the ip address of the remote machine and the share name of the shared directory of the share1 machine, /mnt/d: mount the partition to the local linux directory. The user name and password used to access the shared directory. 1005 use lilo/grub to retrieve the forgotten root password 1. when the system enters the single-user status, it is directly changed using passwd root; 2. install the cd boot system, enter the linux rescue status, and mount the original/partition. the command is as follows: cd/mntmkdir hdmount-t auto/dev/hdaX (partition number of the original partition) hdcd hdchroot. /passwd root. 3. take the local hard disk and mount it to other linux systems. the method is the same as that of the second one. for example, rh8 is used to demonstrate the following 1st methods: 1. when lilo is displayed in lilo1, enter linux single (enter single user status). lilo: linux single2 is displayed. press enter to go to linux command line 3 vi/etc/shadow to set the first line, that is, the content of the row starting with "root" is deleted after "root:" and "next" before ". The first row is similar to" root ::...... save 4. restart reboot. the root password is empty. when grub1 appears on the grub screen, use the up and down keys to select the one you usually start linux (do not select dos), and then press the e key; 2 again use the up and down key to select the option that you usually start linux (similar to kernel/boot/vmlinuz-2.4.18-14 ro root = LABEL =/), and then press the e key; 3 modify the command line you see now, add single, the result is as follows: kernel/boot/vmlinuz-2.4.18-14 single ro root = LABEL =/4 press enter to return, then press the B key to start, you can directly go to the linux command line 5 vi/etc/shadow to delete the first line, that is, the content in the line starting with "root", "root", and "next". The first line is similar to "root: :...... save 6 reboot and restart. the root password is null and the 1006cd disc is made into the iso file cp/dev/cdrom/tmp/xxx. iso or Dd if =/dev/cdrom of =/tmp/xxx. view hard disk usage in iso1007. df-k is displayed in unit K. df-h is displayed in humanized units, which can be B, k, m, g, t .. 1008 view the size of the directory du-sh directory name-s only displays the total-h in the unit of K, M, G, to improve information readability. KB, MB, and GB are in the unit of conversion from 1024 to 1000. how to add a hard disk? 1. Shutdown. if the physical connection is an IDE hard disk, pay attention to the settings of the master and slave disks. if it is a SCSI hard disk, select an unused ID number. 2. check whether the hard disk has been detected by linux. | grep hd * (ide hard disk) dmesg | grep sd * (SCSI hard disk) or less/var/log/dmesg. if you have not detected your new hard disk, restart and check the connection to see if the bios recognizes it. 1010 log maintenance tool logrotate at/etc/logrotate. the configuration in conf defines how to uninstall the software installed in tar format to enter the original code directory for installing the software when the log file reaches the predefined size or time. If not, you can also check the Makefile file, which mainly depends on the install part to find out the path to which the tar-format file is copied, then go to the corresponding directory and delete it. 1012 how to use ssh channel Technology 1. ssh-l root IP Address input B's password2. scp root @ IP address: // source file/object destination address input C's passwor
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.