e-mail   
 Menu
  Home
  Download
  Top 10 Downloads
  Last 15 New Files
  Web Links
  Tips
  Last 15 New Tips
  NLM Programming
  Admins Club





SUPLA System
Internet of Things




Installation and Administration






Polish Forum SUSE


 
Who's Online

 There are currently,
21 guest(s)
that is (are) online.
 


Technical Information

Back to List of Categories

Technical Information about
  A Little YaST Magic
  A Slideshow for Your KDE Wallpaper
  Add Novell Support to Your Firefox Search Engine
  Adding To The Panels In Gnome.
  Akregator - RSS News Reader
  An Introduction to WBEM and OpenWBEM in SUSE LINUX
  Authenticating SUSE LINUX to eDirectory via LDAP
  Basic Mounting Differences between Windows and Linux
  Beginner's Guide to Using Novell SUSE LINUX's Build Utility
  Browsing Files
  Card Readers on SUSE LINUX 9.2 Professional?
  Changing the Default Browser in Gnome
  Developing Perl CGI scripts on SUSE LINUX
  Do I Have Permission?
  Double SYNC -- Using RSYNC Simultaneously With and Without Branch Office for Data Backup
  Dumb Question: Mounting Linux CDs
  Easy Command-Line Introduction
  Easy Way to Debug SSL Connections
  Enabling an Interactive Startup in Novell/SUSE LINUX
  Exploring MySQL 4.1 and PHP 5 on SUSE LINUX
  Extend Your Panels Using Gnome Drawers.
  Firefox Speed Tip
  Fix Java Errors With ConsoleOne On Linux
  Fix Your Mouse Wheel...
  Gimp -- Closing In on Photoshop...
  Gimp Tips Part 1: Resizing Images
  Gimp Tips Part 2: Rounding Corners
  Gimp Tips Part 3: Fading Photography Edges
  Gimp Tips Part 4: Selective Colorization
  Gimp Tips Part 5: Plugins a Plenty - Adding Light
  Gimp Tips Part 6: Using The Clone Tool
  Google Auto-fill Replica for Linux
  How a Corrupted USB Drive Was Saved by GNU/Linux
  How to Implement Login Scripts into a Pure Linux Environment
  How to install and connect an External Modem on a Linux PC
  How to Install the Novell Client for Linux on SUSE Linux 10.0
  How to launch applications at login in Gnome
  How to Remote Control Linux
  How to setup a Linux application to automatically startup when you login.
  How to share Files and Printers Between Linux and MS Windows with Samba
  How to uninstall the Novell Client for Linux
  How to upgrade the Novell Client for Linux
  How to use SMB without turning off the firewall
  How's the Weather?
  HTML Development Tools in Linux
  Informative Bash Prompt
  Install and Use QEMU on SUSE 9.2
  Install Linux Frequently, Without the Hassle
  Installing Apache, PHP, and MySQL on SUSE LINUX Professional
  Installing RPM Files
  Integrating Novell Linux Desktop into a Novell NetWare network
  Introduction to Oracle 10g R1 (10.1.0.3) on SUSE LINUX Professional 9.3
  iPrint Printers on Novell Linux Desktop
  Linux Scheduling Priorities Explained
  Make a Misbehaving Program Quit
  Manually Mounting a USB Flash Drive in Linux
  Migrating To Linux, Advantages Over Windows 9.x And XP
  Minimize Your Maximizing with Multiple Desktops
  Mounting NetWare Volumes On NLD Illustrated
  Move Your /home to Another Computer
  Mozilla Mail Review
  Need a Backup?
  Novell Client Settings with Windows Terminal Server
  Novell Linux Desktop Equivalents of Windows Software - New and Improved
  Novell Linux Desktop System Upgrade How-To
  Partitioning Hard Drive for Linux Install
  Perform Remote SuSE Installations With Virtual Network Computing
  Quick Intro to Klipper
  Quick Shortcuts in The Gimp
  Reset Your Lost Root Password
  Resizing Your Gnome / KDE Panels
  Runlevels in SUSE LINUX
  Running Existing Win32 Applications on SUSE LINUX
  Service Command in /etc/init.d/
  Setting Shortcut Keys
  Setting up a Linux NFS Install Source for Your LAN
  Should I choose Novell Linux Desktop or SUSE LINUX Professional as my desktop?
  Starting Services From the Command Line On SuSE LINUX
  Sticky Notes for Gnome
  SUSE LINUX 9.3 Professional Review
  Sync Up The Taskbar and the Desktop in Gnome
  System Upgrade How-To
  Taking Screenshots in Linux
  The Basics of Messaging in the Cross-Platform GroupWise Client
  The Novell Client for Linux (beta).
  Transparent Panels in Gnome
  Trick Out Your KDE Desktop
  Understanding the YAST Software Module Options
  Updating Your Software with Red Carpet
  Using dsbk on Linux and Unix
  Using iFolder to Synchronize Firefox Bookmarks
  Using Multiple Swap Partitions In 2.4
  Using openSSH to Securely Access Remote Systems
  What FTP client should I use on Linux?
  What Is Logical Volume Management?
  What is so great about Firefox?
  Which Graphic Formats For What?
  Windows Shortcuts for Firefox Tabs on Linux
  Windows to Linux: A Beginner's Guide
  Windows Users Can Feel at Home Exploring Files in Linux
  WLAN interface as the Default
  Work With User Selection Icons In KDM
  YAST Online Update De-Mystified

Technical Information
 Easy Command-Line Introduction

Printer-friendly version

Posted: 9 Feb 2005

Among the many wonders of Linux is the ability to customize how you, individually, like to do things. Many people like the ability to use the mouse to point and click on a graphical interface. This is to say, they like to use a window manager like Gnome or KDE. Another option, however, is to use the command line. Contrary to popular belief, the command line is not difficult to use. In some cases, it takes the complication out of things. I'd like to run through a bunch of common commands. We'll look at what each does and how to use each one.

Find the TERMINAL PROGRAM icon in your Kicker bar and click on it:

This opens your terminal window so you can try these babies out. Also, after you type each command, press the ENTER key to run it. Here is a list of the common commands:

Command: ls

Usage: ls

Explanation: Displays contents of the current directory.

Sample Output:

[1702][smorris@linux:~/home]$ ls
bin  Desktop  Documents  hardware.txt  icons.lst  public_html
[1702][smorris@linux:~/home]$

Command: mkdir

Usage: mkdir <dirname>

Explanation: Makes a subdirectory in the current directory.

Sample Output:

[1702][smorris@linux:~/home]$ mkdir temp
[1808][smorris@linux:~/home]$

Command: rmdir

Usage: rmdir <directory>

Explanation: Removes a directory.

Sample Output:

[1834][smorris@linux:~]$ rmdir temp
[1834][smorris@linux:~]$ 

Command: cd

Usage: cd <new directory>

Explanation: Changes the current directory to a new one.

Sample Output:

[1834][smorris@linux:~]$ cd home
[1834][smorris@linux:~/home]$

Command: pwd

Usage: pwd

Explanation: Shows the present working directory.

Sample Output:

[1808][smorris@linux:~/home]$ pwd
/home/smorris/home
[1825][smorris@linux:~/home]$

Command: cp

Usage: cp <source file> <target file>

Explanation: Copies a file from its current location to somewhere else.

Sample Output:

[1938][smorris@linux:~/home]$ cp hardware.txt mystuff.txt
[1938][smorris@linux:~/home]$

Command: mv

Usage: mv <source file> <target file>

Explanation: Moves a file from its current location to somewhere else.

Sample Output:

[1938][smorris@linux:~/home]$ mv hardware.txt mystuff.txt
[1938][smorris@linux:~/home]$

Command: rm

Usage: rm <filename>

Explanation: Removes a file.

Sample Output:

[1938][smorris@linux:~/home]$ rm mystuff.txt
[1939][smorris@linux:~/home]$

Note: The result of the 'rm' command is permanent. You cannot undo it, so be very careful with this command.

Command: ps

Usage: ps aux

Explanation: Shows a list of the current running processes.

Sample Output:

[1839][smorris@linux:~]$ ps aux
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   596   80 ?        S    Jan27   0:01 init [5]
root         3  0.0  0.0     0    0 ?        S    Jan27   0:02 [events/0]
root         4  0.0  0.0     0    0 ?        S    Jan27   0:00 [khelper]
root         5  0.0  0.0     0    0 ?        S    Jan27   0:00 [netlink/0]
root         6  0.0  0.0     0    0 ?        S    Jan27   0:00 [kacpid]
root        23  0.0  0.0     0    0 ?        S    Jan27   0:19 [kblockd/0]
root        36  0.0  0.0     0    0 ?        S    Jan27   0:00 [aio/0]
root        35  0.0  0.0     0    0 ?        S    Jan27   0:12 [kswapd0]
root       618  0.0  0.0     0    0 ?        S    Jan27   0:00 [kseriod]
root      1643  0.0  0.0     0    0 ?        S    Jan27   0:00 [ata/0]
root      1645  0.0  0.0     0    0 ?        S    Jan27   0:00 [scsi_eh_0]
root      1646  0.0  0.0     0    0 ?        S    Jan27   0:00 [scsi_eh_1]
root      1655  0.0  0.0     0    0 ?        S    Jan27   0:02 [reiserfs/0]
root      2168  0.0  0.0     0    0 ?        S    Jan27   0:00 [khubd]
root      2224  0.0  0.0  1360  256 ?        S    Jan27   0:00 udevd
root      2484  0.0  0.0  1432  320 ?        S    Jan27   0:00 [hwscand]
smorris  14651  0.0  0.3  4248 1840 pts/3    Ss   18:39   0:00 /bin/bash
smorris  14661  0.0  0.1  2372  704 pts/3    R+   18:39   0:00 ps aux
[1839][smorris@linux:~]$

Note: You will see much more output than this. I had to cut it off because it was too long to put all of it here.

Command: kill

Usage: kill <process id>

Explanation: Terminates a process.

Sample Output:

[1848][smorris@linux:~]$ kill 14988
[1848][smorris@linux:~]$ 

Note: The process ID can be found using the 'ps' command, above.

Command: uptime

Usage: uptime

Explanation: Shows how long it has been since the computer was last rebooted.

Sample Output:

[1848][smorris@linux:~]$ uptime
  6:54pm  up 11 days 21:36,  4 users,  load average: 0.10, 0.14, 0.10
[1854][smorris@linux:~]$

Command: date

Usage: date

Explanation: Shows the current system time and date.

Sample Output:

[1854][smorris@linux:~]$ date
Tue Feb  8 19:20:07 CST 2005
[1920][smorris@linux:~]$

Command: ifconfig

Usage: /sbin/ifconfig

Explanation: Shows your IP address and network adapter information.

Sample Output:

[1825][smorris@linux:~/home]$ /sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0B:DB:C5:E1:AC
          inet addr:192.168.0.106  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20b:dbff:fec5:e1ac/64 Scope:Link
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2911835 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1878982 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2017894151 (1924.4 Mb)  TX bytes:199806447 (190.5 Mb)
          Base address:0xdf40 Memory:feae0000-feb00000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2499998 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2499998 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:584776793 (557.6 Mb)  TX bytes:584776793 (557.6 Mb)

[1827][smorris@linux:~/home]$

Note: Look at the second line. After the 'inet addr:' there is a group of numbers and periods. This is the IP address. In this example, the IP address is 192.168.0.106.

Command: ping

Usage: ping <host or ip>

Explanation: Sends a small signal to a remote server, which answers. This is very useful for testing an Internet connection.

Sample Output:

[1827][smorris@linux:~/home]$ ping google.com
PING google.com (216.239.39.99) 56(84) bytes of data.
64 bytes from 216.239.39.99: icmp_seq=1 ttl=239 time=32.1 ms
64 bytes from 216.239.39.99: icmp_seq=2 ttl=239 time=32.4 ms
64 bytes from 216.239.39.99: icmp_seq=3 ttl=239 time=33.0 ms
64 bytes from 216.239.39.99: icmp_seq=4 ttl=239 time=33.5 ms

--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 32.103/32.792/33.556/0.577 ms
[1832][smorris@linux:~/home]$

Note: To stop the pinging, press CTRL+C.

Command: top

Usage: top

Explanation: Displays a report of the currently running processes. This report updates every 3 seconds.

Sample Output:

top - 18:45:24 up 11 days, 21:27,  4 users,  load average: 0.11, 0.07, 0.08
Tasks: 121 total,   2 running, 119 sleeping,   0 stopped,   0 zombie
Cpu(s):  2.6% us,  0.8% sy,  0.0% ni, 94.8% id,  1.5% wa,  0.3% hi,  0.0% si
Mem:    514496k total,   509096k used,     5400k free,    75768k buffers
Swap:  1959920k total,   277912k used,  1682008k free,   143512k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
17509 root      16   0  204m  56m 146m R  1.7 11.3  21:33.88 X
13480 smorris   16   0 36696  23m  29m S  0.7  4.6   0:12.08 kate
14650 smorris   15   0 30364  14m  26m S  0.2  2.9   0:00.62 konsole
17647 smorris   16   0 50016  26m  34m S  0.1  5.3   2:25.75 kicker
 8616 smorris   15   0 66588  38m  32m S  0.1  7.6   0:33.73 firefox-bin
 8371 lp        16   0  6876 1420 3740 S  0.0  0.3   1:54.78 cupsd
17640 smorris   15   0 27720  12m  24m S  0.0  2.4   0:44.25 kwin
17644 smorris   15   0 25440 9648  23m S  0.0  1.9   0:03.80 khotkeys
    1 root      16   0   596   80  452 S  0.0  0.0   0:01.33 init
    2 root      34  19     0    0    0 S  0.0  0.0   0:04.60 ksoftirqd/0
    3 root       5 -10     0    0    0 S  0.0  0.0   0:02.77 events/0
    4 root       5 -10     0    0    0 S  0.0  0.0   0:00.02 khelper
    5 root       5 -10     0    0    0 S  0.0  0.0   0:00.06 netlink/0
    6 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 kacpid
   23 root       5 -10     0    0    0 S  0.0  0.0   0:19.39 kblockd/0
   36 root       6 -10     0    0    0 S  0.0  0.0   0:00.00 aio/0
   35 root      15   0     0    0    0 S  0.0  0.0   0:12.40 kswapd0
  618 root      24   0     0    0    0 S  0.0  0.0   0:00.00 kseriod
 1643 root       6 -10     0    0    0 S  0.0  0.0   0:00.00 ata/0

Note: Press SHIFT+M to sort by memory. Press SHIFT+P to sort by CPU usage. Press CTRL+C to exit.

There are many, many commands that I could have listed here. These are some of the basic everyday ones. For a more in-depth look at using the command line, there are many tutorial sites available, such as this one.






Since 2003

Portal posiada akceptację firmy Novell Polska
Wszystkie materiały dotyczące produktów firmy Novell umieszczono za zgodą Novell Polska
Portal has been accepted by the Novell Polska
All materials concerning products of Novell firm are placed with Novell Polska consent.
NetWare is a registered trademark of Novell Inc. in the United States and other countries.
Windows is a trademark or a registered trademark of Microsoft Corporation in the United States and other countries.
Sybase is a registered trademark of Sybase Inc. in the United States of America.
Other company and product names are trademarks or registered trademarks of their respective owners.