FreeBSD FAQ set

Source: Internet
Author: User

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.