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 ...
随机推荐
- 【C++】 struct结构自动对齐的问题
#pragma pack (push) #pragma pack (1) struct XXXX{}; #pragma pack (pop) 这样写就不会自动对齐了. 在写MFC下的winpcap捕a ...
- pom.xml里有红叉报错的解决办法
pom.xml里有红叉报错的解决办法一: 1.把鼠标点在报的错上发现pom.xml报如下错误: Multiple annotations found at this line: - Failure t ...
- HDOJ Problem - 1299
题意:等式 1 / x + 1 / y = 1 / n (x, y, n ∈ N+ (1) 且 x <= y) ,给出 n,求有多少满足该式子的解.(1 <= n <= 1e9) 题 ...
- JAVA RMI 实例
下面我将介绍一个完整的实例,让初学者能快速体验RMI的功用. 分为以下四个步骤 1. 创建远程接口及声明远程方法(HelloInterface.java)2. 实现远程接口及远程方法(继承Unicas ...
- sessionStorage 、localStorage 与cookie 的异同点
cookie 容量4kb,默认各种浏览器都支持,缺陷就是每次请求,浏览器都会把本机存的cookies发送到服务器,无形中浪费带宽.userdata,只有ie支持,单个容量64kb,每个域名最多可存10 ...
- rem
"em"是相对于其父元素来设置字体大小的,这样就会存在一个问题,进行任何元素设置,都有可能需要知道他父元素的大小,在我们多次使用时,就会带来无法预知的错误风险.而rem是相对于根元 ...
- 缺少wlanapi.dll文件问题修复
我在下载百度云盘的时候碰到了一个问题,缺少wlanapi.dll文件.下面贴出解决办法 第一步 http://d.apktop.cn/p/soft_134.html 下载wlanapi.dll 第 ...
- Gerald's Hexagon
Gerald's Hexagon Gerald got a very curious hexagon for his birthday. The boy found out that all the ...
- 文顶顶iOS开发博客链接整理及部分项目源代码下载
文顶顶iOS开发博客链接整理及部分项目源代码下载 网上的iOS开发的教程很多,但是像cnblogs博主文顶顶的博客这样内容图文并茂,代码齐全,示例经典,原理也有阐述,覆盖面宽广,自成系统的系列教程 ...
- Spring4.1新特性——Spring缓存框架增强(转)
目录 Spring4.1新特性——综述 Spring4.1新特性——Spring核心部分及其他 Spring4.1新特性——Spring缓存框架增强 Spring4.1新特性——异步调用和事件机制的异 ...