存档在 ‘linux 系统’ 分类

一道被难倒linux系统管理员基本命令面试题。

2010年4月12日

一道被难倒linux系统管理员基本命令面试题。  一年前我去面试一家互联网公司,面试的人给我出了一个很简单的linux bash 系统变量题,结果我被pass了。其实问题很简单,你先不要看下面的答案,看看你能不能答出来。如果不能很顺利的答出来,月影鹏鹏建议您还是在学习linux的路上多下下苦苦吧,戒骄戒躁呀!

这个面试的题很简单,请说明下面四个变量代表的意义。

$0  $?   $!  $$    就是这个符号看看你能知道这几个系统变量的意义,
如果不知道请查询月影鹏鹏的blog  http://jk.scanmon.com/wp/linux-bash-variable.html
还有在工作中要多留意哟,这样才能成为一个出色的系统管理员
 » 阅读更多: 一道被难倒linux系统管理员基本命令面试题。

How to view Linux server logs

2010年4月10日

Something is wrong with your dedicated server, but that is not even the bad news. The bad news is that you don’t even know it yet. Everything appears to be fine, and it will continue to, as long as you are not monitoring it. Hidden deep within the layers of code, commands, and directories is a ticking time bomb. So, what can you do? One step you can take is to monitor your server’s logs.

» 阅读更多: How to view Linux server logs

Linux中查看文件的最初创建时间

2010年4月8日

在Linux中,没有文件创建时间的概念。只有文件的访问时间、修改时间、状态改变时间。也就是说不能知道文件的创建时间。但如果文件创建后就没有修改 过,修改时间=创建时间;如果文件创建后,状态就没有改变过,那么状态改变时间=创建时间;如果文件创建后,没有被读取过,那么访问时间=创建时间,这个 基本不太可能。
与文件相关的几个时间:
1、访问时间,读一次这个文件的内容,这个时间就会更新。比如对这个文件使用more命 令。ls、stat命令都不会修改文件的访问时间。
2、修改时间,对文件内容修改一次,这个时间就会更新。比如:vi后保存文件。ls -l列出的时间就是这个时间。
3、状态改变时间。通过chmod命令更改一次文件属性,这个时间就会更新。查看文件的详细的状态、准确的修改 时间等,可以通过stat命令 文件名。
» 阅读更多: Linux中查看文件的最初创建时间

黑客如何悄然修改你的文件时间

2010年4月7日

如果一个黑客悄然进入你的linux服务器系统,在离开服务器的时候总是需要做一些毁尸灭迹的事情,防止他人发现,比如删除了系统日志和一些登陆信息,为了不让你看出那些文件被修改过总是。所以总会将那些修改过文件的修改时间更改得较早一些。

月影鹏鹏发现,touch命令变成了最大的帮凶。通过touch命令修改时间你也可以试一试这个命令

» 阅读更多: 黑客如何悄然修改你的文件时间

Minimalist Linux desktops

2010年3月30日

by Richard Hillesley

Lightweight desktops have a multitude of uses, on netbooks, for mobile devices, for older hardware, for users with limited requirements of their systems, for connecting to applications in the cloud, and for bare knuckled programmers who prefer to work closer to the metal.


Puppy lightweight Linux. Vergrößern The most popular desktops for Linux – KDE and GNOME – are are equal to the demands of most users, but if you are a sysadmin or programmer who does most of his or her work in a shell, or on the command line through vim or vi or Emacs, your demands of a desktop environment or a window manager may be relatively limited. A fully-featured desktop environment may, perversely, sometimes get in the way of useful work.   For more please visit http://jk.scanmon.com/en

» 阅读更多: Minimalist Linux desktops

Red Hat Moves Into Desktop Virtualization

2010年3月30日

Open source enterprise software company Red Hat has updated its virtualization platform, Red Hat Enterprise Virtualization (REV), to include support for desktop virtualization, the company announced Monday.   more from  http://jk.scanmon.com/en

» 阅读更多: Red Hat Moves Into Desktop Virtualization

Linux & Solaris硬件信息查看的命令

2010年3月25日

Linux
内存: cat /proc/meminfo
cpu:  cat /proc/cpuinfo
硬盘: df -h -T(no device的设备看不到)
fdisk -l可以在redhat9.0中看; redhat企业版不行.
还有几个命令可以看很多硬件设备的信息.
lspci -v
dmidecode
dmesg

» 阅读更多: Linux & Solaris硬件信息查看的命令

linux重定向命令应用及语法

2010年3月25日

1. 标准输入的控制
语法:命令 文件将命令的执行结果送至指定的文件中。
例如:
ls -l > list 将执行“ls -l” 命令的结果写入文件list 中。
语法:命令>! 文件将命令的执行结果送至指定的文件中,若文件已经存在,则覆盖。
例如:
ls -lg >! list 将执行“ls – lg” 命令的结果覆盖写入文件list 中。
语法:命令>& 文件将命令执行时屏幕上所产生的任何信息写入指定的文件中。
» 阅读更多: linux重定向命令应用及语法

Linux文件系统损坏后的远程修复方案

2010年3月17日

注意:使用fsck一定要先卸载分区,否则后果自负

【一】

是出现经常非法关机,断电,导致文件系统不连续,而在强制检查后不能通过的情况,系统会进入一个修复(repair)模式,

需要远程协助开启network和sshd服务,然后 cd /boot; umount / ; fsck -y /dev/sda3(假设根目录分区为sda3)

这里可能会有一些不连续或者部分损坏的文件被系统搁置到/lost+found目录下,都以#开头,以节点命名的目录,

需要手动恢复,恢复步骤自行到网上查询,需要确认原来的目录结构

» 阅读更多: Linux文件系统损坏后的远程修复方案

Learn Linux, 101: File editing with vi

2010年3月16日

Overview

In this article, learn the basic use of the vi editor, which is almost always available on any Linux or UNIX system. Learn to:

  • Navigate a document using vi
  • Use basic vi modes
  • Insert, edit, delete, copy, and find text

This article helps you prepare for Objective 103.8 in Topic 103 of the Linux Professional Institute’s Junior Level Administration (LPIC-1) exam 101. The objective has a weight of 3.

Prerequisites

To get the most from the articles in this series, you should have a basic knowledge of Linux and a working Linux system on which you can practice the commands covered in this article. Sometimes different versions of a program will format output differently, so your results may not always look exactly like the listings and figures shown here.

» 阅读更多: Learn Linux, 101: File editing with vi