1 learn some more commands:

  (1) ls-List directory contents

  (2) file -Determine file type

  (3) less-View file contents

2 ls

  (1)Type ls to see a list of files and subdirectories contained in the current working directory.

  (2)Besides the current working directory,we can specify the directory to list,like   ls /user

  (3)Or even specify multiple directories,like   ls ~ / user (home directory)

  (4)change the format of the ouput to reveal more detail,like  ls - l,we changed the output to the long format.

3 options and arguments

  The ls command has a large number of possible options.

  (1)-a  --all  List all filee,even those with names that begin with a period,which are normally not listed(i.e.hidden)

  (2)-d  --directory  Ordinaryly,if a directory is specified, ls will list the contents of the directory, not the directory itself. Use this option in conjunction with the -l option to see details about the directory rather than its contents.

  (3)-F  --classify  This option will append an indicator character to the end of each listed name.

  (4)-h  --human-readable  In long format listings ,diaplay file sizes in human readable format rather than in bytes.

  (5)-l      Display results in long format.

  (6)-r  --reverse  Display the results in reverse order.Normally,ls display its results in ascending alphabetical order.

  (7)-S     Sort results by file size.

  (8)-t      Sort by modification time.

4 long format output

  This format contains a great deal of useful imformation.

  format-  -rw-r--r--  file's number of hard links the user name of the file's owner  the name of the group which owns the file  size of the file in bytes  date and time of the file's last modification  name of the file 

  here is the examples directory from an Ubuntu system:

  -rw-r--r-- 1 root root 3576296 2007-04-03 11:05 Experience ubuntu.ogg

5 determine  a file's type

  The file command will print a brief description of the file's contents.

6 view text files 

  The  less command is a program to view text files. The table below lists the most common keyboard commands used by less.

  (1) Page Up or b-Scroll back one page

  (2) Page Down or space-Scroll forward one page

  (3) UP Arrow-Scroll Up one line

  (4) Down Arrow-Scrow Down one line

  (5) G -Move to the end of the text file

  (6) 1G or g-Move to the beginning of the text file

  (7) /characters-Search forward for the next occurrence of characters

  (8) n-Search forward for the next occurrence of the previous search

  (9) h-Display help screen

  (10) q-Quit less

7 less is more

  The less program was designed as an improved replacement of an earlier Unix program called more.less falls into the class of programs called "pagers", programs that allow the easy viewing of long text documents in a page by page manner.Whereas the more program could only page forward, the less program allows paging both forward and backward and has many other features as well.

8 wander around the file system

  list just a few of the directories we can explore.

/ The root directory.Where everything begins.
/bin Contains binaries (programs) that must be present for the system to boot and run.
/boot Contains the linux kernel, intial RAM disk image (for drivers needed at boot time), and the boot loader.

Interesting files:

  • /boot/grub/grub.conf or menu.lst, which are used to configure the boot loader.
  • /boot/vmlinuz,the linux kernel.
/dev This is a special directory which contains device nodes. "Everything is a file" also applies to devices. Here is where the kernel maintains a list of all the devices it understands.
/etc The /etc directory contains all of the system-wide configuration files. It also contains a collection of shell scripts which start each of the system services at boot time. Everything in this directory should be readable text.

Interesting files:While everything in /etc is interesting, here are some of my all-time favorites:

  • /etc/crontab, a file that defines when automated jobs will run.
  • /etc/fstab, a table of storage devices and their associated mount points.
  • /etc/passwd, a list of the user accounts.
/home In normal configurations, each user is given a directory in /home. Ordinary users can only write files in their home directories. This limitation protects the system from errant user activity.
/lib Contains shared library files used by the core system programs. These are similar to DLLs in Windows.
/lost+found Each formatted partition or device using a Linux file system, such as ext3, will have this directory. It is used in the case of a partial recovery from a file system corruption event. Unless something really bad has happened to your system, this directory will remain empty.
/media On modern Linux systems the /media directory will contain the mount points for removable media such USB drives, CD-ROMs, etc. that are mounted automatically at insertion.
/mnt On older Linux systems, the /mnt directory contains mount points for removable devices that have been mounted manually.
/opt The /opt directory is used to install “optional” software. This is mainly used to hold commercial software products that may be installed on your system.
/proc The /proc directory is special. It's not a real file system in the sense of files stored on your hard drive. Rather, it is a virtual file system maintained by the Linux kernel. The “files” it contains are peepholes into the kernel itself. The files are readable and will give you a picture of how the kernel sees your computer.
/root This is the home directory for the root account.
/sbin This directory contains “system” binaries. These are programs that perform vital system tasks that are generally reserved for the superuser.
/tmp The /tmp directory is intended for storage of temporary, transient files created by various programs. Some configurations cause this directory to be emptied each time the system is rebooted.
/usr The /usr directory tree is likely the largest one on a Linux system. It contains all the programs and support files used by regular users.
/usr/bin /usr/bin contains the executable programs installed by your Linux distribution. It is not uncommon for this directory to hold thousands of programs.
/usr/lib The shared libraries for the programs in /usr/bin.
/usr/local The /usr/local tree is where programs that are not included with your distribution but are intended for system- wide use are installed. Programs compiled from source code are normally installed in /usr/local/bin. On a newly installed Linux system, this tree exists, but it will be empty until the system administrator puts something in it.
/usr/sbin Contains more system administration programs.
/usr/share /usr/share contains all the shared data used by programs in /usr/bin. This includes things like default configuration files, icons, screen backgrounds, sound files, etc.
/usr/share/doc Most packages installed on the system will include some kind of documentation. In /usr/share/doc, we will find documentation files organized by package.
/var With the exception of /tmp and /home, the directories we have looked at so far remain relatively static, that is, their contents don't change. The /var directory tree is where data that is likely to change is stored. Various databases, spool files, user mail, etc. are located here.
/var/log /var/log contains log files, records of various system activity. These are very important and should be monitored from time to time. The most useful one is /var/log/messages. Note that for security reasons on some systems, you must be the superuser to view log files.

9 symbolic link(soft link or symlink)

  In most Unix-like systems it is possible to have a file referenced by multiple names.

10 hard link

  Hard links also allow files to have multiple names , but they do it in a different way.

Chap4:探究操作系统[The Linux Command Line]的更多相关文章

  1. 《The Linux Command Line》 读书笔记04 Linux用户以及权限相关命令

    Linux用户以及权限相关命令 查看身份 id:Display user identity. 这个命令的输出会显示uid,gid和用户所属的组. uid即user ID,这是账户创建时被赋予的. gi ...

  2. 《The Linux Command Line》 读书笔记02 关于命令的命令

    <The Linux Command Line> 读书笔记02 关于命令的命令 命令的四种类型 type type—Indicate how a command name is inter ...

  3. 《The Linux Command Line》 读书笔记01 基本命令介绍

    <The Linux Command Line> 读书笔记01 基本命令介绍 1. What is the Shell? The Shell is a program that takes ...

  4. Linux Command Line Basics

    Most of this note comes from the Beginning the Linux Command Line, Second Edition by Sander van Vugt ...

  5. Linux Command Line 解析

    Linux Command Line 解析 0 处理模型 Linux kernel的启动包括很多组件的初始化和相关配置,这些配置参数一般是通过command line进行配置的.在进行后续分析之前,先 ...

  6. 15 Examples To Master Linux Command Line History

    When you are using Linux command line frequently, using the history effectively can be a major produ ...

  7. 10 Interesting Linux Command Line Tricks and Tips Worth Knowing

    I passionately enjoy working with commands as they offer more control over a Linux system than GUIs( ...

  8. Reso | The Linux Command Line 的中文版

    http://book.haoduoshipin.com/tlcl/book/zh/ 本书是 The Linux Command Line 的中文版, 为大家提供了多种不同的阅读方式. 中英文双语版- ...

  9. [笔记]The Linux command line

    Notes on The Linux Command Line (by W. E. Shotts Jr.) edited by Gopher 感觉博客园是不是搞了什么CSS在里头--在博客园显示效果挺 ...

随机推荐

  1. (Java编程思想)Thinking in Java

    1. 为什么突然想去研读<Thinking in Java>? 最近终于下定决心撸了一本<Thinking in Java>第四版,虽然在此之前我就久闻这本书的大名,但一直未曾 ...

  2. tensorflow 笔记10:tf.nn.sparse_softmax_cross_entropy_with_logits 函数

    函数:tf.nn.sparse_softmax_cross_entropy_with_logits(_sentinel=None,labels=None,logits=None,name=None) ...

  3. Weka算法Clusterers-Xmeans源代码分析(一)

    <p></p><p><span style="font-size:18px">上几篇博客都是分析的分类器算法(有监督学习),这次就分 ...

  4. 教你一招:[转载]使用 Easy Sysprep v4 封装 Windows 7 精品

    (一) 安装与备份系统 1. 安装 Windows 7 先使用第三方分区工具(DiskGenius分区)在虚拟机中分区,然后将封装的母盘文件安装写入指定的安装盘,写入完成后重启系统开始部署. 2. 进 ...

  5. Vue.js常用指令:v-for

    一.什么是v-for指令 在Vue.js中,我们可以使用v-for指令基于源数据重复渲染元素.也就是说可以使用v-for指令实现遍历功能,包括遍历数组.对象.数组对象等. 二.遍历数组 代码示例如下: ...

  6. 川崎机器人c#通讯(转)

    由于本人在工业自动化行业做机器视觉的工作,所以除了图像处理方面要掌握外,还需要与工业机器人进行通信.最近学习了计算机与川崎机器人的TCP/IP通信,于是在这里记录一下. 除了直接与机器人通信外,有一种 ...

  7. 修改Linux下的文件以及文件夹的权限

    如何在Linux中管理文件和文件夹的权限? 2014-02-12 10:58 布加迪编译 51CTO 字号:T | T Linux系统有严格的权限管理制度,操作者权限与文件权限不匹配时将无法对文件进行 ...

  8. JVM学习(3)——总结Java内存模型---转载自http://www.cnblogs.com/kubixuesheng/p/5202556.html

    俗话说,自己写的代码,6个月后也是别人的代码……复习!复习!复习!涉及到的知识点总结如下: 为什么学习Java的内存模式 缓存一致性问题 什么是内存模型 JMM(Java Memory Model)简 ...

  9. Oracle垃圾数据清理相关问题 分类: Oracle 2015-08-06 11:14 12人阅读 评论(0) 收藏

    垃圾数据清理,简单的说,就是删除不需要的那些数据,释放存储空间 最常用的就是delete命令.truncate命令,甚至是删除表空间重建,具体操作都很简单,不是本文的重点 下面,总结几个垃圾数据清理常 ...

  10. JSON 转JAVA代码

    http://jsongen.byingtondesign.com/ http://pojo.sodhanalibrary.com/ http://www.jsonschema2pojo.org/