HowtoForge - Linux Howtos in English English|HowtoForge.de - Linux-Howtos auf Deutsch Deutsch

Shell

Useful Commands For The Linux Command Line

Submitted by Eldmannen (Contact Author) (Forums) on Fri, 2007-03-09 17:49. :: Linux | Shell

Useful Commands For The Linux Command Line

This short guide shows some important commands for your daily work on the Linux command line.

Read more...

How can I observe a logfile continuously?

Submitted by till (Contact Author) (Forums) on Mon, 2006-08-07 17:44. :: Shell

With the command:

tail -f /path/to/logfile

you will see all lines added to the logfile. To stop this, press [CTRL] + cRead more...

How to save a command in the shell history without executing it

Submitted by till (Contact Author) (Forums) on Mon, 2006-08-07 17:42. :: Shell

Enter the command line and hit the keys:

[CTRL] + [#]

This will put a # in front of the command and execute it. The shell will take it as comment.

Read more...

How can I clear the shell window?

Submitted by till (Contact Author) (Forums) on Mon, 2006-08-07 17:40. :: Shell

Use the commad:

clear

or the keyboard shortcut:

[CTRL] + [L]

Read more...

Creating image borders with ImageMagick convert

Submitted by till (Contact Author) (Forums) on Mon, 2006-08-07 17:37. :: Shell

The command is:

convert -border 2x2 old.jpg new.jpg

This creates a new image (new.jpg) with a 2 pixel border from the image old.jpg.

To set the bordercolor to red, use this command:

convert -border 2x2 -bordercolor "#FF0000" old.jpg new.jpg

Read more...

Get a list of the installed services

Submitted by till (Contact Author) (Forums) on Mon, 2006-08-07 17:32. :: Shell

To get a list of the installed services on the shell, you may use this command (on Fedora, RedHat, CentOS, SuSE, and Mandriva):

chkconfig --list

Read more...

Show all processes for a specific user

Submitted by till (Contact Author) (Forums) on Mon, 2006-08-07 17:31. :: Shell

To view only the processes owned by a specific user, use the following command:

top -U [USERNAME]

and replace [USERNAME] with the name of the user.

Read more...

Making snapshots of the process table shown by the TOP command

Submitted by till (Contact Author) (Forums) on Mon, 2006-08-07 17:29. :: Shell

To make a snapshot of the current process table, use the following command:

top -n 1 -b > /tmp/processtable.txt

You can now view the textfile with any text editor, e.g. pico or vi.

Read more...

How do I search for a term in a file?

Submitted by admin (Contact Author) (Forums) on Mon, 2006-08-07 17:27. :: Shell

With the grep command.

If you want to find out if the term user is in /etc/httpd/conf/httpd.conf, you would run

grep -i user /etc/httpd/conf/httpd.conf

(-i makes the search case-insensitive).

Normally grep does not tell you the line number where it finds the term. If you want to find out the line number, run

grep -n -i user /etc/httpd/conf/httpd.conf

Read more...

How do I find out who is logged in on my system?

Submitted by admin (Contact Author) (Forums) on Mon, 2006-08-07 17:23. :: Shell

You can find out about logged in users either by running

who

(Sample output:

server:~# who
root     pts/0        Nov 12 11:28 (192.168.0.202)

)

or

w

which gives more detailed output:

server:~# w
 11:29:49 up  2:19,  1 user,  load average: 0.02, 0.01, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0    192.168.0.202    11:28    0.00s  0.08s  0.01s w
Read more...
1
next page
last page
XML feed
"Facebook" is a registered trademark of Facebook, Inc. All rights reserved.