61阅读

who am i-Linux命令who am i,who,whoami

发布时间:2018-03-05 所属栏目:Linux

一 : Linux命令who am i,who,whoami

Linux命令who am i,who,whoami

今天要说的不是成龙的电影“我是谁”,而是Linux里的who系列命令,包括

who、whoami和who am i。

www.2cto.com

先看看这三个命令的输出信息:

[rocrocket@rocrocket ~]$ whoami

rocrocket

[rocrocket@rocrocket ~]$ who am i

rocrocket pts/3 2008-12-30 13:17 (:0.0)

[rocrocket@rocrocket ~]$ who

rocrocket :0 2008-12-30 09:54

rocrocket pts/0 2008-12-30 09:55 (:0.0)

rocrocket pts/1 2008-12-30 09:57 (:0.0)

rocrocket pts/3 2008-12-30 13:17 (:0.0)

当我用sudo su(或者sudo su -)更换到root用户之后,你再看看:

www.2cto.com

[rocrocket@rocrocket ~]$ sudo su

[root@rocrocket rocrocket]# whoami

root

[root@rocrocket rocrocket]# who am i

rocrocket pts/3 2008-12-30 13:17 (:0.0)

[root@rocrocket rocrocket]# who

rocrocket :0 2008-12-30 09:54

rocrocket pts/0 2008-12-30 09:55 (:0.0)

rocrocket pts/1 2008-12-30 09:57 (:0.0)

rocrocket pts/3 2008-12-30 13:17 (:0.0)

看出区别来了吧,whoami显示的是当前“操作用户”的用户名,而who am i显示的是“登录用户”的用户名。

用Linux的术语来解释就是:(实际用户=uid,即user id。有效用户=euid,即effective user id)

who am i 显示的是实际用户的用户名,即用户登陆的时候的用户ID。此命令相当于who -m。

whoami 显示的是有效用户ID. www.2cto.com

好了,明白了两者区别之后,我们来说说who这个命令。

有人会问,为什么我sudo su到root之后,who里面却没有显示呢?

这是因为su过去的用户进程空间是作为一个子空间存在,他并没有得到一个登录的tty。

who这个命令重点是用来查看当前有哪些用户登录到了本台机器上。

who -m的作用和who am i的作用是一样的。

who -q用来显示当前登录用户的个数。

当你觉得who的输出信息晦涩难懂时,可以使用who -H来输出,这样可以在每列加上列名称,有助于阅读。

扩展:linux whoami命令 / whoami who am i / linux who命令

二 : 英语作文1600多字。标题 why i am who i am

Why Am I Who I Am

Since was born I have been living with my grandparents for 22 years, when what I have learned from my grandma is more from my parents. Although she never went to school for one class, nearly called illiteracy, in the real life is a wise and lovely person who has taught me many instructional truths.

She often tells me her most difficult days when the reform and opening-up policy has not been put forward and even when there was no enough grains to fill their bellies. At that time being a woman was not the excuse for an easier task, as I know, grandma spent her all strength on shouldering bags of corns or taking river mud with carrying-pole from the board to the shore. What she had endured before was hard for my generation to imagine, which is like no one could feel the same as you do. However, whenever she talked to me about her experiences on her hard ages my confidence and my happiness always magically flied back to me.

Someday it’s still on summer holiday and accidentally I fell off from my bicycle. One of my legs got so hurt with pains torturing hard that I didn’t want to talk to anyone and even had any food. I felt so down, which seemed that I could not walk like normal people any more, at least before my leg recovered I had to stay at home and could not mobile freely. It’s grandma who came besides my bed bringing me my favorite cake. “Get up, Chuchu. You just hurt your leg; do not starve your stomach. Ok?” “No, I am not hungry.” Maybe she observed my hesitation, then stretched her hands and dragged me up. “Child, you should know you are happy whenever and whatever you will come through. Because the time you are in is much better than that I was ever in. Had you eaten the grassroots? Had you lived in a house which had several holes so that when it was raining there were lots of drips dropping frequently? Had you worn clothes with over one or just one patch?” I shake my head but at the same time I was shocked about what grandma said. Gradually I got it and listened to her more carefully. “No, you hadn’t. Remember that life is never easy without pain. How you will live your life is up to you. Thing will get better and you wouldn’t see the beauty of the life unless you choose to stay there without looking forward and moving up.” She passed me the cake wearing a lovely smile.

I love my grandma very much. To my sadness, she was old and illness haunts her. Yes! Time flies so fast, when I call back the days I have spent: Now it’s my last term in the university and I will have to walk out of my parents’ umbrella of protect in order to support myself. Time is visible sometimes I suddenly found my grandparents have been too old nearly to take care of themselves. Time is what I hate which makes everything uncertain. Once and once I am afraid of time for it oldens my face, slows my acts and threatens my health. I have seen many old people who lead unhappy life before while grandma has her positive thought and tries to have every happy day.

Grandma has fields 8 acres in size to care and various vegetables to grow, as old she is and should enjoy her later life, still continues her work. We also tried to persuade her not to work in the fields and planed to rent them out to other person. Every time we referred this topic to her, always arouse her anger and complained: “What will we eat if we have no fields!” After while we all kept quiet and not mention this any longer. Sometimes after finishing her one-day farm work she complained 1

i am i 英语作文1600多字。标题 why i am who i am

about her backache. “Grandma, you needn’t manage those fields. My dad won’t leave you helpless.” “I know this. It is inevitable for me to give up on my fields. But now I still have energy to do my job, feed myself.” Looking at her swarthy cheek, white hairs and winkled forehead unnamed grief folded me, which drew me into deep reflection: Everyone is a unique individual from child to the old though we have to rely on others and need help from friends or parents like grandma, like me. You may be lucky enough to have people around you who always love you, however, still should keep yourself independent for developing or advancing your individual character. Of course I am not about to tell you some sermons with which anyone is no more familiar, but my purpose is just that express my gratitude to my grandma who have left me many knowledge of life philosophy.

Nevertheless, my grandpa and dad are the examples that warn me against what tells from their behaviors. Although grandpa has a sense of humor and makes delicious meals, sometimes he is so stubborn and easily gets angry. For example, once grandma indicated that grandpa should stop smoking for good health. Then grandpa was furious and said: “Will I die if I keep smoking? Stop fussing!” He always thinks that what he does is right and won’t allow others to judge or say “No”. So how tolerant my grandma is who have lived with him for more than 50 years and now still remains harmonious with grandpa. As to my dad, he has little knowledge which makes him stupid and I can feel that the relationship between grandpa and dad is something unfriendly, which was found by me when we have meals because they nearly have no talk. Dad never actually cares about my studies and my feelings—— He only instructs me to study hard and take care of myself and lets me know he is trying to earn money so as to assure us life is becoming better. Anyway, I love my dad for his love to me. Sometimes I occasionally remind myself of their behaviors and often keep these truths in my mind: Forgive people who make mistakes because of their ignorance; Be tolerant about your family member who are ones that any other people cannot replace; Work hard to give your child better things and at the same time do not forget to communicate with them regularly and faithfully.

61阅读提醒您本文地址:

My education from school, in my opinion, mostly is passive. Teachers teach students knowledge according to the certain textbooks; we students just need to take it and remember it; they would like to stuff students’ brains with all what they need students to grasp; Scores is the most important thing used to measure students’ study ability by teachers. What impressed me most is that there is no library in my primary school and secondary school, where it is not necessary for students to read other books except for textbooks. There were nearly no activities held by school, but I often hang out with my friends flying kite, going fishing, enjoying snacks and so on. As an old saying goes, interest is the best teacher and the more you have learnt, the less you think you have got. So before I receive higher education there were little interests for me to have classes and more and more times my academic record ranked a little higher or lower than the average score in class which seemed not good or too bad. Moreover, parents like to compare their child’s scores with others’ when they were communicating with each other and my scores sometimes shamed them which made me more diffident or depressed. Once I had blamed myself many times, but when my 2

i am i 英语作文1600多字。标题 why i am who i am

feeling was low I preferred to stay alone and write in my diary.

At last but not least, thank my parents for sending me to the university that provides the chance of having an access to lots of world famous works, where I could enrich myself professionally and mentally. I have a few friends in the university; mostly I would like to be quiet. With my friends I always laugh my head off; that smiles appear on my face. What reading a book brings me is something that inspires my positive attitudes to the experiences I have undergone. Take Schopenhauer for example, I ever read one of his books called Schopenhauer’s Philosophy on Life which was the Chinese edition. He thinks that life should be full of sufferings and human cannot get rid of them. From his fragment I saw in his book I know more about the essence of our mortal people’s humanity and then in the real world his sayings impel me not to take others too seriously or to look into the future when confront something unfortunate. We live in the world for a short time; we have the same ending — die, but sometimes we could hold the string of out fate and also could not decide what will happen to us. Gibran’s Prophet is filled with wisdom. This book talks about various themes about life including freedom, self-knowledge, friendship, giving and so on. When saw this sentence, I seemed to be relieved, which is “…And you receivers—and you are all receivers—assume no weight of gratitude, lest you lay a yoke upon yourself and upon him who gives.” Because I always think I am having my family’s love without doing more things for them and I owe them too much. My friends are often willing to help me out of trouble, forgive my errors and keep company with me. To my depression, I was ever guilty of these facts that was receiving but not know how to give not for exchanging. Now I know how much you receive or give, which is more or less, does not matter, love and faith does. So happy my everyday!

Actually I myself do not make sense of the question: who am I? However, people think by themselves, which make them human. That is the reason why I write this to answer the question.

3

61阅读提醒您本文地址:

三 : 一年级英语作文:Who am I?

Hello! My name is Feifei. My mother is very beautiful. My father is very handsome. So I’m very lovely. Look! My coat is white. My eyes are blue. I have a long tail. Fish is my favorite food. I like mice too. Guess! Who am I?

四 : 人物英语作文:Who am I

  Hello! My name is Feifei. My mother is very beautiful. My father is very handsome. So I’m very lovely. Look! My coat is white. My eyes are blue. I have a long tail. Fish is my favorite food. I like mice too. Guess! Who am I?

本文标题:who am i-Linux命令who am i,who,whoami
本文地址: http://www.61k.com/1145974.html

61阅读| 精彩专题| 最新文章| 热门文章| 苏ICP备13036349号-1