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

时间: 2024-10-12 14:55:39

unix basic command的相关文章

basic command

1,su - db2inst 2,db2 connect to ids 3,db2stop force 4,db2 list db directory 5,db2 list tables for all 6,db2 describe table tablename 7,db2 "restore db JVC from ." 8,select * from (select a.*  , rownumber() over(order by rate desc) as rn   from (

linux shell basic command

Learning basic Linux commands Command Description $ ls This command is used to check the contents ofthe directory. $ pwd This command is used to check the presentworking directory. $ mkdir work We will work in a separate directory calledwork in our h

windows server basic command

运行操作 CMD命令:开始->运行->键入cmd或command(在命令行里可以看到系统版本.文件系统版本) CMD命令锦集 1. gpedit.msc-----组策略 2. sndrec32-------录音机 3. Nslookup-------IP地址侦测器 ,是一个 监测网络中 DNS 服务器是否能正确实现域名解析的命令行工具. 它在 Windows NT/2000/XP 中均可使用 , 但在 Windows 98 中却没有集成这一个工具. 4. explorer-------打开资源

Linux and Unix ln command

About ln ln creates links between files. Description ln creates a link to file TARGET with the name LINKNAME. If LINKNAME is omitted, a link to TARGET is created in the current directory, using the name of TARGET as the LINKNAME. ln creates hard link

unix basic commands

1. man - an interface to the on-line reference manuals $man man 2. apt - advanced package tool SEE ALSO: apt-cache, apt-get, apt.conf, sources.list $apt-cache search mysql 3.sudo - execute a command as another user (sudo allows a permitted user to ex

mysql basic command

mysql的command以分号来分隔 1. 连接数据库 mysql -uroot -p 然后输入密码即可 2. 查看数据库 show databases; 3. 改变数据库 use database_name; 4.查看所有的表格 show tables; 5.查询某一表格的schema信息 describe table_name;

Django basic command

https://docs.djangoproject.com/en/1.8/intro/tutorial01/ 1. get django version python -c "import django; print(django.get_version())" 2. run server python manage.py runserver 3. create a project django-admin startproject [project name] 4. create

linux basic command

1. strace  strace -f -tt -o /tmp/gwenjie_vemkd_strace.log -p 5913 & -f 打印线程 2. sed  cat vemkdperf.log | awk '{print $13, $19, $25}' | sed -s 's/</ /g'| sed -s 's/>/ /g' > vvv.txt

recap basic command(hadoop)

file operations hdfs fs -ls hdfs fs -lsr 包括子目录文件 hdfs fs  -rmr bin/hadoop fs -put path1  path2  上传hdfs 下path1 到本机 path2 bin/hadoop fs -get path1  path2  下载hdfs 下path1 到本机 path2 bin/hadoop dfs -copyFromLocal 源路径 路径 bin/hadoop dfs -getmerge hadoop fs -