Danh mục

SUSE Linux 10 for dummies phần 3

Số trang: 19      Loại file: pdf      Dung lượng: 783.43 KB      Lượt xem: 10      Lượt tải: 0    
tailieu_vip

Hỗ trợ phí lưu trữ khi tải xuống: 11,000 VND Tải xuống file đầy đủ (19 trang) 0

Báo xấu

Xem trước 2 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Tham khảo tài liệu suse linux 10 for dummies phần 3, công nghệ thông tin, hệ điều hành phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả
Nội dung trích xuất từ tài liệu:
SUSE Linux 10 for dummies phần 348 Part I: Getting to Know SUSE the one shown in Figure 3-7. That’s a terminal window, and it works just like an old-fashioned terminal. A shell program is running and ready to accept any text that you type. You type text, press Enter, and something happens (depending on what you typed). In GNOME, choose Applications➪System➪Terminal➪Gnome Terminal. That should then open up a terminal window. Figure 3-7: You can type Linux commands at the shell prompt in a terminal window. The prompt that you see depends on the shell that runs in that terminal window. The default Linux shell is called bash. Bash understands a whole host of standard Linux commands, which you can use to look at files, go from one directory to another, see what programs are running (and who else is logged in), and a whole lot more. In addition to the Linux commands, bash can run any program stored in an executable file. Bash can also execute shell scripts — text files that contain Linux commands. Understanding shell commands Because a shell interprets what you type, knowing how the shell figures out the text that you enter is important. All shell commands have this general format: command option1 option2 ... optionN Such a single line of commands is commonly called a command line. On a com- mand line, you enter a command followed by one or more optional parameters 49 Chapter 3: Starting SUSE for the First Time(or arguments). Such command line options (or command line arguments)help you specify what you want the command to do.One basic rule is that you have to use a space or a tab to separate the com-mand from the options. You also must separate options with a space or a tab.If you want to use an option that contains embedded spaces, you have to putthat option inside quotation marks. For example, to search for two words oftext in the password file, I enter the following grep command (grep is one ofthose cryptic commands used to search for text in files): grep “SSH daemon” /etc/passwdWhen grep prints the line with those words, it looks like this: sshd:x:71:65:SSH daemon:/var/lib/sshd:/bin/falseIf you created a user account in your name, go ahead and type the grep com-mand with your name as an argument, but remember to enclose the name inquotes. For example, here is how I search for my name in the /etc/passwdfile: grep “Naba Barkakati” /etc/passwdTrying a few Linux commandsWhile you have the terminal window open, try a few Linux commands just forfun. I guide you through some random examples to give you a feel for whatyou can do at the shell prompt.To see how long the Linux PC has been up since you last powered it up, typethe following (Note: I show the typed command in bold, followed by theoutput from that command.): uptime 3:52am up 29 days 55:53, 5 users, load average: 0.04, 0.32, 0.38The part up 29 days, 55:53 tells you that this particular PC has been upfor nearly a month. Hmmm . . . can Windows do that?To see what version of Linux kernel your system is running, use the unamecommand like this: uname -srv50 Part I: Getting to Know SUSE This runs the uname command with three options -s, -r, and -v (these can be combined as -srv, as this example shows). The -s option causes uname to print the name of the kernel, -r prints the kernel release number, and -v prints the kernel version number. The command generates the following output on one of my Linux systems: Linux 2.6.13-8-default #1 Tue Sep 6 12:59:22 UTC 2005 In this case, the system is running Linux kernel version 2.6.13. To read a file, use the more command. Here’s an example that displays the contents of the /etc/passwd file: more /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/bin/bash daemon:x:2:2:Daemon:/sbin:/bin/bash lp:x:4:7:Printing daemon:/var/spool/lpd:/bin/bash ... lines deleted ... To see a list of all the programs currently running on the system, use the ps command, like this: ps ax The ps command takes many options, ...

Tài liệu được xem nhiều: