1. get start
Command | Example | Description |
ls | ls ls -a ls -l | 输出目录文件 输出文件包括隐藏文件 输出文件详细信息 |
pwd | pwd | show present working dir |
cd | cd dir cd .. cd ./a/b cd ~icey/a cd /home/username/documents | change dir 返回上一个目录 到当前目录下的a/b文件夹中 到某个用户的子文件夹 从根目录开始 |
mkdir | mkdir icey | 创建文件夹 |
rmdir | rm emptydir | 删除一个空的文件夹 |
rm | rm file.txt rm *.tmp -f -i -r -v rm -rf dir |
删除一个文件 删除后缀为..的文件 强制删除 交互式删除 递归删除 详细显示 删除文件夹
|
cp | cp file1 dir cp file1 file1copy | |
mv | mv oldfilename newfilename mv filename dir | 重命名文件 移动文件到文件夹 |
more | more file | 查看文件 |
lpr | lpr file | 打印:send file to printer |
man | man ls | 帮助:online help about cmd |
cls | cls | 清屏 clear screen |
查看日期:date
安装软件 sudo apt-get install softwareName
解压缩 tar -cf abc.tar subdir
tar -xvf subdir.tar
2. viewing files
cat filename Dump a file to the screen in ascii.
more filename Progressively dump a file to the screen: ENTER = one line down SPACEBAR = page down q=quit
less filename Like more, but you can use Page-Up too. Not on all systems.
vi filename Edit a file using the vi editor. All UNIX systems will have vi in some form.
emacs filename Edit a file using the emacs editor. Not all systems will have emacs.
head filename Show the first few lines of a file.
head -n filename Show the first n lines of a file.
tail filename Show the last few lines of a file.
tail -n filename Show the last n lines of a file.
2. log on/log off
注销用户 logoff
exit
重启 shutdown -r /t 000关闭 shutdown -p
字符终端------图形界面 Character terminal -- graphical interface transform
Character terminal ——> graphical interface
enter: startx
or alt+ctl+space ,release "space", and press F7
graphical interface ——> Character terminal
alt+ctl+F1
3. OS performance
(1)进程
ps 查看进程
kill -9 psid 结束进程
ctl+c 结束当前进程
(2)内存(memory)和CPU
free -m 查看内存使用情况
top 查看内存及cpu使用情况
也可以安装htop工具,这样更直观,安装命令如下:sudo apt-get install htop安装完后,直接输入命令:htop就可以看到内存或cpu的使用情况了。
(3)user
who --list who is logged on machine
finger --list who is on compter in the lab