Common commands in Linux development

zhaozj2021-02-16  98

Date commonly used commands in Linux development: 2004/08/03 Author: Tomsoftware Source: Linux bully One

Basic operational order ----------------------------------------------- ----------------------------------------------------------------- ----------------------------------------- LS # Displays the current manner Directory file list LS -A # Display all files include hidden files LS -L # Display file properties, including size, date, symbolic connection, whether to read and write and perform ls --color = never * .so> Obj # Display text color, record all SO files into the Obj file ----------------------------------- --------------------------------- CD DIR # Switch to the DIR directory CD / # switch to the current directory Directory CD .. # Switch to the previous directory cd ../ .. # Switch to the upper secondary directory CD ~ # switch to the user directory, such as the root user, switch to / root -------- -------------------------------------------------- -------------- RM File # Delete a file RM -FR Dir # Delete the current directory to call DIR's entire directory ------------- -------------------------------------------------- ----- CP Source Target # Copy the file Source to targetcp / root / source. # Copy the file Source under / root to the current directory cp -av Soure_dir target_dir # Copy the entire directory, two directories are exactly CP -FR Source_dir target_dir # Copy the entire directory and copy in a non-link mode, when the Source directory comes with a symbolic link, the two directories are different ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------- MV Source Target # Renamed the file Source to Target -------------------------------------------------------------------------------------------------------------------------------- -------------------- ---------- DIFF DIR1 DIR2 # Compare Directory 1 is the same as the list of files of the directory 2, but does not compare the actual content of the file, the different file1 file2 # compare file 1 and file 2 content If it is the same, if it is a file in the text format, the content will be displayed. If it is a binary code, only two files are different comm file1 file2 # compare files, display two files different content ---- -------------------------------------------------- ---------------- Echo message # Show a string of characters Echo "Message Message2" # Display discontinuous string Cat: cat file # Display the content of the file, and the same TYPE in DOS Cat file | more # Display the contents of the file and transfer to the more program implementation paging display, use the command Less file to implement the same function more # paging command, generally pass the content to it, such as LS | More ----- -------------------------------------------------- --------------- export lc_all = zh_cn.gb2312 # Set the value of the environment variable lc_all to zh_cn.gb2312export display = 0: 0 # passed this setting,

The current character terminal runs the graphics program to run directly on xserverdate # Show current date time DATE -S 20:30:30 # Set system time 20: 30: 30Date -s 2002-3-5 # Set system period 2003- 3-5Clock -R # Read the time parameter clock -w # to the system BIOS Write the system time (such as the time of DATE setting) to BIOS ------------------------------------------------------------------------------------------------------------------------------------ -------------------------------------------------- - Eject #umout off CDROM and pops up the disc, but CDROM cannot be in the state of Busy, otherwise it is invalid ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------ DU # Calculate the capacity DU of the current directory -SM / root # Calculate the capacity of the / root directory and Find -Name / path file # in / PATH Directory in / Path Directory Look for FileGrep -ir "Chars" # All files in the current directory lookup string Chars And ignore the case, -i is case, -r is the next level directory --------------------------------------------------------------------------------------------------------- --------------------------------------- vi file # Editing File Filevi Original Basic Usage and Command : When entering the command, press CTRL C before entering: x (exit) ,: x! (Exit and saved): w (write file),: w! (Do not ask a way to write file),: r File (read file file),:% s / oldchars / newchars / g (replace all strings OldChars with newchars) This category is operated ----------------- -------------------------------------------------- --- Man LS # reads the help of the ls command Man Ls | GREP color # reads the help of the ls command and find the color string through the GREP program ---------------- -------------------------------------------------- ------ StartX # Running Linux graphic with environment xfree86 # only Run x graphics serve R --------------------------------------------------- --------------------- Reboot # Restart your computer HALT # Close Computer init 0 # Close all applications and services, enter the pure operating environment init 1 # Restart Application and Services Init 6 # Restart Computer ------------------------------------------------------------------------------------------------------------------- ----------------------------- Expanded command ------------------- -------------------------------------------------- - - ------------------------------------- --------------------- TAR XFZV file.tgz # 将 文件 file file.tgz -c target_path # extract file file.tgz to target_path Tar CFZV file.tgz source_path # compresses files Source_path to file.tgztar C Directory>

Directory.TAR # Package the directory Directory Directory.targzip Directory.tar # will override the original file to generate compressed Directory.tar.gzgunzip Directory.tar.gz # override the original file to decompress the generation of non-compressed Directory.tar.

TAR Xf Directory.Tar # can uncomparable file unpacking ---------------------------------- -------------------------------- DMESG # Display KERNLE boot and drive loading information Uname # Displays the type of operating system Uname -r # Display the Version of the operating system kernel -------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------- -------- RPM -IHV Program.rpm # Installer Program and Displays the installation process RPM2TARGZ program.rpm program.tgz # converts files in the RPM format into Tarball format --------- -------------------------------------------------- ----------- Su root # Switch to Super User Sulogin / DEV / TTY4 # On TTY4, Alt F4 Terminal Wait for the user to log in or log in to open a shellchMod a x file # Set the file file to Executable, script file must set one this, otherwise you can use Bash File to execute CHMOD 666 file # Set file file to read and write Chown User / Dir # Set the / DIR directory to User ------ -------------------------------------------------- -------------- MKNOD / DEV / HDA1 B 3 1 # Create block device HDA1, the main device number is 3, from the device number 1, the first partition MkNod in the master hard disk / dev / tty1 c 4 1 # Create a character device TTY1, the main device number is 4, the public device number is 1, that is, the first TTY terminal ------------------- -------------------------------------------------- - Touch / TMP / Running # Create a temporary file R under / TMP Unning, disappear after restart ---------------------------------------------------------------------------------------------------------------------------------------------- -------------------------- Sleep 9 # system hangs for 9 seconds ------------- -------------------------------------------------- ------- LPD STOP or CUPS STOP # Stop Print Sergers LPD Start or CUPS Start # Start Print Sergers LPD Restart or Cups Restart # Restart Print Server Lpr File.txt # Print File File.txt-- -------------------------------------------------- ------------------ FDISK / DEV / HDA # is like performing DOS's FDISK, CFDisk / dev / hda # is slightly friendly mount -t2 / dev smaller than fdisk interface / hda1 / mnt # put / dev / hda1 loading / mnt directory DF # Display file system load related information Mount -t ISO9660 / dev / cdrom / mnt / cdrom # Loading CD-ROM to / MNT / CDROM directory Mount-T SMB //192.168.1.5/sharedir / mnt -o username = tomlinux, password = Tomlinux # loads Windows shared directory to / mnt / smb directory,

Username and password are Tomlinuxmount -t NFS 192.168.1.1:/sharedir / mnt # Load the shared directory Shared of the NFS service to / mnt / nfs directory Umount / MNT # uninstall / mnt directory, and / mnt directory must be idle Umount / DEV / HDA1 # Uninstall / dev / hda1 devices, the device must be in the air-pro-state Sync # synchronize the contents in cache, copy files in Linux, generally need to system free to write file E2FSCK / DEV / HDA1 # Check / def / hda1 has file system error, prompt repair mode E2FSck -p / dev / hda1 # check / dev / hda1 has an error, if there is an automatic repair E2FSCK -Y / DEV / HDA1 # check error, all questions Both YES-way execution E2FSck -c / dev / hda1 # check if there is a bad area MKFS / DEV / HDA1 # formatted / dev / hda1 is EXT2 format mkfs.minix / dev / hda1 # format / dev / hda1 for minix Format file system MFKS / DEV / HDA9 # 工 /化 / dev / hda9 is Linux SWAP format swapon / dev / hda9 # Take SWAP partition as a memory to uninstall SWAP partition ----- -------------------------------------------------- --------------- LILO # Runlo program, the program automatically looks for /etc/lilo.conf and press this configuration lilo -c /root/lilo.conf #LILO program Press / root /LILO.CONF Configuration Effective GRUB # Run Boot Loader Setup in Linux Shell Grub-Install # Install the GRUB Disk Booter, successfully upgrade the kernel without restarting the system like Lilo, just modify /etc/grub.conf To achieve a new boot configuration RDEV BZIMAGE # Display Kernel's root partition information RDEV BZIMAGE / DEV / HDA1 # Set the root partition of Kernel to / dev / hda1, which is very important in the system without LILO, etc. - -------------------------------------------------- ---------------- --- DD if = / dev / fd0 of = floppy.fd # Copy the contents of the floppy disk into a mirror, functionality commonly used in the old stone age, the same DD if = / dev / zero of = root.ram BS = 1024, count = 1024 # Generate a block device of 1m, you can use mkfs root.ram # to use mkfs root.ram # to use mkfs root.ram # = root.ram of = / dev / Ram0 # Import Init.RD format Root.ram content Import memory mount / dev / ram0 / mnt #ramdisk / dev / ram0 loaded to / mnt directory ----------------- -------------------------------------------------- --- gcc hello.c # Compile hello.c into a.out binary execution file GCC hello.c -o hello # 将 h h 二 进 进 进 进 进 进 进 进 进 进 进 进 进 进 进 进 进 进 进# 将 h hc h 进 执行 执行 执行 l l h 显示 o 显示 o 显示 信息 使用 信息 表 信息 表 信息 表 信息 表 信息 表 信息 表 信息 表 信息 表 表 表 表 表 表 表 表 表 表 表

Can be much a lot --------------------------------------------- ----------------------- Strace Netscape # Tracking Program Netscape execution, watch the library, environment variable settings, configuration files, useful devices, call Other applications, etc., under Strace, how to do it in the east. PS # Displays the current system process information PS-EF # Display System All Process Information Kill -9 500 # Dry the process No. 500 Dry off Killall -9 Netscape # kill all the names of Netscape, Kill is not universal, The deadline is invalid. Top # Display the activity of the system process, pressing the CPU resource percentage free # display system memory and SWAP usage Time Program After the Program program is completed, the time used by the Program Run is calculated ------- -------------------------------------------------- ------------- Chroot. # Switch the root directory to the current directory, use Chroot / Tomlinux to use Chroot / Tomlinux while debugging the new system to / tomlinux directory Chroot / Tomlinux Sbin / init # Directory Switch to / Tomlinux and Execute Sbin / Initadduser ID # Add Id User USERDEL ID # 增除 i i i 用户 用户er uer u u 用户 用户 p PASSWD ID # Modify the user ID Password Passwd -d root # 将 ROOT User's password delete chown id / work # specified / work directory is Id user owned ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------101.1.1 Netmask 255.255.255.0 # Setup NIC 1 Address 192.168.1.1, the mask is 255.255.255.0, the NetMask parameter is defamely the default 255.255.255.0ifconfig eth0: 1 192.168.1.2 # Bundle NIC 1 The second address is 192.168.1.2ifconfig et0: x 192.168. 1.X # Bundle NIC 1 The second address is 192.168.1.xifconfig Down Eth1 # Close the second block, so that it stops working Hostname -f Tomlinux.com # Set the host name to Tomlinux.Comroute # Show current routing Settings Route Add Default GW 192.168.1.1 Metric 1 # Setting 192.168.1.1 To the default routing Route del Default # Start the default route DHCP # Start DHCP service DHClient # Start DHCP terminal and automatically get the IP address ping 163.com # Test Connection with 163.com ping 202.96.128.68 # Test and IP 202.

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

New Post(0)