unix basic command
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
unix basic command的更多相关文章
- Linux/UNIX 下 “command not found” 原因分析及解决
在使用 Linux/UNIX 时,会经常遇到 "command not found" 的错误,就如提示的信息,Linux /UNIX 没有找到该命令.原因无外乎你命令拼写错误或 L ...
- linux shell basic command
Learning basic Linux commands Command Description $ ls This command is used to check the contents of ...
- Basic command and advice for memcached
Storage Commands set Most common command. Store this data, possibly overwriting any existing data. N ...
- Raspberry Pi 3 Basic Command and Information
default username : pi default password : raspberry enter system setting interface : sudo raspi-confi ...
- pvresize - Unix, Linux Command
NAME pvresize - resize a disk or partition in use by LVM2 SYNOPSIS pvresize [-d|--debug] [-h|--help] ...
- Unix/Linux Command Reference
- UNIX command Questions Answers asked in Interview
UNIX or Linux operating system has become default Server operating system and for whichever programm ...
- Linux--Introduction and Basic commands(Part one)
Welcome to Linux world! Introduction and Basic commands--Part one J.C 2018.3.11 Chapter 1 What Is Li ...
- 50个最常用的UNIX/Linux命令
转自http://get.jobdeer.com/493.get 1. tar command examples Create a new tar archive. $ tar cvf archive ...
随机推荐
- 封装properties从配置文件读取测试用例输入数据
当每个测试用例都有输入数据,而且数据量比较大的情况,可以采取从文件读取 如果想让同一套测试用例能够适应相似的输入数据,如果直接代码里面来回切换回可能会漏,而且还需要debug检错 可以把一些公用的输入 ...
- HTML 表格<table><caption><th><tr><td><thead><tbody><tfoot><col><colgroup>
<table>标签: 定义和用法: <table>标签定义HTML表格. 简单的HTML表格由table元素以及一个或多个tr.th或td元素组成. tr元素定义表格行,th元 ...
- marquee标签实现页面内容的滚动效果
页面的自动滚动效果,可由javascript来实现, 但是有一个html标签 - <marquee></marquee>可以实现多种滚动效果,无需js控制. 使用marquee ...
- nano编辑器使用教程
使用Linux VPS会经常和编辑器打交道,一般常用的是vi和nano,虽然vi功能强大,但是相对新手来要稍微难上手,GNU nano是一个体积小巧而功能强大的文本编辑器.这里就简单说一下nano的使 ...
- 将 Tor socks 转换成 http 代理
你可以通过不同的 Tor 工具来使用 Tor 服务,如 Tor 浏览器.Foxyproxy 和其它东西,像 wget 和 aria2 这样的下载管理器不能直接使用 Tor socks 开始匿名下载,因 ...
- Jquery开灯关灯效果
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- spider_getModelInformation
import urllibimport urllib2import re class Spider:def getPage(self,pageIndex): url="http://mm.t ...
- ZOJ 3817Chinese Knot(The 2014 ACM-ICPC Asia Mudanjiang Regional First Round)
思路: 将4个串每个串都反向这样得到新的四个串一共8个串,对于母串每个位置检测这个串能不能放进去,hs或者后缀数组都可以.然后dp[i][j] (0<i<len 0<=j< ...
- code of C/C++(3) - 从 《Accelerated C++》源码学习句柄类
0 C++中多态的概念 多态是指通过基类的指针或者引用,利用虚函数机制,在运行时确定对象的类型,并且确定程序的编程策略,这是OOP思想的核心之一.多态使得一个对象具有多个对象的属性.class Co ...
- js动态添加行
<script> $(function() { //增加上传 var addli = function() { var linum = parseInt($(".pic-wrap ...