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

猜你喜欢

转载自blog.csdn.net/smallflyingpig/article/details/79224792