Some skills of Linux

xiaoxiao2021-03-06  75

1. File operation Tips Delete file RM ./-a rm - -a tells RM This is the last option, see getopt ls -i listing inum, then use Find. -Inum Inum_OF_THISFILE -EXEC RM '{}' /;

Delete file RM // a named / A

Deleting a name / and '/ 0' files These characters are characters that are not allowed by the normal file system, but may be generated in the file name, such as the NFS file system under UNIX uses 1. Solution on the Mac system, The NFS file system deletes files with a special file name under the system where the '/' character is hung. 2. Also, remove the other file of the error file name, LS -ID displays the inum, umount file system, CLRI containing the file directory, clear the directory of Inum, Fsck, Mount, Check Your Lost Found, Rename THE File in it. It is best to remove any file names with the Windows FTP!

Deleting a file with an invisible character listing the file name and dumps to the file: ls -l> AAA then edit the contents of the file to join the RM command to make its content into the format of the above file: VI AAA [RM -R *** ****] Plus the file plus the execution permission CHMOD X AAA to perform $ AAA

Delete file size is zero file RM -I `Find ./ -Size 0` Find ./ -Size 0 -EXEC RM {} /; find ./-size │XARGS RM -F & Very Valid for File in * # 自己 自己Define file type do if [! -S $ {file}] the RM $ {file} echo "RM $ FILE SUCCESS!" Fi DONE

Delete Directory All files include subdirectory RM -RF directory name

Find the file Find. -Type f / (-Perm -04000-perm -02000 /) -Exec ls -lg {} /;

Remove extra carriage return SED 'S / ^ m //' test.sh> back.sh, pay attention to ^ m is getting ctrl_v ctrl-m or Dos2Unix FileName

2. View the use of the hard disk DF -K display DF -H in K, M, G, T ..

3. View the size of the directory du -sh dirname -s only shows the total-h in K, M, G, and improve the readability of the information. KB, MB, GB is converted at 1024, and -H is converted to 1000

4.Mount Usage Fat32 Partition Mount -O CodePage = 936, IOCHARSET = CP936 / DEV / HDA7 / MNT / CDROM ISO File Mount -o Loop /Abc.iso / MNT / CDROM Flood Discharge Mount / DEV / FD0 / MNT / FLOPPY USB Flash Mount / DEV / SDA1 / MNT / CDROM All / etc / fstability Mount -a can specify the file format "-t format", the format can be VFAT, EXT2, EXT3, etc.

5. Make Ctrl Alt Del Failure VI / etc / inittab Totors Ca :: Ctrlattdel: / sbin / shutdown -t3 -r Now, you can

6. Set the COM1 mouth, let the super terminal login via the COM1 mouth confirmed that there is / sbin / agharge, editing / etc / inittab, add 7: 2345: Respawn: / sbin / agentty / dev / ttys0 9600 9600bps is because the liner default It is generally this rate, or it can be set to 19200, 38400, 57600, 115200 Modify / etc / securetty, add a line: TTYS0, make sure the root user can log in to restart the machine, you can unplug the mouse keyboard display (it is best to start To see the output information) 7. Modify the default landable initVi / etc / initTab modification ID: N: INitDefault line to change n to INIT you want, you can

8. Optimize the system vi / etc / inittab annotation by reducing TTY 1: 2345: Respawn: / sbin / mingetty TTY1, don't comment out

转载请注明原文地址:https://www.9cbs.com/read-93465.html

New Post(0)