FreeBSD FAQ set

Source: Internet
Author: User
1. for how to use the script to obtain the PID, see the script pid. sh, as shown below: $ catpid. sh #! /Bin/shpid 'PS-aux | grep $1 | grep-vgrep | awk & amp; #39; {print $2} & amp; #39; 'echo $ pid & lt; $ 1.pid$. /pid. shsshd2. capital the file name... 1. how to obtain the PID using the script
See the script pid. sh as follows:
 
$ Cat pid. sh
#! /Bin/sh
Pid = 'PS-aux | grep $1 | grep-v grep | awk '{print $2 }''
Echo $ pid <$ 1.pid
$./Pid. sh sshd
 
 
2. convert the file name from uppercase to lowercase.
 
See the mklower. sh script as follows:
 
#! /Bin/sh
For file in $1;
Do
Newfile = 'echo "$ file" | tr "[: upper:]" "[: lower:]"'
Mv "$ file" "$ newfile"
Done
$ Mklower. sh *. JPG
 
 
3. sort subdirectories by size
 
$ Du-s * | sort-n
 
4. ls display color
 
$ Ls-G # Display attribute color $ ls-F # Display attribute characters $ ls-FG
 
5. quick package installation
 
You can first set PACKAGEROOT to specify the package of the site, and automatically find the corresponding pakage during installation, and you do not need to know the version, as long as you know the package name, the latest package version will be automatically installed, add zh-to the Chinese text, such as zh-xcin.
 
# Setenv PACKAGEROOT ftp://ftp.tw.freebsd.org
# Pkg_add-r package_name
 
 
You can also directly specify the PACKAGESITE to point to a specific location. for example, the package you want to install is the latest, rather than the release version.
 
# Setenv PACKAGESITE ftp://ftp.tw.freebsd.org/pub/Fre... ages-stable/Latest/
 
 
6. use an ISO image
 
FreeBSD 4.X
 
# Vnconfig/dev/vn0c./IMAGE. ISO
# Mount-t cd9660/dev/vn0c MOUNT_DIR
# Umount MOUNT_DIR
# Vnconfig-u/dev/vn0c
 
 
FreeBSD 5.X
 
# Mdconfig-a-t vnode-f abc. iso-u 1
# Mount-t cd9660/dev/md1 MOUNT_DIR
# Umount MOUNT_DIR
 
 
7. tcsh and csh skills
 
 
In tcsh, you can use set autolist to set automatic file name and path filling.
 
In csh, you can set limit coredumpsize 0 to set the coredump size.
 
Set command line prompt
 
Set prompt = '% n @ % m % #'
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.