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 ...
随机推荐
- testlink部署与迁移
几个特殊的文件: 1.D:\xampp\htdocs\testlink\config.inc 安装配置文件,此处需要修改安装目录(g_repositoryPath.log_path) 2.D:\xa ...
- iOS —— 字典遍历排序
字典NSDictionary一般的遍历方法都是: NSArray* arr = [yourdictonary allKeys]; for(NSString* str in arr) { NSLog(& ...
- ActiveReports中自定义Winforms的Viewer 工具栏
ActiveReports中提供不同平台的报表浏览器来加载报表,而不同平台的报表浏览器功能也不一致,今天我们来学习如何定制Winforms Viewer控件. 预览效果: 核心代码: C# // C# ...
- PHP Fatal error: Class 'DOMDocument' not found
PHP Fatal error: Class 'DOMDocument' not found 给PHP添加 xml模块: yum install php-xml 如果是PHP5,则用 yum in ...
- 使用requestAnimationFrame做动画效果一
最近学习了requestAnimationFrame,看了张鑫旭直白易懂,但是某些地方语言过于裸露的文章http://www.zhangxinxu.com/wordpress/2013/09/css3 ...
- H5 学习笔记(一、关于position定位)
主要是relative与absolute的用法: 1.relative 依据left right top bottom 等属性在正常文档流中脱离位置,即相对于他的正常文档流位置进行移动.两个都为rel ...
- APACHE 在windows下的配置
目前apache在windows下只支持到2.2 所以php必须下载相应的线程安全的 然后打开apache的配置页面 listen directory 和 load_module修改 httpd -k ...
- cookie详解
一.cookie详解 (1)设置cookie 每个cookie都是一个名/值对,可以把下面这样一个字符串赋值给document.cookie: document.cookie="userId ...
- 遇到bug怎么办
最近第一个完整的项目的第一期快完成了.期间,我怀疑过无数次人生,给难兄难弟辣椒相互吐槽过.被我师父点播后觉得人和人差距怎么可以这么大数次. 终于!基本功能实现了. 今天不总结具体问题了,说一下调试过程 ...
- b/s 猫大叔
好复杂,要把客户端文件传到服务端,再从服务端传到FTP......肿么设计的这是.... 至少你都要把客户端的文件读到服务端的内存中,因为B/S控制器在S端,不在B端 非要用B/S实 ...