LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-16-2009, 04:34 AM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 37
Basic Questions


Hi guys i m just started learning unix .I was working on windows.
Please help me understand it by answering following questions.
How do i find the RAM size for the machine?
What is swap file?
What command are used for log off /Restart and shutdown the linux?

I m using /etc/passwd file for checking user names installed in the machine. is it the correct way?
Do we need to remember different command to do the same task on different unix distributions?

Last edited by pinga123; 10-16-2009 at 04:37 AM. Reason: Wanted to add more questions.
 
Old 10-16-2009, 04:37 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
"free -m" will show you summary details of memory usage in Mb.

Swap is a page file, just like on windows. Pages of memory are "swapped" out to disk if necessary.

logout will log you out of a terminal, reboot will reboot and poweroff will turn the power off.
 
Old 10-16-2009, 04:39 AM   #3
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by acid_kewpie View Post
"free -m" will show you summary details of memory usage in Mb.

Swap is a page file, just like on windows. Pages of memory are "swapped" out to disk if necessary.

logout will log you out of a terminal, reboot will reboot and poweroff will turn the power off.
Are above mentioned commands are common for all unix distributions?
 
Old 10-16-2009, 04:42 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
No, not necessarily, Might not work on HPUX or other non Linux UNIX systems. Will be fine on most Linux variants though.
 
Old 10-16-2009, 04:46 AM   #5
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 37
Free -m results

total used free shared buffers cached
Mem: 1001 960 40 0 115 517
-/+ buffers/cache: 327 673
Swap: 1983 0 1983


What do you mean by shared buffers cached.
Please explain.

How do i find Total hard drive size for the machine.

Last edited by pinga123; 10-16-2009 at 04:48 AM.
 
Old 10-16-2009, 05:40 AM   #6
phani.junk1
LQ Newbie
 
Registered: Oct 2009
Posts: 10

Rep: Reputation: 1
Quote:
Originally Posted by pinga123 View Post
Hi guys i m just started learning unix .I was working on windows.
Please help me understand it by answering following questions.
How do i find the RAM size for the machine?
What is swap file?
What command are used for log off /Restart and shutdown the linux?

I m using /etc/passwd file for checking user names installed in the machine. is it the correct way?
Do we need to remember different command to do the same task on different unix distributions?
command for shutdown and restart are

init 0 --------- fr shutdown
$ init 6 ---------- for restart

u can find the above details in /etc/inittab file

u can find all the userinformation and identity from that file /etc/passwd

for checking the hard disk size use this

# fdisk -l | grep Disk

Last edited by phani.junk1; 10-16-2009 at 06:13 AM.
 
Old 10-16-2009, 06:29 AM   #7
deepak16686
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Rep: Reputation: 1
for seeing the size of memory

free -m
 
Old 10-16-2009, 06:35 AM   #8
deepak16686
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Rep: Reputation: 1
Thumbs up answers of above questions

for seeing the memory in use and free both we use this command
#free -m

for restart the computer in linux is
#reboot
#init 6


for shutting down the computer
#init 0
#poweroff
 
Old 10-16-2009, 08:10 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
deepak, I've already said all of that...??? why repeat?
 
Old 10-16-2009, 09:11 AM   #10
rn_
Member
 
Registered: Jun 2009
Location: Orlando, FL, USA
Distribution: Suse, Redhat
Posts: 127
Blog Entries: 1

Rep: Reputation: 25
You will find that there are almost always more than one way to do something in unix.

The 'shutdown' command (man shutdown) is more ubiquitous among *nix systems.

Also, a good command to see memory and cpu usage: top

There are some system files for getting this info too (/proc), but best leave that until you are more familiar with the system.

/etc/passwd is the most common place to look for user names on any *nix platform.
 
Old 10-16-2009, 09:14 AM   #11
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 37
Please find the content of inittab file but i m not getting anything out of it what are you trying to suggest please help i want to understand this file.



[root@Test ~]# cat /etc/inittab
#
# inittab This file describes how the INIT process should set up
# the system in a certain run-level.
#
# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
# Modified for RHS Linux by Marc Ewing and Donnie Barnes
#

# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
id:5:initdefault:

# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# When our UPS tells us power has failed, assume we have a few minutes
# of power left. Schedule a shutdown for 2 minutes from now.
# This does, of course, assume you have powerd installed and your
# UPS connected and working correctly.
pf:owerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"

# If power was restored before the shutdown kicked in, cancel it.
pr:12345owerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"


# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6

# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon
 
Old 10-16-2009, 09:28 AM   #12
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by pinga123
Please find the content of inittab file but i m not getting anything out of it what are you trying to suggest please help i want to understand this file.
What exactly do you not understand? Please try to ask specific questions

Hint: It causes your system to boot into runlevel 5 and start a display manager using "prefdm" (which I have never heard of)

For more on this file, do "man inittab" in a terminal
 
Old 10-16-2009, 12:44 PM   #13
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,149

Rep: Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887
Quote:
Originally Posted by pinga123 View Post
...
How do i find Total hard drive size for the machine.
man df
 
Old 10-16-2009, 02:33 PM   #14
rajuvk
LQ Newbie
 
Registered: Feb 2007
Location: Kerala, India
Distribution: FC10, Ubuntu 8.04
Posts: 14

Rep: Reputation: 1
Quote:
Originally Posted by pinga123 View Post
Hi guys i m just started learning unix .I was working on windows.
Please help me understand it by answering following questions.
How do i find the RAM size for the machine?
What is swap file?
What command are used for log off /Restart and shutdown the linux?

I m using /etc/passwd file for checking user names installed in the machine. is it the correct way?
Do we need to remember different command to do the same task on different unix distributions?
Basically swap is similar to page file in windows. but in windows one does not earnark space for it, it just saved in the drive where windows installation resides. And it is often hidden.
But in linux you have to specify seperate disk space for swap and marked the file system as swap while doing the disk partition. As a thumb rule we allocate a space double that of RAM of the computer. When more data or programme is loaded in the memory than the physical memory can handle the system writes some of the data or code on the hard disk. If view the memory usage with system monitor you can see the behaviour of the swaping.

Simplest commands to login and logoff ( on a terminal window) is just:

login <username>
logout - here user name is not required.

Command for shutdown is:

shutdown -h 10 - the system will halt and the process will start after a delay of 10 seconds.
for immediate halt use:

shutdown -h 0

Similarly for restart:

shutdown -r 10 == for 10 sec delay
shutdown -r 0 == for immediate restart.

Commands will be the same among the linux distros, but there may be some variations among other unix types OSes.

These commands are for manual operations on a terminal window. for system automation settings different route has to be followed.
 
Old 10-16-2009, 02:37 PM   #15
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
for restart you type restart
for shutdown you type shutdown now
for memory free you type free
for harddisk size you type df -h
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GnuCash, KMyMoney - basic, basic questions - please help if you can. brjoon1021 Linux - Software 3 10-20-2008 07:27 PM
basic questions on hostname and domain name + related postfix questions Moebius Linux - Newbie 7 09-04-2007 12:50 PM
Some REALLY basic questions ljmace1953 Linux - Newbie 3 01-17-2006 01:54 PM
Some basic questions Sigh Linux - Newbie 3 04-21-2005 11:42 AM
Some Basic Questions Instantly Linux - Newbie 1 01-10-2005 11:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration