Archive for April, 2008
Learning Linux For Beginners 1
Peace to you all.
In this series, I will try to discuss to you the Linux essentials commands and operations. I will begin from zero to learn Linux for beginners, also other people may know some new information.
The Terminal
A “terminal” is a way of typing commands to the computer. That may sound very strange, but it’s actually really, really nice and easy once you get used to it. You can either open a terminal inside of your graphical environment, or you can switch your whole screen to a terminal. You can use any graphical system you need like Fedora, OpenSuse, or Ubuntu.
To open the terminal from the graphical system :-
In Fedora –> Open main menu then System then Terminal
In Ubuntu –> Open main menu then Accessories then Terminal
To switch you entire screen to console, press Ctrl-Alt-F1. You can then switch between six different terminals, by using Alt-F1 through Alt-F6. Pressing Alt-F7 will bring you back to your graphical environment.
The Basic Operations
The su (short for substitute user) command makes it possible to change a login session’s owner (i.e., the user who originally created that session by logging on to the system) without the owner having to first log out of that session.
Although su can be used to change the ownership of a session to any user, it is most commonly employed to change the ownership from an ordinary user to the root (i.e., administrative) user, thereby providing access to all parts of and all commands on the computer or system. For this reason, it is often referred to (although somewhat inaccurately) as the superuser command. It is also sometimes called the switch user command.
In ubuntu we use the command : sudo -s to do the same functionality.
Advantages of Using su
su is usually the simplest and most convenient way to change the ownership of a login session to root or to any other user.
More importantly, it provides a safer way for administrators on multi-user systems (as well as for users on home computers or other single-user systems) to use the system than to routinely log on as the root user. That is, there is much less potential for accidental or malicious damage if an administrator first logs on as an ordinary user (who, by default, has very limited system privileges) and uses that account for routine tasks that do not require root’s sweeping powers. su can then be used to switch to the root account for only those operations that actually require root access (e.g., making system repairs and managing user accounts).
The use of su instead of routinely logging in as root is particularly important when connected to the Internet. This is because it makes it much more difficult for malicious software originating on remote computers to access critical system files or commands (which belong to the root account).
On multiuser systems, not only the root account but also su should be used to the minimum extent necessary, and it should be used with great caution. This includes making certain (1) that no unauthorized persons see any passwords used with su (such as watching a password being typed in or seeing it on paper), (2) that su sessions are not left unattended and (3) that su sessions are terminated as soon as the tasks for which they were invoked have been completed.
When su is used while in console mode (i.e., with a text-only screen display), the original user’s session cannot, of course, be used on the same machine (because the su session occupies the entire screen). However, when su is used in a terminal window (i.e., a text-only window in a GUI), only that terminal window and programs that are started from it are run with the new user’s account (e.g., root), and all other programs, including any other terminal windows, can continue to be run by the original user.
A convenient way of eliminating the need for typing su numerous times during a session is to open a terminal window, run su once in that window and then use the window for all root tasks (i.e., tasks for which administrative privileges are required) during the session. However, it is important to make certain that no one has physical access to the computer during such session. Thus, it is advisable to close the terminal window as soon as practical, unless it is used on a home system (where, presumably, nobody is around to cause damage to the system or steal data).
Another advantage of using su is that a record is kept of its usage in system logs, whereas no such record is kept if one logs in directly as root.
Syntax
A simplified expression of the syntax of the su command is:
su [options] [commands] [-] [username]
The square brackets indicate that the enclosed item is optional. Thus, the simplest way to use the su command is to just type:
su
The operating system assumes that, in the absence of a username, the user wants to change to a root session, and thus the user is prompted for the root password as soon as the ENTER key is pressed. This produces the same result as typing:
su root
If the correct password is provided, ownership of the session is changed to root.
Likewise, to transfer the ownership of a session to any other user, the name of that user is typed after su and a space. For example, to change the owner of the current login session to a user named alice, type the following:
su alice
The user will then be prompted for the password of the account with the username alice.
Tail a Log with su
A major benefit of using su is that a record is kept of its usage in a system log, typically /var/log/messages. This is particularly valuable if there are multiple administrators for the system (each of which should have an individual username and password), because it facilitates finding out who was doing what and when. /var/log/messages records the username and user ID (UID) of the user that opens a su session as well as the times that the session is opened and closed. However, su does not keep a record of what is actually done as root, and such information must therefore be obtained from other sources.
The contents of /var/log/messages can be viewed by first using su to switch to the root account and then issuing the following command:
tail /var/log/messages
It is convenient to use the tail command here because it shows the last part of a file, rather than starting at the beginning as commands such as cat (possibly the most commonly used command for reading text files) do. As /var/log/messages can be a rather long file, this can save a lot of scrolling.
Tail prints (i.e., writes to the monitor screen) the final ten lines by default, but this can be easily adjusted by using the -n option followed by a space and an integer representing the desired number of lines. For example, the following command would print the final 20 lines of /var/log/messages:
tail -n 20 /var/log/messages
As is the case with many command line programs, there is a graphical front end available for su, and it is named KDE su. A graphical front end is a GUI program that operates on top of a command line program and replaces its character-based user interface with a graphical one.
su is one of the GNU Core Utilities, which are developed by the Free Software Foundation (FSF) and are therefore open source and free to use, study, modify and redistribute. KDE su is also free software.
Add comment 30 April 2008
هذي بلاد لم تعد كبلادي
هذى بلاد لم تعد كبلادى
لم أكن أتصور يوماً ما أن من قام بتأليف نشيد الجيش المصري الذى طالما أنشدناة فى طليعة كل صباح فيحيى فينا من الحماس و الإلهام و صدق الكلمات و عذوبة العبارات التى نلمسها جميعاً عند ترديدة, لم أكن أتخيل أن من كتب هذة ,الكلمات و أحسسها بكل ذرة فى كيانة, لم أعد أتصور أن من كتب و قال
رسمنا على القلب وجه الوطن, نخيلاً و نيلاً و شعباً أصيلاً
و صنالك يا مصر طول الزمن ليبقى شبابك جيـــلاً فجــيلاً
لم أعد أصدق أن من كتب هذا النشيد قد أتى يوما ما عليه و قد طفح بة الكيل إلى أن كتب قصيدة بعنوان “هذى بلادُ لم تعد كبلادى“, إنة الشاعر فاروق جويدة.
نشيد الجيش المصري لفاروق جويدة
رسمنا علي القلب وجه الوطن
نخيلا ونيلا وشعبا اصيلا
وصناك يامصر طول الزمن
ليبقي شبابك جيلا فجيلا
علي كل ارض تركنا علامة
قلاعا من النور تحمي الكرامة
عروبتنا تفتديك القلوب
ويحميك بالدم جيش الكنانة
وتنساب يا نيل حرا طليقا
لتحكي ضفافك معني النضال
وتبقي مدي الدهر حصنا عريقا
بصدق القلوب وعزم الرجال
يد الله يا مصر ترعي سماك
وفي ساحة الحق يعلو نداك
ومادام جيشك يحمي حماك
ستمضي الي النصر دوما خطاك
سلام عليك اذا ما دعانا
رسول الجهاد ليوم الفداء
وسالت مع النيل يوما دمانا
لنبني لمصر العلا والرخاء
قصيدة هذى بلاد لم تعد كبلادى
كم عشت أسأل .. أين وجه بلادي
أين النخيل .. و أين دفء الوادي
لا شيء يبدو في السماء أمامنا
غير الظلام .. وصورة الجلاد
هو لايغيب عن العيون كأنه قدر
كيوم البعث و الميلاد
قد عشت اصرخ بينكم و أنادي
أبني قصورا من تلال رمادي
أهفو لأرض لا تساوم فرحتي
لا تستبيح كرامتي .. و عنادي
أشتاق أطفالا كحبات الندى
يتراقصون مع الصباح النادي
أهفو لأيام توارى سحرها
صخب الجياد .. و فرحه الأعياد
اشتقت يوما أن تعود بلادي
غابت و غبنا .. و انتهت ببعادِ
في كل نجم ضل حلم ضائع
و سحابة لبست ثياب حدادِ
و على المدى اسراب طير راحل
نسي الغناء .. فصار سرب جرادِ
هذي بلاد تاجرت في ارضها
و تفرقت شيعـًا بكل مزاد
لم يبق من صخب الجياد سوى الاسى
تاريخ هذى الارض بعض جيادِ
في كل ركن من ربوع بلادي
تبدو أمامي .. صورة الجلاد
لمحوه من زمن يضاجع أرضها
حملت سفاحا .. فاستباح الوادي
لم يبق غير صراخ أمس راحل
و مقابر سئمت من الاجداد
و عصابه سرقت .. نزيف عيوننا
بالقهر و التدليس و الاحقاد
ما عاد فيها ضوء نجم شارد
ما عاد فيها صوت طير شادِ
تمضى بنا الاحزان ساخره بنا
و تزورنا دوما .. بلا ميعادِ
شيء تكسر في عيوني بعدما
ضاق الزمان بثورتي و عنادي
احببتها .. حتى الثماله بينما
باعت صباها الغض للاوغادِ
لم يبق فيها غير صبح كاذب
و صراخ أرض في لظى استعبادِ
لا تسألوني عن دموع بلادي
عن حزنها .. في لحظة استشهادي
في كل شبر من ثراها صرخة
كانت تهرول خلفنا و تنادي
الافق يصغر و السماء كئيبة
خلف العيون أرى جبال سوادِ
تتلاطم الامواج فوق رؤسنا
و الريح تلقى للصخور عتادِ
نامت على الافق البعيد ملامح
و تجمدت بين الصقيع أيادِ
و رفعت كفى .. قد يراني عابر
فرأيت أمي .. في ثياب حدادِ
أجسادنا كانت تعانق بعضها
كعناق أحبابٍ .. بلا ميعاد ِ
البحر لم يرحم براءه عمرنا
تتزاحم الاجساد في الاجسادِ
حتى الشهادة راوغتني لحظة
واستيقظت فجرا .. اضاء فؤادي
هذا قميصى فيه وجه بنيتي
و دعاء أمي .. كيس ملح زادي
ردوا إلى امي القميص فقد رأت
ما لا أرى .. من غربتي و مرادي
وطن بخيل باعني في غفلة
حين اشترته عصابة الافساد
شاهدت من خلف الحدود مواكبا
للجوع تصرخ في حمى الاسياد
كانت حشود الموت تمرح حولنا
و العمر يبكي .. و الحنين ينادي
ما بين عمر .. فر مني هاربا
و حكايه .. يزهو بها أولادي
عن عاشق هجر البلاد و أهلها
و مضى وراء المال .. و الامجادِ
كل الحكايه أنها ضاقت بنا
و استسلمت للص و القواد
في لحظة .. سكن الوجود
تناثرت حولي مرايا الموت و الميلادِ
قد كان آخر ما لمحت على المدى
و النبض يخبو .. صورة الجلاد
قد كان يضحك .. و العصابة حوله
وعلى امتداد النهر .. يبكى الوادي
و صرخت و الكلمات تهرب من فمي
هذي بلاد .. لم تعد كبلادي
2 comments 18 April 2008