Unix and perl primer for Biologists - Part1 : Unix - Learning the Essentials - Reading Notes(U1-U12)

Introduction to Unix
Unix contains many hundred of commands but you will probably use just 10 or so to achieve most of what you want to do.

U1. The Terminal
A ‘terminal’ is the common name for the program that does two main things. It allows you to type input to the computer (i.e. run programs, move/view files etc.) and it allows you to see output from those programs.
Task U1.1
There will be many situations where it will be useful to have multiple terminals open and it will be a matter of preference as to whether you want to have multiple windows, or one window with multiple tabs (there are keyboard
shortcuts for switching between windows, or moving between tabs).
U2. Your first Unix command
Unix keeps files arranged in a hierarchical structure.It’s important to note that you will always be “in” a directory when using the terminal. The default behavior is that when you open a new terminal you start in your own ’home” directory (containing files and directories that only you can modify).

ls command
terminal_ls
Four things noted :
1.different outputs depending on your computer
2. Unix command prompt: root@kali:~#
3. directories or files
4. it produces a new command prompt
The ls command is used to list the contents of any directory, not necessarily the one that you are currently in.
ls /boot

U3 : The Unix tree
A tree analogy is often used when describing computer filesystems.When you log in to a computer you are working with your files in your home directory, and this will nearly always be inside a ‘Users’ directory. On many computers there will be multiple users.
U4: Finding out where you are
pwd will Print the Working Directory and that’s pretty much all this command does:
print work directory
The first forward slash that appears in a list of directory names always refers to the top level directory of the file system (known as the root directory). The remaining forward slash (between ‘users’ and ‘clmuser’) delimits the various parts of the directory hierarchy.

U5: Getting from ‘A’ to ‘B’
To change directories, we use the cd command:
to change directory

U6: Root is the root of all evil
When you specify a directory that starts with a forward slash, you are referring to a directory that should exist one level below the root level of the computer.

U7: Up, up, and away
Two dots .. are used in Unix to refer to the parent directory of wherever you are. Use two sets of the .. operator, separated by a forward slash,to navigate up two levels in the file system in one go:
parent_directory

U8: I’m absolutely sure that this is all relative
change to a directory based on its absolute location. Sometimes it is quicker to change directories using the relative path, and other times it will be quicker to use the absolute path.
relative and absolute directory

U9: Time to go home
Unix uses the tilde character as a short-hand way of specifying a home directory.
home_and_root_directory

U10: Making the ls command more useful
Command-line options in Unix are specified by using a dash (‘-’) after the command name followed by various letters, numbers, or words.

ls_longer_output

Task U10.1
ls -R “Recursion”, 递归列出目录文件
ls_l_t_r
ls_lh

U11: Man your battle stations!
Unix command has an associated ‘manual’ that you can access by using the man command.

man ls
man cd
man man

When you are using the man command, press space to scroll down a page, b to go back a page, or q to quit. You can also use the up and down arrows to scroll a line at a time.

U12: Make directories, not war
make a directory
make_new_directory_mono_poly

Task U12.1
Practice creating some directories and navigating between them using the cd command. Try changing directories using both the absolute as well as the relative path (see section U8).
make_directories_and_change_directories_absolute_and_relative

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值