Linux练习记录

来源:互联网 发布:淘宝改价违规清除销量 编辑:程序博客网 时间:2024/09/21 08:16
Linux练习记录(1)
一、Some Basic LinuxCommands:
1、passwd:Change yourpassword
2、date, cal: Find outtoday's date and displays a calendar  cal [Month] [Year]
3、who, finger: Find outwho else is active on the system  /// finger[user][@host]
Linux练习记录

4、clear: Clear the screen 清楚终端当前范围内的东西
5、echo: Write a messageto your own screen
  echo xxxxxxxxx 在下一行输出xxxxxxxx
6、write: Write a messageto other screens
write user(登陆的用户名) 比如:再打开一个terminal 输入write root开始写信息会在另一个terminal下接收显示 结束时用ctrl+d。
7、wall: Write a messageto all screens
输入wall命令后 开始写入信息 使用ctrl+d 发送所有打开的终端都能收到此信息
8、talk: Talk to otherusers on the system
9、mesg: Switch on/offreception of write, wall, and talk
messages
二、Linux Filenames
• Should be descriptive of thecontent
• Should use only alphanumericcharacters:
UPPERCASE, lowercase, number, @,_
• Should not include embeddedblanks
• Should not contain shellmetacharacters:
* ? >< / ; & ! | \ ` ' " [ ] ( ) {}
• Should not begin with + or -sign
• Are casesensitive
• Are hidden if the firstcharacter is a . (period)
• Can have a maximum of 255characters
三、常用命令
1、cddir_name 进入目录dir_name:cd / (到根目录) cd ~(到桌面)
   cd .. (Goone directory up) 
   cd - (Goto previous先前的 directory)
2、mkdirdir_name
$ mkdir/home/tux1/doc (full pathname)
$ cd /home/tux1
$ mkdir doc (relative pathname)
3、rmdirdir_name
创建/删除多重目录:
$ mkdir-p dir1/dir2/dir3 从dir1到dir3建立
$ rmdir -p dir1/dir2/dir3 从dir3到dir1删除
4、ls [ dir/file  ls/home
Important options:
-l long listing (more information)
-a lists all files (including hidden)
-t lists files sorted by change date
-R lists contents recursively
5、touch 
The touch commandcreates an empty file, or updates the
modification time of an existing file
touch可以新建一个空文件,可以修改文件的创建时间。
6、cp 复制指令 cp source[s] [target]
   Copying one file to another:
$ cp .bashrc bashrc.old
Copying multiple files into a target directory:
$ cp doc/mon_report doc/walrus /tmp
7、mv source[s] [target]
To move a file do another directory:
$ mv doc/walrus ../../tmp
To rename a file:
$ mv doc documents
Use the -i option to prevent mv from
overwriting existing files!
8、rm 移除 
9、cat  file1 查看,  
比较 more or less 
The more and less commands reads the file names specified and displays the contents of
the files one page at a time.
10、od,strings
od (octal dump) allows you to view the contents of a binary file byte by byte. Without any
option, od shows the contents of the file in octal format, but you can also specify the -c
option for decimal display, or the -h option for hexadecimal display. Other output options
also exist.
strings is also a very handy tool to take a peek at binary files. It displays only all the strings
that occur in a binary file. (A string is a combination of at least four consecutive, contiguous,
printable ASCII characters.)
11、cat  /etc/fstab  自行查看
/etc/fstab lists all known filesystems on the system.
 
原创粉丝点击