Important built-in information in Debian Wheezy 7 system.

Important built-in information in Debian Wheezy 7 system.

  • Our purpose is how we can grab important information available in our system.
    We can guide us trough many available built-in tools. It’s impossible to remember all commands and what functions they have.
    The system give us the opportunity to rediscover forgotten things.
    When you’ve a question you can use the whatis command, the answer will be displayed.
    Lets see what’s happen if you execute the command without any option.

    The system will ask you what you want to know.
    Type whatis + enter.

anne@alfa:~$ whatis
whatis what?
anne@alfa:~$

  • Retype your whatis command + option you willing to know about.
    Example 1: Type whatis + uptime + enter.

anne@alfa:~$ whatis uptime
uptime (1)           – Tell how long the system has been running.
anne@alfa:~$

  • Example 2: Type whatis + date + enter.

anne@alfa:~$ whatis date
date (1)             – print or set the system date and time
anne@alfa:~$

  • If you dont know what a command stands for you can use the same whatis command + name programm or syntax.
    Let’s use the ls as option.
    Type whatis + ls +enter.

anne@alfa:~$ whatis ls
ls (1)               – list directory contents
anne@alfa:~$

  • Let’s ask what the dir represents.
    Type whatis + dir + enter.

anne@alfa:~$ whatis dir
dir (1)              – list directory contents
anne@alfa:~$

  • The whatis command is useful but sometimes we want to know more about the syntax. We can execute the specified command + –help.
    Example 1: Type ls –help + enter.
    (below a incomplete help page displayed)

anne@alfa:~$ ls –help
Usage: ls [OPTION]… [FILE]…
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor –sort is specified.

Mandatory arguments to long options are mandatory for short options too.
-a, –all                  do not ignore entries starting with .
-A, –almost-all           do not list implied . and ..
–author               with -l, print the author of each file
-b, –escape               print C-style escapes for nongraphic characters
–block-size=SIZE      scale sizes by SIZE before printing them.  E.g.,
`–block-size=M’ prints sizes in units of
1,048,576 bytes.  See SIZE format below.

  • We can consult man pages in our terminal. Man pages describe how to use syntax combinations.
    This can be overwhelming when you open a man page.
    Use the ls option in this example.
    Type man ls + enter.
    (below a incomplete man page displayed)
    Press q to leave man page!

anne@alfa:~$ man ls
SYNOPSIS
ls [OPTION]… [FILE]…

DESCRIPTION
List information about the FILEs (the current directory by default).  Sort entries alphabeti‐
cally if none of -cftuvSUX nor –sort is specified.

Mandatory arguments to long options are mandatory for short options too.

-a, –all
do not ignore entries starting with .

-A, –almost-all
do not list implied . and ..

–author
with -l, print the author of each file

-b, –escape
print C-style escapes for nongraphic characters

  • The man pages can be very difficult to read so we can use another tool info.
    Sometimes you have a better description which the info command. Some info pages are quite hard to read as well like man pages do. The best way is to try the differences between them and search the best suitable.
    Let’s guide us trough a info page about man.
    Type info man + enter.
    (below a incomplete info page displayed)
    Press q to exit info list!

anne@alfa:~$ info man
MAN(1)                        Manual pager utils                        MAN(1)

NAME
man – an interface to the on-line reference manuals

SYNOPSIS
man  [-C  file]  [-d]  [-D]  [–warnings[=warnings]]  [-R encoding] [-L
locale] [-m system[,...]] [-M path] [-S list]  [-e  extension]  [-i|-I]
[--regex|--wildcard]   [--names-only]  [-a]  [-u]  [--no-subpages]  [-P
pager] [-r prompt] [-7] [-E encoding] [--no-hyphenation] [--no-justifi‐
cation]  [-p  string]  [-t]  [-T[device]]  [-H[browser]] [-X[dpi]] [-Z]
[[section] page …] …
man -k [apropos options] regexp …
man -K [-w|-W] [-S list] [-i|-I] [--regex] [section] term …
man -f [whatis options] page …
man -l [-C file] [-d] [-D] [–warnings[=warnings]]  [-R  encoding]  [-L
locale]  [-P  pager]  [-r  prompt]  [-7] [-E encoding] [-p string] [-t]
[-T[device]] [-H[browser]] [-X[dpi]] [-Z] file …
man -w|-W [-C file] [-d] [-D] page …
man -c [-C file] [-d] [-D] page …
man [-hV]

DESCRIPTION
man is the system’s manual pager. Each page argument given  to  man  is
normally  the  name of a program, utility or function.  The manual page
associated with each of these arguments is then found and displayed.

  • We can use another feature named apropos. This act as a search engine for man pages and descriptions.
    Here you’ll find a long alphabetic list.
    First we have performed the command whatis apropos to verify it’s meaning. Let’s use the option ls.
    Type apropos + ls + enter.
    (below a incomplete aprops list displayed)

anne@alfa:~$ whatis apropos
apropos (1)          – search the manual page names and descriptions

anne@alfa:~$ apropos ls
alsamixer (1)        – soundcard mixer for ALSA soundcard driver, with ncurses interface
amidi (1)            – read from and write to ALSA RawMIDI ports
amixer (1)           – command-line mixer for ALSA soundcard driver
aplay (1)            – command-line sound recorder and player for ALSA soundcard driver
arecord (1)          – command-line sound recorder and player for ALSA soundcard driver
aseqdump (1)         – show the events received at an ALSA sequencer port
aseqnet (1)          – ALSA sequencer connectors over network
assert (3)           – abort the program if assertion is false
auth_destroy (3)     – library routines for remote procedure calls
authnone_create (3)  – library routines for remote procedure calls
authunix_create (3)  – library routines for remote procedure calls
authunix_create_default (3) – library routines for remote procedure calls
backtrace_symbols (3) – support for application self-debugging
backtrace_symbols_fd (3) – support for application self-debugging
blockdev (8)         – call block device ioctls from the command line

  • Some command has more than one man page available.
    In this example we’ll use the uname option. Here are two man pages available.
    Type man -f uname.

anne@alfa:~$ man -f uname
uname (1)            – print system information
uname (2)            – get name and information about current kernel
anne@alfa:~$

  • We know there are two uname man pages available. Let’s discover man page 2. Section 1 will be displayed as default when you execute man uname.
    You must insert the section between man and the option you like. In this example we’ll use  (command) man + (section) 2 + (option) uname.
    (below a incomplete uname (2) man page displayed)
    Press q to leave man page.
    Type man + 2 + uname + enter.

anne@alfa:~$ man 2 uname
UNAME(2)                            Linux Programmer’s Manual                            UNAME(2)

NAME
uname – get name and information about current kernel

SYNOPSIS
#include <sys/utsname.h>

int uname(struct utsname *buf);

DESCRIPTION
uname() returns system information in the structure pointed to by buf.  The utsname struct
is defined in <sys/utsname.h>:

struct utsname {
char sysname[];    /* Operating system name (e.g., “Linux”) */
char nodename[];   /* Name within “some implementation-defined
network” */
char release[];    /* Operating system release (e.g., “2.6.28”) */
char version[];    /* Operating system version */
char machine[];    /* Hardware identifier */
#ifdef _GNU_SOURCE
char domainname[]; /* NIS or YP domain name */
#endif
};

  • Try another option traceroute. In this example you’ll have two man pages available.
    Type man -f traceroute

anne@alfa:~$ man -f traceroute
tcptraceroute (8)    – print the route packets trace to network host
traceroute (1)       – print the route packets trace to network host
anne@alfa:~$

  • Now we’re able to search help items we’ll discover important information.
    Very useful for system administrators and people who’re interested how the system looks like.
    Let’s start the simple way to get used to it.
    Let’s show the date.

    Type date + enter.

anne@alfa:~$ date
Sat Oct 26 20:21:50 CEST 2013
anne@alfa:~$

  • If you preference the calendar format use the cal command.
    Type cal + enter.

anne@alfa:~$ cal
October 2013
Su Mo Tu We Th Fr Sa
1  2  3  4  5
6  7  8  9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

anne@alfa:~$

  • How long is our system running? Use command uptime.
    This command is measured at 20:47:49  and you can see our system is running about 2:51 hours.
    Notice 2 users are logged, one user is myself and the other one is the root user on the background.
    Type Uptime + enter.

anne@alfa:~$ uptime
20:47:49 up  2:51,  2 users,  load average: 0.00, 0.03, 0.05
anne@alfa:~$

  • I’m interested in the login history off all users. This can be useful by system administrators to see what happens by users.
    To reveal interested information about last  you can view the last info page.
    Let’s look who has logged into the system by using the command last.
    Type last + enter.

anne@alfa:~$ last
anne         pts/0                :0.0                           Wed Oct 30 12:04   still logged in
anne         tty7                  :0                               Wed Oct 30 12:04   still logged in
(unknown tty7                :0                              Wed Oct 30 12:04 – 12:04  (00:00)
reboot   system boot  3.2.0-4-amd64       Wed Oct 30 12:04 – 14:25  (02:20)
anne        pts/0                :0.0                           Tue Oct 29 23:27 – 01:02  (01:35)
root         pts/1                :0.0                           Tue Oct 29 23:18 – 23:19  (00:01)
anne        pts/0                :0.0                           Tue Oct 29 23:15 – 23:17  (00:01)
anne        pts/0                :0.0                           Tue Oct 29 14:56 – 19:22  (04:26)
anne        tty7                   :0                              Tue Oct 29 14:41 – 01:05  (10:23)
(unknown tty7                :0                              Tue Oct 29 14:40 – 14:41  (00:01)

  • Let’s take a look at het system properties. We can use the uname command.
    What’s uname? Execute whatis command and let’s find out  what the uname commmand does.
    Type uname + enter.

anne@alfa:~$ whatis uname
uname (1)            – print system information
uname (2)            – get name and information about current kernel
anne@alfa:~$ uname
Linux
anne@alfa:~$

  • View uname help page to reveal more options.
    Type uname –help + enter.

anne@alfa:~$ uname –help
Usage: uname [OPTION]…
Print certain system information.  With no OPTION, same as -s.

-a, –all                print all information, in the following order,
except omit -p and -i if unknown:
-s, –kernel-name        print the kernel name
-n, –nodename           print the network node hostname
-r, –kernel-release     print the kernel release
-v, –kernel-version     print the kernel version
-m, –machine              print the machine hardware name
-p, –processor            print the processor type or “unknown”
-i, –hardware-platform  print the hardware platform or “unknown”
-o, –operating-system   print the operating system
–help     display this help and exit
–version  output version information and exit

Report uname bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/&gt;
General help using GNU software: <http://www.gnu.org/gethelp/&gt;
For complete documentation, run: info coreutils ‘uname invocation’
anne@alfa:~$

  • We have a lot of options available so let’s try it and see which information will appears.
    In my opinion you can get the best information while using the -a option.
    Below a example with all options used.
    Type uname + option + enter.

anne@alfa:~$ uname -a
Linux alfa 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux
anne@alfa:~$ uname -s
Linux
anne@alfa:~$ uname -n
alfa
anne@alfa:~$ uname -r
3.2.0-4-amd64
anne@alfa:~$ uname -v
#1 SMP Debian 3.2.51-1
anne@alfa:~$ uname -m
x86_64
anne@alfa:~$ uname -p
unknown
anne@alfa:~$ uname -i
unknown
anne@alfa:~$ uname -o
GNU/Linux

  • Here another interesting option which give us more information.
    In the past we’ve discussed the ls command used to display contents of directories and files.

    We can use the ls command to gather more system information.
    We will discuss only the most useful options here. To show ls options available by pressing the tab twice.
    You can see the available ls options below.
    Type ls + two times tab key.

anne@alfa:~$ ls
ls           lsattr       lsblk        lsb_release  lscpu        lsinitramfs  lsmod        lsof         lspci        lspgpot      lsusb
anne@alfa:~$ ls

  • At this moment your prompt shows ls. The lsattr command will display attributes of your working directory.
    Be aware this can be a very long list when your working directory is / ( root directory ).
    In this example is our home directory displayed.
    You must complete the ls command as followed.
    Type attr + enter.

anne@alfa:~$ ls
ls           lsattr       lsblk        lsb_release  lscpu        lsinitramfs  lsmod        lsof         lspci        lspgpot      lsusb
anne@alfa:~$ lsattr
————-e– ./Pictures
————-e– ./Downloads
————-e– ./Public
————-e– ./Desktop
————-e– ./Templates
————-e– ./Videos
————-e– ./Documents
————-e– ./Music
anne@alfa:~$

  • At this time after your first ls command executed your prompt is showed without ls. Now you need to type the whole command.
    If you want know how you disk looks like.
    Here you can see how many partitions you have. Notice the CD-Rom.
    Type lsblk + enter.

anne@alfa:~$ lsblk
NAME  MAJ : MIN RM     SIZE RO TYPE MOUNTPOINT
sr0         11:0     1         1024M  0 rom
sda          8:0      0             20G  0 disk
├─sda1   8:1     0          19.1G  0 part /
├─sda2   8:2     0                1K  0 part
└─sda5   8:5     0           880M  0 part [SWAP]
anne@alfa:~$

  • What kind of processor is installed in your computer.
    I you are interested about the properties, this command will show up technical information.
    Type lscpu + enter.

anne@alfa:~$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 30
Stepping:              5
CPU MHz:               1537.347
BogoMIPS:              3074.69
L1d cache:             32K
L1d cache:             32K
L2d cache:             6144K
NUMA node0 CPU(s):     0
anne@alfa:~$

  • I’m interested how many memory is used by the system.The default free command will display the information in KB format.
    If you want it in a human readable manner you must use the -h after your free command.
    Type free -h + enter.

anne@alfa:/$ free -h
total       used         free  shared    buffers     cached
Mem:              1.0G       776M      226M           0B         58M        424M
-/+ buffers/cache:       293M      709M
Swap:              879M          0B      879M
anne@alfa:/$

  • Last but not least the top command. System processes displayed in real time.
    Have you seen enough you can leave top by pressing q.
    (A imcomplete top page displayed)
    Type top + enter.

anne@alfa:/$ top

top – 19:16:30 up  4:36,  2 users,  load average: 0.01, 0.03, 0.05
Tasks: 125 total,   1 running, 124 sleeping,   0 stopped,   0 zombie
%Cpu(s):  8.4 us,  1.0 sy,  0.0 ni, 90.6 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:   1027016 total,   808760 used,   218256 free,    60336 buffers
KiB Swap:   901116 total,        0 used,   901116 free,   440620 cached

  PID USER      PR  NI      VIRT     RES     SHR S     %CPU    %MEM      TIME+      COMMAND
2181 root        20   0      196m   65m    6092 S       2.3           6.5       1:29.23      Xorg
3253 anne      20    0     411m    24m     14m S      2.3            2.4       0:08.86      gnome-panel
3612 anne      20   0      306m    16m     10m S      1.0            1.7       0:15.53      gnome-terminal
3243 anne      20   0      366m    13m    9116 S       0.7           1.3       0:03.35      metacity
3127 anne      20   0      202m    10m    7768 S       0.3           1.0       0:00.64      x-session-manag
3282 anne      20   0      192m    9748   4428 S       0.3            0.9      0:00.23      tracker-store

  • Now we can do stuff what most people do, create, move, copy, delete folders and files.
    Now we’re able to advice many help functions in this magnificent system.
    As we’ve promised you to make a guide about move, create, change permissions etc…of directories and files.
    We’ll discuss this subject later on.
    We hope you enjoyed it and we’ll be back soon to guide us through the new chapter, management directories and files.
    Have a nice time -;)
About these ads

2 Responses to Important built-in information in Debian Wheezy 7 system.

  1. Pingback: Applications and commando’s locations Debian Wheezy 7 | Gnu Bizz 2

  2. Pingback: Locaties van Programma’s en Commando’s, Debian Wheezy 7. | Gnu Bizz

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: