LINUX usage knowledge point

Source: Internet
Author: User
Tags gz file
LINUX usage knowledge-general Linux technology-Linux technology and application information. For more information, see the following section. 1. share files in linux. Install smbserver. In system settings, open the smb server in server settings and enter the relevant path. Then, in the window, use the network neighbor to find linux. (Note: In linux, the work group should be consistent with the window. Select share. Do not use the password option). Finally, restart smb...

2. Run the/etc/init. d/smb restart command to restart the service.

3. Set Internet access in linux. Set the two vmware virtual NICs in the window to automatically obtain the IP address. Then, in the network settings in linux, set the IP address to the same network segment as the window, set DNS to the same as window. The linux IP address is 10.10.70.111.

4. tar? Jxvf is used to extract files with the suffix .tar.bz2. Zxvfis used to remove files with the suffix .tar.gz.

5. 1.zip a group of files with the suffix tar.gz.

# Tar cvf backup.tar/etc

# Gzip-q backup.tar

Or

# Tar cvfz backup.tar.gz/etc/

2.release a file suffixed with tar.gz.

# Gunzip backup.tar.gz

# Tar xvf backup.tar

Or

# Tar xvfz backup.tar.gz

3. Compress With one command

# Tar cvf-/etc/| gzip-qc> backup.tar.gz

4. Run a command to release the instance.

# Gunzip-c backup.tar.gz | tar xvf-

5. How to unbind the tar. Z file?

# Tar xvfz backup.tar. Z

Or

# Uncompress backup.tar. Z

# Tar xvf backup.tar

6. How to unbind the. tgz file?

# Gunzip backup. tgz

7.how to compress and decompress the. bz2 package?

# Bzip2/etc/smb. conf

This will compress the smb.confinto smb.conf.bz2

# Bunzip2/etc/smb.conf.bz2

In this case, smb.conf.bz2 will be restored to smb. conf in the current directory.

Note:. bz2 compression format is not very common, you can use man bzip2

6. chmod? R + 777 filename where-R is recursive and can enter the subdirectory.

7 ,~ /Represents the current user environment.

8. The "$ PATH" command is the current output PATH.

9. We must enable the NFS service for the PC. The specific settings are as follows:

1. Run setup in the LINUX Command Line, select the nfs service in system services, and save and exit.

2. Execute vi/etc/exports and add a line in it:/YF2410/root_dir/root_china (rw), save and exit, /And rw must have spaces (/YF2410/root_dir/root_china is the shared directory, and rw is the read/write permission ).

3. Run/etc/rc. d/init. d/nfs restart to restart the nfs service.

4. In order not to start the nfs service every time we start the system, we set/etc/rc. d/init. d/nfs restart is added to/etc/rc. d/rc. local, the nfs service will be enabled when the PC starts.

5. Test the NFS service: After the configuration is complete, you can test the service on the local machine. If the local IP address is 192.168.1.102, you can use mount 192.168.1.102:/YF2410/root_dir/root_china/mnt, if the mount is successful, you can see the contents under root_china in the/mnt directory.

6. Modify the root_china/usr/etc/rc. local file and set the IP address of the Development Board to 192.168.1.134.

10. Modify the environment variable file. (root)

/Root/. bashrc

Run source/root/. bashrc to make the environment variable take effect.

11. inmod globalvar. o loading module. Rmmod uninstall Module

12. view the current device using cat/proc/devices

13. gcc-D__KERNEL _-DMODULE-DLINUX-I/usr/local/src/linux2.4/include-c-o globalvar. o globalvar. c Device Driver Compilation

14. file sharing between Windows and linux. Share a folder under Windows to ensure that the two networks can be pinged. Then, enter the command mount in linux? T smbfs // 10.10.70.158/tftpd/mnt/bin

Here, tftpd is the shared folder under the window, And bin is a folder under/mnt.

14. NFS settings:

(1) Add a line to the/etc/exports file

/Work/fs * (rw, no_root_squash, sync)

(2) Start NFS

# Service nfs start

# Service portmap start

(3) Enable NFS boot

# Chkconfig nfs on

15. TFTP settings:

(1) Modify/etc/xinetd. d/tftp

Change disable = yes to disable = no

(2) Start TFTP

# Service xinetd start

(3) Enable TFTP during boot

# Chkconfig xinetd on

16. Firewall settings: (preventing connection failure of TFTP)

(1) Stop the Firewall

# Service iptables stop

# Service ip6tables stop

System IP address remarks

Win2003 192.168.10.7

VMWARE FC6 192.168.10.8 using bridging

K9 Development Board 192.168.10.9 K9 board connected through HUB

(2) Disable firewall boot

# Chkconfig iptables off

# Chkconfig ip6tables off

17. Build the kernel driver compilation and compilation environment

Decompress the linux-2.4.29.tar.gz file to/home/at91rm9200th/kernel.

Decompress cross-2.95.3.tar.bz2 to/usr/local/arm.

Add/root/. bash_profile file path to/usr/local/arm/2.95.3/bin.

Run: source/root/. bash_profile to make the environment variable take effect.

If not, set cc =/usr/local/arm/2.95.3/bin.

18. nfs file system.

1. Configure the nfs directory in linux. Add the/home/at91rm9200th/projects/(rw) statement to/etc/exports.

2. Restart the nfs service. Run/etc/rc. d/init. d/nfs restart or service nfs start.

3 command mount 10.10.40.110:/home/at91rm9200th/projects // mnt/nfs

Mount? O nolock 10.10.40.110:/home/at91rm9200th/projects // mnt/nfs



19. Prepare the driver's target file: Corresponding kernel, arm-linux-gcc

20. When setting the uboot command, multiple statements are separated.

Setenv bootcmd run kernel \; run ramdisk \; run boot \

21. How to use tftp on linux (PC)

1. Press enter to enter the tftp Command

2. connect 10.10.40.111 to connect to the host

3. View status

4. get./led. o to get the file

5. Remember that the tftp file comes from the tftpboot directory in linux.

6. quit

22. tftp command on the target board

Tftp 10.10.40.xxx? G? R led. o (here, led. o is the file in the tftpboot directory of the linux host)

23. view the network address in ifconfig. Ifconfig eth0 10.10.40.92 sets the IP address

24. Run the setup command to enter the graphic configuration interface. You can set a firewall.

25. view the netstat network status.

26. lsmode: lists the modules that have been imported into the kernel.

Insmode: inserts a module into the kernel.

Rmmod: detaches a module from the kernel.

We recommend that you use modprobe to manually load modules.

27. Check the Linux kernel version uname-r.

28. Check the gcc version? V

29. Enter bash to enter bash shell, and enter csh to enter c shell. For example, at the c shell prompt:

"[Root @ localhost/] #" input sh, that is, enter the Bourne shell, "sh-2.05b #". there is also a ksh and perl shell (a shell program commonly used by programmers to create a Common Gateway Interface (CGI) for web applications.

30, lowercase "I", from command mode to insert mode.

31. Use echo to display the content on the screen. Add ">" or ">" to redirect to the file.

For example, echo "your name is $ name"> yyb. dat, the information is stored in yyb. dat ., the difference is> Add after the file, and> overwrite the original file.

32. You can use the "ps" command to bring up the process status list.

33. Makefile has three very useful variables: $ @, $ ^, $ <代表的意义分别是:

$ @ -- Target file, $ ^ -- all dependent files, $ <-- the first dependent file.

34. ldd lib. so displays other library files that the library depends on.

35. On the linux text interface, use samba. First, use ifconfig eth0 192.168.0.11 to set the IP address. (Verify OK)

36. To identify the link libraries that your application needs to connect to, you can use the lddl command in the system to list the dynamic link libraries that your application depends on. For example, to view the shared library on which the file replication command cp depends, run the following command:

# Ldd/bin/cp

Libtacl. so.1 =>/lib/libacl. so.1 (0x00701000)

Below

"=>" Indicates the Symbolic Link name of the shared library required by the Program on the left and the actual location on the right.

By default, the configuration file/etc/ld. so. conf of the dynamic link library contains the default shared library search path.

37. view the mounted modules in lsmod. (Read the/proc/modules file to obtain the required information ).

There are two ways to dynamically load the kernel module:

1. Use the modprobe command to load. For example: # modprobe vfat # mount the vfat module.

2. Use the insmod command to load. (To add a kernel module using this method, you must have an absolute path and a suffix of the complete file name .)

38. The file is a linux Device File under/dev. There are two ways to add a device file:

1. Use the mknod command to add devices.

# Cd/dev

# Mkmod? M 666 null c 1 3

After the basic device files are added, the required symbolic links must be included in the/dev directory of the root file system. You can use "ln? Run the "s Link name Link Target" command to create these links, for example:

# Ln? S/proc/self/fd

# Ln? S fd/0 stdin

3. Use MAKEDEV (symbolic link/sbin/MAKEDEV) in the/dev directory to create a device file.

For example, to add a tyy0 device to the root file system, enter the following command.

# Cd/dev

#./MAKEDEV ttys0

39./etc/rcn. all files in d are symbolic links to/etc/rc. d/init. all script files in d are symbolic links starting with 'K' and 'S. Starting with 'S' indicates start. The script is called with the start parameter. Starting with 'K' indicates stop. By manually starting or stopping the service, you can:/etc/rc. d/init. d/ntpd start to start the ntpd service.

40. There are roughly three ways to Configure Automatic startup of an application.

1. Add a STARTUP script under/etc/init. d/to create/etc/rc. d /... /Directory.

2. directly add commands in the/etc/rc. d/rc. local script.

For example:/etc/rc. d/init. d/nfs restart

Another example is/usr/local/apache/apachectl start.

3. Start directly through the/linuxrc script, usually by specifying init =/program in the kernel Command Line Parameter
Related Article

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.