本文主要是介绍commands for ubuntu/linux,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
some commands for ubuntu
::输出环境变量/export environment
echo $SHELL
echo $PATH
::修改环境变量/modify environment
echo export PATH="/usr/local/bin:$PATH"
::列出磁盘信息/list disk infomation
df
fdisk -l
::挂载磁盘/mount disk
mount /dev/sdg1 /media/disk_name
::安装软件/install software
apt-get install git
::soft link
ln -s ~/workspace ~/Desktop/
::列出文件的详细信息,包括属性/list all the proporties of a file
ls -l gcc*
:: 查看文件的位置/find the location of a file
locate filename
::查看使用的命令的位置/find the location of a bin file
which bin_name
::多核编译提高编译系效率(make)/make with multiprocessing
make -j4
::check the shared library for a program
ldd program_name
:: where is a exe
whersis exe_name
:: remove path from PATH
PATH=$(echo $PATH | sed -e 's;:\?/home/user/bin;;' -e 's;/home/user/bin:\?;;')
:: show memory size
free -m
::check version of boost
dpkg -s libboost-dev | grep 'Version'
:: 查看CPU的核数和线程数,缓存/show the process num of your CPU
lscpu
:: grep相关,在当前目录,递归查找pattern,并显示行号
grep -N -H -R pattern:: symbolic link
ln -s file1 link1:: list all files (including hidden file) in current directory
ls -a
这篇关于commands for ubuntu/linux的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!