some Linux shell commands

1. date: show current date and time.

2. cal: calendar.

3. df: to see the current amount of free space on your disk drives.

4. free: show the amount of the free memory(if using this command at Cygwin, crocps package should be installed first).

5. exit: to end a terminal session.

6. pwd: print name of current working directory. The working directory is the current directory that we are standing in of the file system.

7. cd: change directory. Symbol "/" stands for the root directory of a file system. And the English name of the symbol is leading slash.

  The directory in which most of your system's programs are installed is /usr/bin.

  The symbol "."(dot) refers to the current working directory and the ".."(two dot) refers to the parent directory of current working directory.

  The symbol "./" which stands for the current directory can be omitted. "./bin" is equal to "bin"

  The symbol "~" refers to your home directory.

  "$ cd" changes to your home directory.

  "$ cd -" changes to the previous directory.

  "$ cd ~user_name" changes to the user_name's home directory.

  BTW: Linux supports space character in a file name. But it's not recommended to do that.(the discussion about that)

8. ls: list directory contents.

  -l option list more info of files.

  There are some more options that can be found on the help page.

  If the prefix of a file is a period, it means that the file is hidden. So it will not be listed. Except appending -a(--all) option to ls.

  -d option list the info of the directory itself instead of its contents.

  --color colorize the file names. You can redefine ls to ls --color in /home/your_name/.bashrc to make the option always setted.(a post about this)

9. file: to determine a file type.

10. less: to display the content of a file. The name "less" is from "less is more". And "more" is a old pager command that does the similar thing as "less".

  To enable the color control characters in the file, add -r option to less.

11. cp: copy files and directories.

12. mv: move or rename files and directories.

13. mkdir: create directories.

  eg: mkdir dir1...

  when the argument of a command is followed by three periods, that means the argument can be repeated. As mkdir dir1 dir2 dir3.

14. rm: remove files and directories.

  -r or -R recursively rm directory and its contents.

  -d or --dir remove empty directory.

  -f or --force never prompt.

  gvfs-trash: to move file to the trash rather than delete it like rm does. Just have tried in Ubuntu.

15. ln: create hard and symbolic links.

 

posted on 2016-03-12 23:45  Robin.Liu 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/LiuRobin/p/5269999.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值