Linux basic configurations - linux commands http://basicconfig.com/taxonomy/term/3 en Linux find command basic tutorial http://basicconfig.com/linux-command/linux-find-command-basic-tutorial <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>The Linux find command is perhaps the most powerful command for finding files in the Linux system. However, it is quite complicated. For a Linux beginner, first they need to understand the command's expressions before they can properly use the command. This tutorial will help a new Linux user to understand the basic expressions through simple examples.</p> <p>Here are some important basic Linux find command's expressions that a Linux beginner should notes:</p> <ul><li>-print - Produce output.</li> <li>-name - Matches filename based on the pattern provided.</li> <li>-perm - Find files with certain permission.</li> <li>-type - Find files with special file type.</li> <li>-size - Find files based on file size.</li> <li>-atime, ctime, mtime - Find files based on file times.</li> <li>-exec - Executing command.</li> </ul><h2>Linux find command's expressions example</h2> <p>Originally, the find command does not produce output by itself. You need to include the '<b>-print</b>' expression to creates output or print output to the screen. For example, the command 'find . -print' will create output of the current directory's files and folders paths to the screen. But now you can get the same output by just invoking the 'find' command alone. It's because if no expression is given, the expression -print is used.</p> <p>The '<b>-name</b>' expression is used to find file matches the pattern that we provide as an argument to the expression. A simple example is to provide the name of the file as an argument such as 'find . -name tutorial', where the <b>tutorial</b> is the argument. We can also use wildcard with ordinary characters to find files easier. Here are the wildcard patterns explanation:</p> <ul><li>? - Matches any single character.</li> <li>* - Matches multiple characters.</li> <li>[] - Matches any single character in the bracket.</li> </ul><p>Here is an example of Linux find command with -name expression:</p> <table><tr><td><code>kkcjlab@kkcjlab-server:~$ <span style="color:red;">find . -name *[Aai]dm?n</span><br /> ./Documents/basicconfig/images/phpmyadmin<br /> ./Documents/kkcj/sites/default/files/imagepicker/k/kepalaadmin<br /> ./Documents/kursus-perniagaan-internet/sources/joomla/releases/Joomla_1.5.14-Stable-Full_Package/administrator/components/com_admin<br /> ./Documents/lapor-kerosakan/admin<br /> ./Pictures/keratan-akhbar/kepalaadmin<br /></code></td> </tr></table><p>The Linux find command above will print all files that have 'Admxn', 'admxn' or 'idmxn' characters in the pattern mentioned (the [Aai] did this). The 'x' character can be any ordinary character because we used the '?' wildcard which will matches any single character. The asterisk(*) means to accept any characters match before the pattern.</p> <p>The Linux find's -perm expression is used to find files with certain permission. For example, we can find all world writable files using the following syntax:</p> <table><tr><td><code>kkcjlab@kkcjlab-server:~$ <span style="color:red;">find /home/kkcjlab/backup -perm -0002</span><br /> /home/kkcjlab/backup/basicconfig/files<br /> /home/kkcjlab/backup/basicconfig/fixfiles.php<br /> kkcjlab@kkcjlab-server:~$<br /></code></td> </tr></table><p>Another important Linux find's expression is the -type expression which can be used to find files with special file type. Here is an example of -type expression's usage:</p> <table><tr><td><code>kkcjlab@kkcjlab-server:~$ <span style="color:red;">find /home/kkcjlab -type d -perm -0002</span><br /> /home/kkcjlab/backup/basicconfig/files<br /></code></td> </tr></table><p>The -type d flag represents directory. If you want to search for files, use f flag.</p> <p>The next Linux find command's expression is the -size expression. The -size expression is useful when we want to find files with specific size. What we have to do is give a size file number in k, M or G after the -size expression. See an example below:</p> <table><tr><td><code>kkcjlab@kkcjlab-server:~$ <span style="color:red;">find Documents/basicconfig/ -size +100k</span><br /> Documents/basicconfig/backup/drupal-6.16/includes/common.inc<br /> Documents/basicconfig/backup/drupal-6.16/modules/system/system.install<br /> Documents/basicconfig/backup/modules/update_status/screenshot.png<br /> Documents/basicconfig/backup/modules/imagepicker/imagepicker.module<br /> Documents/basicconfig/images/phpmyadmin/04-security-check.JPG<br /> kkcjlab@kkcjlab-server:~$<br /></code></td> </tr></table><p>Where:</p> <table><tr><td><code>‘k’ - for Kilobytes (units of 1024 bytes)<br /> ‘M’ - for Megabytes (units of 1048576 bytes)<br /> ‘G’ - for Gigabytes (units of 1073741824 bytes)<br /></code></td> </tr></table><p>Basiccally, there are three expressions that you can use with Linux find command to check timestamps stored in a file. Those expressions are -atime, -ctime and -mtime.</p> <table><tr><td><code> -atime n<br /> File was <b>last accessed</b> n*24 hours ago. When find figures out<br /> how many 24-hour periods ago the file was last accessed, any<br /> fractional part is ignored, so to match -atime +1, a file has to<br /> have been accessed at least two days ago.<br /><br /> -ctime n<br /> File’s status was <b>last changed</b> n*24 hours ago. See the comments<br /> for -atime to understand how rounding affects the interpretation<br /> of file status change times.<br /><br /> -mtime n<br /> File’s data was <b>last modified</b> n*24 hours ago. See the comments<br /> for -atime to understand how rounding affects the interpretation<br /> of file modification times.<br /></code></td> </tr></table><p>Here are examples of Linux find command's syntax using -atime, -ctime and -mtime expression to search for files based on time:</p> <table><tr><td><code>kkcjlab@kkcjlab-server:~$ <span style="color:red;">find Documents/basicconfig/ -atime +364</span><br /> Documents/basicconfig/backup/views/views_ui.info<br /> Documents/basicconfig/backup/views/README.txt<br /> Documents/basicconfig/backup/views/go-down.png<br /> Documents/basicconfig/backup/views/LICENSE.txt<br /></code></td> </tr></table><p>The Linux find command above shows files that haven't been accessed more than a year in the basicconfig directory.</p> <table><tr><td><code>kkcjlab@kkcjlab-server:~$ <span style="color:red;">find Documents/basicconfig -ctime -7</span><br /> Documents/basicconfig<br /> Documents/basicconfig/articles<br /> Documents/basicconfig/articles/ubuntu-ftp-client-guide.php~<br /> Documents/basicconfig/articles/linux-find-command-basic.php~<br /> Documents/basicconfig/articles/ubuntu-ftp-client-guide.php<br /> Documents/basicconfig/articles/setup-configure-drupal-website.php~<br /> Documents/basicconfig/articles/setup-configure-drupal-website.php<br /> Documents/basicconfig/articles/linux-find-command-basic.php<br /></code></td> </tr></table><p>The Linux find command above shows files in the given directory that had status change in one week.</p> <table><tr><td><code>kkcjlab@kkcjlab-server:~$ <span style="color:red;">find Documents/basicconfig -name linux* -mtime -3</span><br /> Documents/basicconfig/articles/linux-find-command-basic.php~<br /> Documents/basicconfig/articles/linux-find-command-basic.php<br /> kkcjlab@kkcjlab-server:~$<br /></code></td> </tr></table><p>The Linux find command above shows how to find files older than 3 days.</p> <p>Now the final Linux find command's expression that we are going learn is the -exec expression. The -exec expression is used to run or execute a Linux command. For example, we want the Linux find command to search for some backup files that no longer needed and delete them when each file is found.</p> <table><tr><td><code>kkcjlab@kkcjlab-server:~$ <span style="color:red;">find Documents/basicconfig -name linux*.php~ -mtime -7 -exec rm {} \;</span><br /></code></td> </tr></table><p>That's all. All examples and expressions above are some basic Linux find command's usage. There are so many things that you can do with the command. This tutorial is just an introduction to the Linux find command. With the basic knowledge, you can read find command's manual to learn other expressions and what else the command can do.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/3" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux commands</a></div></div></div> Sun, 08 Aug 2010 04:47:31 +0000 jinlusuh 63 at http://basicconfig.com http://basicconfig.com/linux-command/linux-find-command-basic-tutorial#comments Change user or substitute user in command line terminal using Linux su command http://basicconfig.com/linux-command/change-user-substitute-user-command-line-terminal-using-linux-su-command <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>The Linux su command is often use when performing administrative task in Linux system. Linux system administrator or Linux user do not use root as a personal account. When a certain task needs root privilege, then the Linux su command, which is used to substitute user, become useful. The Linux su command allows user to switch to other UID and GID from the command line terminal. Here is a description and synopsis from su manual page:</p> <table><tr><td><code>NAME<br /> su - change user ID or become superuser<br /><br /> SYNOPSIS<br /> su [options] [username]<br /></code></td> </tr></table><p>When invoking su command with no option, user are switching to root by default. Here is the example:</p> <table><tr><td><code>kkcjlab@ubuntu-server:~$ <span style="color:red;">su</span><br /> Password:<br /> su: Authentication failure<br /> kkcjlab@ubuntu-server:~$<br /></code></td> </tr></table><p>You need to provide the correct password for the user account you are switching to. You'll get the root environment when you successfully enter the correct password as in the su command example below:</p> <table><tr><td><code>kkcjlab@ubuntu-server:~$ <span style="color:red;">su</span><br /> Password:<br /><span style="color:blue;">root</span>@ubuntu-server:/home/kkcjlab#<br /></code></td> </tr></table><p>If we want to substitute user or switch to other user id, use Linux su command with username switch. Here is the example on how to use su command to substitute user in Linux command line terminal:</p> <table><tr><td><code>root@ubuntu-server:/home/kkcjlab# <span style="color:red;">su jimi</span><br /><span style="color:blue;">jimi</span>@ubuntu-server:/home/kkcjlab$<br /></code></td> </tr></table><p>You don't have to provide user password if you are root. If you are using your personal account (normal user account), you have to provide the correct password for the user account that you are switching to. Here is the su command example if you are switching to another user from a normal user account:</p> <table><tr><td><code>kkcjlab@ubuntu-server:~$ <span style="color:red;">su jimi</span><br /> Password:<br /><span style="color:blue;">jimi</span>@ubuntu-server:/home/kkcjlab$<br /></code></td> </tr></table><p>You can use 'exit' command or simply press 'Ctrl+D' combination keys to switch back to your account when you finished doing your job. Here is the example on how to end session and return to your user account:</p> <table><tr><td><code>jimi@ubuntu-server:/home/kkcjlab$ <span style="color:red;">exit</span><br /><span style="color:blue;">kkcjlab</span>@ubuntu-server:~$<br /></code></td> </tr></table><p>That's all.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/3" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux commands</a></div></div></div> Mon, 23 Nov 2009 03:33:42 +0000 jinlusuh 62 at http://basicconfig.com http://basicconfig.com/linux-command/change-user-substitute-user-command-line-terminal-using-linux-su-command#comments Linux top command tutorial http://basicconfig.com/linux-troubleshoot/linux-top-command-tutorial <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Linux top command is a great tool to monitor Linux performances and troubleshoot Linux problem. It is available in default Ubuntu and Slackware installation. We can view a dynamic real-time view of a running system using top command. What you have to do is just type 'top' in the Linux command line terminal and press enter to see top command prints a table of Linux processes and system summary.</p> <p>Here is an example of top command screenshot:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/top-command-screenshot.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/top-command-screenshot.png" alt="Linux top command screenshot image" /></a></p> <p>A default top command prints:</p> <ul><li>Summary Area.</li> <li>Message/Prompt Line.</li> <li>Columns Header.</li> <li>Task Area.</li> </ul><p>There are 2 basic commands that you can use when top program is running:</p> <ul><li>h - to view helps available.</li> <li>q - to quit top program.</li> </ul><p>You can also use '?' to view help and press 'ctrl+c' keys combination to stop running top program.</p> <p>Here is an example of Linux top command help page:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/top-command-help.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/top-command-help.png" alt="Image" /></a></p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/3" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux commands</a></div></div></div> Sat, 07 Nov 2009 12:57:35 +0000 jinlusuh 65 at http://basicconfig.com http://basicconfig.com/linux-troubleshoot/linux-top-command-tutorial#comments Linux vmstat command tutorial http://basicconfig.com/linux-troubleshoot/linux-vmstat-command-tutorial <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Linux vmstat command is a useful tool for monitoring performance in Linux system. It comes standard in Ubuntu and Slackware installation. We can get information about virtual memory(vmstat is a short form of virtual memory) and some other things such as Linux processes, cpu activity and block IO.</p> <p>Here is the Linux vmstat command synopsis from the manual page:</p> <table><tr><td><code>SYNOPSIS<br /> vmstat [-a] [-n] [delay [ count]]<br /> vmstat [-f] [-s] [-m]<br /> vmstat [-S unit]<br /> vmstat [-d]<br /> vmstat [-p disk partition]<br /> vmstat [-V]<br /></code></td> </tr></table><p>Let's see some options(switch) available with vmstat command and examples of the command's output.</p> <p>Linux vmstat command with '-a' option runs in Ubuntu Linux:</p> <table><tr><td><code>root@ubuntu:~# <span style="color:red;">vmstat -a</span><br /> procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----<br /> r b swpd free inact active si so bi bo in cs us sy id wa<br /> 2 0 7376 6228 19944 326180 0 0 19 9 162 345 4 1 94 1<br /></code></td> </tr></table><p>The -a option displays active/inactive memory average values since boot. Here are the meaning of all columns:</p> <p>The 'procs' field has 2 columns:</p> <ul><li>r - The number of processes waiting for run time.</li> <li>b - The number of processes in uninterruptible sleep (blocked processes).</li> </ul><p>The 'memory' field has 4 columns:</p> <ul><li>swpd - The amount of used swap space(virtual memory) used.</li> <li>free - The amount of idle memory(free RAM).</li> <li>inact - The amount of inactive memory.</li> <li>active - The amount of active memory.</li> </ul><p>The 'swap' field has 2 columns:</p> <ul><li>si - Amount of memory swapped in from disk (/s).</li> <li>so - Amount of memory swapped to disk (/s).</li> </ul><p>The 'io' field has 2 columns:</p> <ul><li>bi - Blocks received from a block device (blocks in).</li> <li>bo - Blocks sent to a block device (blocks out).</li> </ul><p>The 'system' field has 2 columns:</p> <ul><li>in - The number of interrupts per second, including the clock (System interrupts).</li> <li>cs - The number of context switches per second (Process context switches).</li> </ul><p>The 'cpu' field has only 4 columns:</p> <ul><li>us: Time spent running non-kernel code. (user time, including nice time).</li> <li>sy: Time spent running kernel code. (system time).</li> <li>id: Time spent idle.</li> <li>wa: Time spent waiting for IO.</li> </ul><p>We can also use vmstat command with '-a' combined with other options such as in the first command synopsis. See example below:</p> <table><tr><td><code>root@ubuntu:~# <span style="color:red;">vmstat -a -n 10 3</span><br /> procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----<br /> r b swpd free inact active si so bi bo in cs us sy id wa<br /> 6 0 10560 7060 20192 324916 0 1 16 8 156 331 3 1 95 1<br /> 1 0 10560 7052 20176 324956 0 0 0 4 117 206 0 0 100 0<br /> 0 0 10560 7052 20200 324956 0 0 0 4 119 213 0 0 100 0<br /> root@ubuntu:~#<br /></code></td> </tr></table><p>The vmstat example above means we want it to <b>delay</b> 10 seconds before the next update and <b>count</b> the update 3 times. The '-n' option is used so that the header does not displayed in every update.</p> <p>Linux vmstat command with '-f' option runs in Ubuntu Linux:</p> <table><tr><td><code>root@ubuntu:~# <span style="color:red;">vmstat -f</span><br /> 10109 forks<br /></code></td> </tr></table><p>The -f option prints the number of forks since boot.</p> <p>Linux vmstat command with '-s' option runs in Ubuntu Linux:</p> <table><tr><td><code>root@ubuntu:~# <span style="color:red;">vmstat -s</span><br /> 504628 K total memory<br /> 497548 K used memory<br /> 325892 K active memory<br /> 19284 K inactive memory<br /> 7080 K free memory<br /> 9812 K buffer memory<br /> 80136 K swap cache<br /> 995988 K total swap<br /> 12512 K used swap<br /> 983476 K free swap<br /> 104488 non-nice user cpu ticks<br /> 321 nice user cpu ticks<br /> 27624 system cpu ticks<br /> 2521995 idle cpu ticks<br /> 22965 IO-wait cpu ticks<br /> 240 IRQ cpu ticks<br /> 1121 softirq cpu ticks<br /> 0 stolen cpu ticks<br /> 349578 pages paged in<br /> 204564 pages paged out<br /> 309 pages swapped in<br /> 3378 pages swapped out<br /> 4377716 interrupts<br /> 9386803 CPU context switches<br /> 1257512796 boot time<br /> 10114 forks<br /></code></td> </tr></table><p>The -s option prints a table of various event counters and memory statistics.</p> <p>Linux vmstat command with '-m' option runs in Ubuntu Linux:</p> <table><tr><td><code>root@ubuntu:~# <span style="color:red;">vmstat -m</span><br /> Cache Num Total Size Pages<br /> RAWv6 23 23 704 23<br /> TCPv6 24 24 1344 12<br /> ext3_inode_cache 2994 4448 496 16<br /> ext3_xattr 0 0 48 85<br /> journal_handle 340 340 24 170<br /> journal_head 147 219 56 73<br /> revoke_record 512 512 16 256<br /> kmalloc_dma-512 16 16 512 16<br /> sgpool-128 24 24 2560 12<br /> sgpool-64 24 24 1280 12<br /> sgpool-32 24 24 640 12<br /> scsi_io_context 0 0 104 39<br /> fuse_request 21 21 376 21<br /> fuse_inode 18 18 448 18<br /> flow_cache 0 0 80 51<br /> mqueue_inode_cache 14 14 576 14<br /> hugetlbfs_inode_cache 23 23 344 23<br /> dquot 0 0 128 32<br /> shmem_inode_cache 5146 5148 448 18<br /> xfrm_dst_cache 24 24 320 12<br /> TCP 26 26 1216 13<br /> Cache Num Total Size Pages<br /> blkdev_queue 39 39 1200 13<br /> blkdev_requests 48 80 200 20<br /> biovec-256 10 10 3072 10<br /> biovec-128 23 42 1536 21<br /> biovec-64 44 63 768 21<br /> sock_inode_cache 588 588 384 21<br /> file_lock_cache 78 78 104 39<br /> Acpi-Operand 1713 1734 40 102<br /> taskstats 24 24 328 12<br /> page_cgroup 87220 87890 24 170<br /> proc_inode_cache 68 176 368 22<br /> sigqueue 56 56 144 28<br /> radix_tree_node 2273 3432 296 13<br /> bdev_cache 32 32 512 16<br /> sysfs_dir_cache 14684 14705 48 85<br /> inode_cache 285 805 344 23<br /> dentry 9863 15660 136 30<br /> buffer_head 3948 4224 64 64<br /> mm_struct 626 630 448 18<br /> vm_area_struct 13378 13570 88 46<br /> files_cache 125 147 384 21<br /> Cache Num Total Size Pages<br /> signal_cache 160 168 576 14<br /> sighand_cache 146 156 1344 12<br /> task_struct 250 260 3216 10<br /> anon_vma 4846 4864 16 256<br /> idr_layer_cache 595 598 152 26<br /> kmalloc-4096 176 184 4096 8<br /> kmalloc-2048 358 368 2048 16<br /> kmalloc-1024 320 336 1024 16<br /> kmalloc-512 1256 1280 512 16<br /> kmalloc-256 105 112 256 16<br /> kmalloc-128 759 832 128 32<br /> kmalloc-64 4155 4480 64 64<br /> kmalloc-32 1587 1664 32 128<br /> kmalloc-16 3621 3840 16 256<br /> kmalloc-8 6638 6656 8 512<br /> kmalloc-192 5902 5985 192 21<br /> kmalloc-96 625 672 96 42<br /> root@ubuntu:~#<br /></code></td> </tr></table><p>The -m displays slabinfo.</p> <p>Linux vmstat command with '-S' option runs in Ubuntu Linux:</p> <table><tr><td><code>root@ubuntu:~# <span style="color:red;">vmstat -S K</span><br /> procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----<br /> r b swpd free buff cache si so bi bo in cs us sy id wa<br /> 1 0 12528 5960 11592 79112 0 0 12 7 163 347 4 1 94 1<br /> root@ubuntu:~# vmstat -S M<br /> procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----<br /> r b swpd free buff cache si so bi bo in cs us sy id wa<br /> 2 0 12 5 11 77 0 0 12 7 163 347 4 1 94 1<br /> root@ubuntu:~#<br /></code></td> </tr></table><p>The -S followed by k or K or m or M option outputs between 1000, 1024, 1000000, or 1048576 bytes.</p> <p>Linux vmstat command with '-d' option runs in Ubuntu Linux:</p> <table><tr><td><code>root@ubuntu:~# <span style="color:red;">vmstat -d</span><br /> disk- ------------reads------------ ------------writes----------- -----IO------<br /> total merged sectors ms total merged sectors ms cur sec<br /> ram0 0 0 0 0 0 0 0 0 0 0<br /> ram1 0 0 0 0 0 0 0 0 0 0<br /> ram2 0 0 0 0 0 0 0 0 0 0<br /> ram3 0 0 0 0 0 0 0 0 0 0<br /> ram4 0 0 0 0 0 0 0 0 0 0<br /> ram5 0 0 0 0 0 0 0 0 0 0<br /> ram6 0 0 0 0 0 0 0 0 0 0<br /> ram7 0 0 0 0 0 0 0 0 0 0<br /> ram8 0 0 0 0 0 0 0 0 0 0<br /> ram9 0 0 0 0 0 0 0 0 0 0<br /> ram10 0 0 0 0 0 0 0 0 0 0<br /> ram11 0 0 0 0 0 0 0 0 0 0<br /> ram12 0 0 0 0 0 0 0 0 0 0<br /> ram13 0 0 0 0 0 0 0 0 0 0<br /> ram14 0 0 0 0 0 0 0 0 0 0<br /> ram15 0 0 0 0 0 0 0 0 0 0<br /> sr0 0 0 0 0 0 0 0 0 0 0<br /> sda 26829 10390 699300 289056 27979 25655 429144 2716764 0 207<br /> sda1 117 695 4186 852 134 3272 27256 4012 0 3<br /> sda2 3 0 6 120 0 0 0 0 0 0<br /> sda3 13846 5123 546682 139176 8400 3794 97608 18872 0 75<br /> disk- ------------reads------------ ------------writes----------- -----IO------<br /> total merged sectors ms total merged sectors ms cur sec<br /> sda4 12775 3796 146464 147852 19445 18589 304280 2693880 0 148<br /> sda5 67 758 1650 692 0 0 0 0 0 0<br /> root@ubuntu:~#<br /></code></td> </tr></table><p>The -d reports disk statistics. Here is the meaning of all the columns available in each field:</p> <p>Reads:</p> <ul><li>total: Total reads completed successfully</li> <li>merged: grouped reads (resulting in one I/O)</li> <li>sectors: Sectors read successfully</li> <li>ms: milliseconds spent reading</li> </ul><p>Writes:</p> <ul><li>total: Total writes completed successfully</li> <li>merged: grouped writes (resulting in one I/O)</li> <li>sectors: Sectors written successfully</li> <li>ms: milliseconds spent writing</li> </ul><p>IO:</p> <ul><li>cur: I/O in progress</li> <li>s: seconds spent for I/O</li> </ul><p>That's all.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/3" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux commands</a></div></div></div> Fri, 06 Nov 2009 15:06:32 +0000 jinlusuh 64 at http://basicconfig.com http://basicconfig.com/linux-troubleshoot/linux-vmstat-command-tutorial#comments Linux alias command tutorial http://basicconfig.com/linux-command/linux-alias-command-tutorial <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>The Linux alias command is another utility to make working in Linux command line easier. We can make an alias for a long Linux command with options and arguments to a simple command. The alias command is very useful for a Linux system administrator which has lots of routine jobs such as checking log files, clean hard disk space, and so on. Let's see some examples of alias command and the usage.</p> <p>If you ever used Red Hat Linux in the past and now using Slackware or Ubuntu, you probably miss the 'll' command which is a short command for 'ls -l'. If you like the 'll' command and prefer to have it in your Slackware or Ubuntu, you can have it using the Linux alias command. Here is the example on how to create an alias of 'ls -l' command to 'll':</p> <table><tr><td><code>root@ubuntu-server:~# <span style="color:red;">alias ll='ls -l'</span><br /></code></td> </tr></table><p>Test it now to see if it works:</p> <table><tr><td><code>root@ubuntu-server:~# <span style="color:red;">ll</span><br /> total 4<br /> -rwxr-xr-x 1 root root 77 2009-10-26 17:36 test.sh<br /></code></td> </tr></table><p>You can check other alias which comes default with your Linux distribution:</p> <table><tr><td><code>root@ubuntu-server:~# <span style="color:red;">alias</span><br /> alias ll='ls -l'<br /> alias ls='ls --color=auto'<br /></code></td> </tr></table><p>Create how many alias you need especially the most used command with many options.</p> <p>If you need to remove any alias, you can do that with the 'unalias' command. Here is the example:</p> <table><tr><td><code>root@ubuntu-server:~# <span style="color:red;">unalias ll</span><br /> root@ubuntu-server:~# <span style="color:red;">alias</span><br /> alias ls='ls --color=auto'<br /> root@ubuntu-server:~#<br /></code></td> </tr></table><p>You can also personalize your Linux environment using Linux alias command and put all aliases you add in a file. What you need to do is edit the Alias section in the <b>.bashrc</b> file. If you are using Ubuntu Desktop, here is an example of .bashrc file and how to edit the Alias section in the file:</p> <p>Open .bashrc file with text editor of your choice. Here is an example on how to use vim text editor to edit the file:</p> <table><tr><td><code>kkcjlab@ubuntu-desktop:~$ <span style="color:red;">sudo vim .bashrc</span><br /></code></td> </tr></table><p>Find the Alias section and uncomment the line in red below:</p> <table><tr><td><code># Alias definitions.<br /> # You may want to put all your additions into a separate file like<br /> # ~/.bash_aliases, instead of adding them here directly.<br /> # See /usr/share/doc/bash-doc/examples in the bash-doc package.<br /><br /><span style="color:red;">if [ -f ~/.bash_aliases ]; then<br /> . ~/.bash_aliases<br /> fi</span><br /><br /> # enable color support of ls and also add handy aliases<br /> if [ -x /usr/bin/dircolors ]; then<br /> eval "`dircolors -b`"<br /> alias ls='ls --color=auto'<br /> #alias dir='dir --color=auto'<br /> #alias vdir='vdir --color=auto'<br /><br /> #alias grep='grep --color=auto'<br /> #alias fgrep='fgrep --color=auto'<br /> #alias egrep='egrep --color=auto'<br /> fi<br /><br /> # some more ls aliases<br /> #alias ll='ls -l'<br /> #alias la='ls -A'<br /> #alias l='ls -CF'<br /></code></td> </tr></table><p>Save the changes and quit text editor.</p> <p>Create a new file called <i>.bash_aliases</i>.</p> <table><tr><td><code>kkcjlab@ubuntu-desktop:~$ <span style="color:red;">sudo vim .bash_aliases</span><br /></code></td> </tr></table><p>In the new file, add aliases that you want and save. The changes will take effect the next time you open command line terminal.</p> <p>That's all.</p> <p>Back to <a href="/linux-basic-commands-tutorial">Other important Linux basic commands </a>main page.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/3" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux commands</a></div></div></div> Mon, 02 Nov 2009 04:19:30 +0000 jinlusuh 61 at http://basicconfig.com http://basicconfig.com/linux-command/linux-alias-command-tutorial#comments Linux kill command tutorial http://basicconfig.com/linux-commands/linux-kill-command-tutorial <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Linux kill command sends signal to a Linux process. Particularly useful signals include HUP, INT, KILL, STOP, CONT, and 0. Alternate signals may be specified in three ways: -9, -SIGKILL, -KILL. That's what you can read from the Linux kill command manual page. If you don't quite understand what those descriptions are, here is a simple explanation for you. Every Linux user needs to learn the Linux kill command because it is particularly used to terminate Linux process(Linux process or Linux daemon). It is the same as the Windows task manager, where it is used to terminate a hanged program, zombie or any process that we don't need.</p> <p>The Linux kill command synopsis:</p> <table><tr><td><code> kill [ -signal | -s signal ] pid ...<br /> kill [ -L | -V, --version ]<br /> kill -l [ signal ]<br /></code></td> </tr></table><p>The Linux kill -L and -V options give invalid signal specification in Ubuntu. It doesn't matter, we do not need them anyway.</p> <p>We can use '-l' option to check signal that kill command can sends to a process. Here are some examples of <b>kill -l</b> option command:</p> <table><tr><td><code>root@kkcjlab-server:~# kill -l 1<br /> HUP<br /> root@kkcjlab-server:~# kill -l 2<br /> INT<br /> root@ubuntu-server:~# kill -l 3<br /> QUIT<br /> root@ubuntu-server:~# kill -l 4<br /> ILL<br /> root@ubuntu-server:~# kill -l 5<br /> TRAP<br /> root@ubuntu-server:~# kill -l 6<br /> ABRT<br /> root@ubuntu-server:~# kill -l 7<br /> BUS<br /> root@ubuntu-server:~# kill -l 8<br /> FPE<br /> root@ubuntu-server:~# kill -l 9<br /> KILL<br /> root@ubuntu-server:~# kill -l 0<br /> T<br /></code></td> </tr></table><p>The most important Linux kill command syntax is the 'kill [ -signal | -s signal ] pid ...' where you can use the kill command to send the signal to the Linux process. The 'pid' in the command syntax is the 'process id' of the Linux process which we want to send the signal to. Here we need a little help from the Linux ps command. You can learn more about Linux ps command from <a href="/linux/process" target="_blank">Introduction to Linux process and daemons</a> tutorial.</p> <p>To understand how to use Linux kill command to terminate unwanted process, let's see a step by step example. First, open a new command line terminal, for example the tty2. Login as a normal user and run 'w3m <a href="http://www.basicconfig.com">www.basicconfig.com</a>' at the command prompt to open a web browser in Linux command line terminal.</p> <p>Now switch back to terminal 1 or whatever terminal you originally login from and type 'ps aux | grep tty2' at the command prompt. See example command and result below:</p> <table><tr><td><code>root@ubuntu-server:~# <span style="color:red;">ps aux | grep tty2</span><br /> root 2197 0.0 0.0 3028 1616 tty2 Ss 08:23 0:00 /bin/login --<br /> jimi 14088 0.0 0.0 5884 3160 tty2 S 16:09 0:00 -bash<br /> jimi 14424 0.0 0.1 8360 4300 tty2 S+ 16:10 0:00 w3m www.basicconfig.com<br /> root 14552 0.0 0.0 3340 808 pts/0 S+ 16:11 0:00 grep tty2<br /></code></td> </tr></table><p>The most important thing here is the second column which is the pid column. Now that we already know the pid, we can send signal using kill command to the process that we want to kill. To send a KILL signal to a process, we can use signal 9 (see kill -l example above). Let's say we need to terminate w3m process from tty2 which is hang, for example. From the ps result above, we can see that the w3m pid is 14424. The complete command to terminate the process is 'kill 9 14424'. See example below:</p> <table><tr><td><code>root@kkcjlab-server:~# <span style="color:red;">kill 9 14424</span><br /> root@kkcjlab-server:~# ps aux | grep tty2<br /> root 2197 0.0 0.0 3028 1616 tty2 Ss 08:23 0:00 /bin/login --<br /> jimi 14088 0.0 0.0 5884 3164 tty2 S+ 16:09 0:00 -bash<br /> root 14909 0.0 0.0 3340 808 pts/0 S+ 16:22 0:00 grep tty2<br /></code></td> </tr></table><p>If you want to see more examples of Linux kill command in action, the <a href="/linux/kill" target="_blank">Stop and terminate hang program in Linux</a> tutorial shows some simple real life examples.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/3" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux commands</a></div></div></div> Wed, 21 Oct 2009 06:30:27 +0000 jinlusuh 60 at http://basicconfig.com http://basicconfig.com/linux-commands/linux-kill-command-tutorial#comments Linux dmesg command tutorial http://basicconfig.com/linux-commands/linux-dmesg-command-tutorial <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>'dmesg' command is used to examine or control the kernel ring buffer. The program helps users to print out their bootup messages. Instead of copying the messages by hand, the user need only: </p> <p> <strong>dmesg &gt; boot.messages </strong></p> <p> and mail the boot.messages file to whoever can debug their problem.</p> <p>If you want to go through the message line by line, try dmesg with this option:</p> <p> <strong>dmesg | less</strong></p> <p>or you can use 'grep' to pick up what you need. For example:</p> <p><strong>dmesg | grep hd</strong></p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/3" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux commands</a></div></div></div> Sun, 27 Sep 2009 09:30:43 +0000 jinlusuh 59 at http://basicconfig.com http://basicconfig.com/linux-commands/linux-dmesg-command-tutorial#comments Linux w command tutorial http://basicconfig.com/linux-commands/linux-w-command-tutorial <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>The Linux w command shows who is logged on in Linux system and what they are doing. Its function is identical to the Linux who command but the w command output provides more detail than who command.</p> <h2>Linux w command syntax</h2> <p>Here is the Linux command syntax:</p> <table><tr><td><code> w -husfVo user<br /></code></td> </tr></table><p>The '-husfVo' is the w command's options while the 'user' is the username of the Linux user that we want to check.</p> <p>Here is the meaning of the w command options:</p> <table><tr><td><code> -h skip header<br /> -l long listing (default)<br /> -s short listing<br /> -u ignore uid of processes<br /> -f toggle FROM field (default on)<br /> -o old-style output<br /> -V display version<br /></code></td> </tr></table><h2>Linux w command examples</h2> <p>Now that you already know the Linux w command syntax, it's time to see some real examples on how to run the command in the Linux command line terminal.</p> <p>Here is the Linux w command example with no option supplied running in Ubuntu desktop command terminal:</p> <table><tr><td><code>kucing@ubuntu-laptop:~$ <span style="color:red;">w</span><br /> 09:15:10 up 43 min, 2 users, load average: 0.74, 0.38, 0.24<br /> USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT<br /> kucing tty7 :0 08:32 43:15m 57.73s 0.18s x-session-manager<br /> kucing pts/0 :0.0 08:48 0.00s 0.24s 0.00s w<br /></code></td> </tr></table><p>The following entries are displayed when issuing the Linux w command: USER (login name), TTY (terminal name), FROM (the remote host), LOGIN@ (login time), IDLE (idle time), JCPU, PCPU, and WHAT (the command line of their current process).</p> <p>The JCPU is the time used by all processes attached to the tty. It does not include past background jobs, but does include currently running background jobs.</p> <p>The PCPU is the time used by the current process, named in the "WHAT" field.</p> <p>Here is the Linux w command example with '<b>-h</b>' option supplied running in Ubuntu desktop command terminal:</p> <table><tr><td><code>kucing@ubuntu-laptop:~$ <span style="color:red;">w -h</span><br /> kucing tty7 :0 08:32 1:13 1:32m 0.18s x-session-manager<br /> kucing pts/0 :0.0 08:48 0.00s 0.26s 0.00s w -h<br /></code></td> </tr></table><p>As you can see in the example above, the result of '<em>w -h</em>' command is the same as w command with no option except that this time there is no header entries including the summary.</p> <p>Here is the Linux w command example with '<b>-l</b>' option supplied running in Ubuntu desktop command terminal:</p> <table><tr><td><code>kucing@ubuntu-laptop:~$ <span style="color:red;">w -l</span><br /> 09:51:15 up 1:19, 2 users, load average: 0.00, 0.04, 0.08<br /> USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT<br /> kucing tty7 :0 08:32 1:19 1:40m 0.18s x-session-manager<br /> kucing pts/0 :0.0 08:48 0.00s 0.28s 0.00s w<br /></code></td> </tr></table><p>The result of '<em>w -l</em>' command is the exactly the same as the w command without any option. The '<em>w -l</em>' is used if no option supplied with the Linux w command. That's why there is no '-l' option in the w command manual page.</p> <p>Here is the Linux w command example with '<b>-s</b>' option supplied running in Ubuntu desktop command terminal:</p> <table><tr><td><code>kucing@ubuntu-laptop:~$ <span style="color:red;">w -s</span><br /> 09:58:25 up 1:26, 2 users, load average: 0.47, 0.40, 0.22<br /> USER TTY FROM IDLE WHAT<br /> kucing tty7 :0 1:26 x-session-manager<br /> kucing pts/0 :0.0 0.00s w -s<br /></code></td> </tr></table><p>The command '<em>w -s</em>' result shows only USER, TTY, FROM, IDLE and WHAT entries.</p> <p>Here is the Linux w command example with '<b>-u</b>' option supplied running in Ubuntu desktop command terminal. The command '<em>w -u</em>' suppose to not print the USER entry if we switch user to root and run the command but it does not happens. See example below:</p> <table><tr><td><code>kucing@ubuntu-laptop:~$ <span style="color:red;">sudo su</span><br /> root@ubuntu-laptop:/home/kucing# <span style="color:red;">w -u</span><br /> 10:09:21 up 1:37, 3 users, load average: 0.00, 0.07, 0.11<br /> USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT<br /> root tty2 - 10:07 2:07m 0.24s 0.02s -bash<br /> kucing tty7 :0 08:32 1:37 2:10m 0.18s x-session-manager<br /> kucing pts/0 :0.0 08:48 0.00s 0.34s 5.88s gnome-terminal<br /></code></td> </tr></table><p>Here is the Linux w command example with '<b>-f</b>' option supplied running in Ubuntu desktop command terminal:</p> <table><tr><td><code>kucing@ubuntu-laptop:~$ <span style="color:red;">w -f</span><br /> 10:17:34 up 1:45, 3 users, load average: 0.85, 0.37, 0.19<br /> USER TTY LOGIN@ IDLE JCPU PCPU WHAT<br /> root tty2 10:07 10:20m 0.24s 0.02s -bash<br /> kucing tty7 08:32 1:45 2:19m 0.18s x-session-manager<br /> kucing pts/0 08:48 0.00s 0.36s 6.52s gnome-terminal<br /></code></td> </tr></table><p>The result shows that the FROM (remote hostname) field is removed from the result when issuing '<em>w -u</em>' command.</p> <p>Here is the Linux w command example with '<b>-o</b>' option supplied running in Ubuntu desktop command terminal. Below it is the default w command with no option example so we can compare the results:</p> <table><tr><td><code>kucing@ubuntu-laptop:~$ <span style="color:red;">w -o</span><br /> 10:23:46 up 1:51, 3 users, load average: 0.01, 0.18, 0.17<br /> USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT<br /> root tty2 - 10:07 16:32m -bash<br /> kucing tty7 :0 08:32 1:51 2:28m x-session-manager<br /> kucing pts/0 :0.0 08:48 w -o<br /> kucing@ubuntu-laptop:~$ <span style="color:red;">w</span><br /> 10:23:58 up 1:52, 3 users, load average: 0.00, 0.18, 0.17<br /> USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT<br /> root tty2 - 10:07 16:44m 0.24s 0.02s -bash<br /> kucing tty7 :0 08:32 1:52 2:28m 0.18s x-session-manager<br /> kucing pts/0 :0.0 08:48 0.00s 0.34s 0.00s w<br /></code></td> </tr></table><p>The result shows the different between '<em>w -o</em>' command and '<em>w</em>' command in the JCPU and PCPU fields. The old format prints blank space for idle times less than one minute.</p> <p>The command '<em>w -s</em>' result shows only USER, TTY, FROM, IDLE and WHAT entries.</p> <p>Here is the Linux w command example if we want to check certain user in the Linux system:</p> <table><tr><td><code>kucing@ubuntu-laptop:~$ <span style="color:red;">w root</span><br /> 11:18:42 up 2:46, 3 users, load average: 0.66, 0.22, 0.13<br /> USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT<br /> root tty2 - 10:07 1:11 0.24s 0.02s -bash<br /> kucing@ubuntu-laptop:~$ <span style="color:red;">w kucing</span><br /> 11:19:23 up 2:47, 3 users, load average: 0.78, 0.30, 0.16<br /> USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT<br /> kucing tty7 :0 08:32 2:47 3:19m 0.18s x-session-manager<br /> kucing pts/0 :0.0 08:48 0.00s 0.34s 0.00s w kucing<br /></code></td> </tr></table><p>Finally, here is the Linux w command with '<b>-V</b>' option which will print the version as in the example below:</p> <table><tr><td><code>kucing@ubuntu-laptop:~$ <span style="color:red;">w -V</span><br /> procps version 3.2.7<br /></code></td> </tr></table><p>That's all.</p> <p>Back to <a href="/linux-basic-commands-tutorial">Other important Linux basic commands </a>main page.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/3" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux commands</a></div></div></div> Sun, 27 Sep 2009 09:27:26 +0000 jinlusuh 58 at http://basicconfig.com http://basicconfig.com/linux-commands/linux-w-command-tutorial#comments Linux pwd command tutorial http://basicconfig.com/linux-commands/linux-pwd-command-tutorial <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>The pwd command is used quite often in the Unix command line environment where the shell doesn't show the name of the working directory. Type 'pwd' in the command line will print the name of current/working directory. In Linux, where bash is the default shell, we can always see what directory we are in. The name of the current directory is shown at the command prompt after the host name. See the example below:</p> <table><tr><td><code> bill@slackware:<span style="color:red;">~</span>$<br /></code></td> </tr></table><p>The '~' shows our current directory is the user's home directory. We can confirm that with the Linux pwd command:</p> <table><tr><td><code> bill@slackware:~$ pwd<br /> /home/bill<br /></code></td> </tr></table><p>Now let's change to another directory:</p> <table><tr><td><code> bill@slackware:~$<br /> bill@slackware:~$ cd /home/ftp<br /> bill@slackware:<span style="color:red;">/home/ftp</span>$<br /></code></td> </tr></table><p>When we change the directory to /home/ftp directory, the '~' has changed to our current directory. If we check again with Linux pwd command, we would get the result as in the example below:</p> <table><tr><td><code> bill@slackware:~$ <span style="color:#FF0000;"> pwd </span><br /> /home/ftp<br /></code></td> </tr></table><p>The Linux pwd command doesn't have any other option except for '-LP' which will print the same result as example above. If you open the pwd manual page, there are no '-L' or '-P' options. The supplied options '--help' and '--version' options would give you '<b>invalid option</b>' when used with pwd command in Ubuntu desktop such as in the example below:</p> <table><tr><td><code> kucing@ubuntu-laptop:~$ <span style="color:#FF0000;">pwd --help</span><br /> bash: pwd: --: invalid option<br /> pwd: usage: pwd [-LP]<br /></code></td> </tr></table><p>That's all.</p> <p>Back to <a href="/linux-basic-commands-tutorial">Other important Linux basic commands</a> main page.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/3" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux commands</a></div></div></div> Sun, 27 Sep 2009 09:22:21 +0000 jinlusuh 57 at http://basicconfig.com http://basicconfig.com/linux-commands/linux-pwd-command-tutorial#comments Linux users command tutorial http://basicconfig.com/linux-commands/linux-users-command-tutorial <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>The Linux <b>users</b> command is a useful tool to monitor users in Linux system. When invoking the 'users' command with no option, it prints the user names of users currently logged in to the current Linux system. The Linux users command output who is currently logged in according to 'file', by default using the /var/run/utmp if 'file' is not specified.</p> <p>This is the Linux users command syntax:</p> <table><tr><td><code>users [OPTION]... [ FILE ]<br /></code></td> </tr></table><p>Here is an example on how to run Linux users command with no option in Slackware:</p> <table><tr><td><code>bill@slackware:~$ <span style="color:#FF0000;">users</span><br /> bill root <br /> bill@slackware:~$<br /></code></td> </tr></table><p>The result shows two Linux users currently login to the system. One is a user with login name 'bill' and the other one is 'root'.</p> <p>Here is an example on how to run Linux users command with FILE specified in Ubuntu:</p> <table><tr><td><code>kucing@ubuntu:~$ <span style="color:#FF0000;">users /var/log/wtmp</span><br /> kucing kucing<br /></code></td> </tr></table><p>That's all for now.</p> <p>Back to <a href="/linux-basic-commands-tutorial">Other important Linux basic commands</a> main page.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/3" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux commands</a></div></div></div> Sun, 27 Sep 2009 09:17:54 +0000 jinlusuh 56 at http://basicconfig.com http://basicconfig.com/linux-commands/linux-users-command-tutorial#comments