0% found this document useful (0 votes)
48 views

Linux Shortcuts and Commands

This document provides concise summaries of 3 or fewer sentences for 12 essential Linux shortcuts and commands: 1. Linux essential shortcuts and sanity commands such as switching between terminals and GUI screens, autocompleting commands, scrolling terminal output, and resetting terminals. 2. Common Linux commands such as printing the working directory, host name, user ID, system date and time, memory and disk usage, CPU and interrupt information. 3. Notes on Linux case sensitivity, file naming conventions, directory structure, and comment lines in configuration files.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

Linux Shortcuts and Commands

This document provides concise summaries of 3 or fewer sentences for 12 essential Linux shortcuts and commands: 1. Linux essential shortcuts and sanity commands such as switching between terminals and GUI screens, autocompleting commands, scrolling terminal output, and resetting terminals. 2. Common Linux commands such as printing the working directory, host name, user ID, system date and time, memory and disk usage, CPU and interrupt information. 3. Notes on Linux case sensitivity, file naming conventions, directory structure, and comment lines in configuration files.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 12

Linux Shortcuts and Commands

This is a practical selection of the commands we use most often. Press <Tab> to see the listing of all available
command (on your PATH). On my small home system, it says there are 2595 executables on my PATH. Many
of these "commands" can be accessed from your favourite GUI front-end (probably KDE or Gnome) by
clicking on the right menu or button. They can all be run from the command line. Programs that require
GUI have to be run from a terminal opened under a GUI.

Legend:
<> = single special or function key on the keyboard. For example <Ctrl> indicates the "control" key.
italic = name of the file or variable you probably want to substitute with your own.
fixed width = in-line Linux commands and filenames.

Notes for the UNIX Clueless:


1. LINUX IS CASE-SENSITIVE. For example: Netscape, NETSCAPE and nEtscape are three different
commands. Also my_filE, my_file, and my_FILE are three different files. Your user login name and password
are also case sensitive. (This goes with the tradition of UNIX and the "c" programming language being case
sensitive.)
2. Filenames can be up to 256 characters long and can contain letters, numbers, "." (dot), "_" (underscore),
"-" (dash), plus some other not recommended characters.
3. Files with names starting with "." are normally not shown by the ls (list) or dir commands. Think of these
files as "hidden". Use ls -a (list with the option "all") to see these files.
4. "/" is an equivalent to DOS "\" (root directory, meaning the parent of all other directories).
5. Under Linux, all directories appear under a single directory tree (there are no DOS-style drive letters).
6. In a configuration file, a line starting with # is a comment.

1 Linux essential shortcuts and running on terminals


8 to 12, but you can run another server there.
sanity commands
<Tab>
<Ctrl><Alt><F1> (In a text terminal) Autocomplete the command if
Switch to the first text terminal. Under Linux you there is only one option, or else show all the
can have several (6 in standard setup) terminals available options.
opened at the same time. THIS SHORTCUT IS GREAT! It even works at LILO
prompt!
<Ctrl><Alt><Fn> (n=1..6)
Switch to the nth text terminal. <ArrowUp>
Scroll and edit the command history. Press <Enter>
tty to execute.
Print the name of the terminal in which you are
typing this command. <Shift><PgUp>
Scroll terminal output up. Work also at the login
<Ctrl><Alt><F7>
prompt, so you can scroll through your bootup
Switch to the first GUI terminal (if X-windows is
messages.
running on this terminal).
<Shift><PgDown>
<Ctrl><Alt><Fn> (n=7..12)
Scroll terminal output down.
Switch to the nth GUI terminal (if a GUI terminal is
running on screen n-1). On default, nothing is
<Ctrl><Alt><+> reset
(in X-windows) Change to the next X-server Restore a screwed-up terminal (a terminal showing
resolution (if you set up the X-server to more than funny characters) to default setting. Use if you tried
one resolution). For multiple resolutions on my to "cat" a binary file. You may not be able to see the
standard SVGA card/monitor, I have the following command as you type it.
line in the file /etc/X11/XF86Config (the first resolution
<MiddleMouseButton>
starts on default, the largest determines the size of
the "virtual screen"): Paste the text which is currently highlighted
Modes "1024x768" "800x600" "640x480" "512x384" somewhere else. This is the normal "copy-paste"
"480x300" "400x300" "1152x864" operation in Linux. (It doesn't work with Netscape
and WordPerfect which use the MS Windows-style
<Ctrl><Alt><-> "copy-paste". It does work in the text terminal if you
(in X-windows) Change to the previous X-server enabled "gpm" service using "setup".) Best used
resolution. with a Linux-ready 3-button mouse (Logitech or
similar) or else set "3-mouse button emulation").
<Ctrl><Alt><BkSpc>
(in X-windows) Kill the current X-windows server. ~
Use if the X-windows server crushes and cannot be (tilde) My home directory (normally the directory
exited normally. /home/my_login_name). For example, the command cd
~/my_dir will change my working directory to the
<Ctrl><Alt><Del> subdirectory "my_dir" under my home directory.
Shut down the system and reboot. This is the Typing just "cd" alone is an equivalent of the
normal shutdown command for a user at the text- command "cd ~".
mode console. Don't just press the "reset" button
for shutdown! .
(dot) Current directory. For example, ./my_program
<Ctrl>c will attempt to execute the file "my_program"
Kill the current process (mostly in the text mode for located in your current working directory.
small applications).
..
<Ctrl>d (two dots) Directory parent to the current one. For
Log out from the current terminal. See also the example, the command cd .. will change my current
next command. working directory one one level up.
<Ctrl>d
Send [End-of-File] to the current process. Don't 2 Common Linux commands
press it twice else you also log out (see the previous
command). pwd
Print working directory, i.e., display the name of my
<Ctrl>s current directory on the screen.
Stop the transfer to the terminal.
hostname
<Ctrl>q Print the name of the local host (the machine on
Resume the transfer to the terminal. Try if your which you are working). Use netconf (as root) to
terminal mysteriously stops responding. change the name of the machine.

<Ctrl>z whoami
Send the current process to the background. Print my login name.

exit id username
Logout. I can also use logout for the same effect. (If Print user id (uid) and his/her group id (gid),
you have started a second shell, e.g., using bash the effective id (if different than the real id) and the
second shell will be exited and you will be back in supplementary groups.
the first shell, not logged out.)
date uname -a
Print or change the operating system date and time. (= Unix name with option "all") Info on your (local)
E.g., I could change the date and time to 2000-12- server. I can also use guname (in X-window terminal)
31 23:57 using this command: to display the info more nicely.
date 123123572000
To set the hardware (BIOS) clock from the system free
(Linux) clock, use the command (as root) setclock Memory info (in kilobytes).

time df -h
Determine the amount of time that it takes for a (=disk free) Print disk info about all the filesystems
process to complete + other info. Don't confuse it (in human-readable form)
with the date command. E.g. I can find out how long
it takes to display a directory content using: du / -bh | more
time ls (=disk usage) Print detailed disk usage for each
subdirectory starting at the "/" (root) directory (in
who human legible form).
Determine the users logged on the machine.
cat /proc/cpuinfo
rwho -a Cpu info--it show the content of the file cpuinfo.
(=remote who) Determine all users logged on your Note that the files in the /proc directory are not real
network. The rwho service must be enabled for this files--they are hooks to look at information available
command to run. If it isn't, run setup as root to to the kernel.
enable "rwho".
cat /proc/interrupts
finger user_name List the interrupts in use.
System info about a user. Try: finger root
cat /proc/version
last Linux version and other info
Show listing of users last logged-in on your system.
cat /proc/filesystems
history | more Show the types of filesystems currently in use.
Show the last (1000 or so) commands executed
from the command line on the current account. The cat /etc/printcap
"| more" causes the display to stop after each Show the setup of printers.
screenful.
lsmod
uptime (As root. Use /sbin/lsmod to execute this command
Show the amount of time since the last reboot. when you are a non-root user.) Show the kernel
modules currently loaded.
ps
(=print status) List the processes currently run by set|more
the current user. Show the current user environment.

ps axu | more echo $PATH


List all the processes currently running, even those Show the content of the environment variable
without the controlling terminal, together with the "PATH". This command can be used to show other
name of the user that owns each process. environment variables as well. Use "set" to see the
full environment.
top
Keep listing the currently running processes, sorted dmesg | less
by cpu usage (top users first). In KDE, you can get Print kernel messages (the content of the so-called
GUI-based Ktop from "K"menu under kernel ring buffer). Press "q" to quit "less". Use
"System"-"Task Manager" (or by executing "ktop" in less /var/log/dmesg to see what "dmesg" dumped into
an X-terminal). this file right after the last system bootup.
3 Basic operations copy a subdirectory under my current working
directory to my home directory.
any_command --help |more
mcopy source destination
Display a brief help on a command (works with
Copy a file from/to a DOS filesystem (no mounting
most commands). "--help" works similar to DOS
necessary). E.g., mcopy a:\autoexec.bat ~/junk . See man
"/h" switch. The "more" pipe is needed if the output
mtools for related commands: mdir, mcd, mren,
is longer than one screen.
mmove, mdel, mmd, mrd, mformat ....
man topic
mv source destination
Display the contents of the system manual pages
Move or rename files. The same command is used
(help) on the topic. Try man man first. Press "q" to
for moving and renaming files and directories.
quit the viewer. The command info topic works
similar and may contain more up-to-date ln source destination
information. Manual pages can be hard to read. Try Create a hard link called destination to the file
any_command --help for short, easy to digest help on a called source. The link appears as a copy of the
command. If more info needed, have a look to the original files, but in reality only one copy of the file
directory /usr/doc. To display manual page from a is kept, just two (or more) directory entries point to
specific section, I may use something like in this it. Any changes the file are automatically visible
example: man 3 exit (this displays an info on the throughout. When one directory entry is removed,
command exit from section 3 of the manual pages). the other(s) stay(s) intact. The limitation of the hard
links are: the files have to be on the same
apropos topic
filesystem, hard links to directories or special files
Give me the list of the commands that have
are impossible.
something to to do with my topic.
ln -s source destination
help command
Create a symbolic (soft) link called "destination" to
Display brief info on a bash (shell) build-in
the file called "source". The symbolic link just
command.
specifies a path where to look for the file. In
ls contradistinction to hard links, the source and
List the content of the current directory. Under destination don't not have to tbe on the same
Linux, the command "dir" is an alias to ls. Many filesystem. In comparison to hard links, the
users have "ls" to be an alias to "ls --color". drawback of symbolic links are: if the original file is
removed, the link is "broken", symbolic links can
ls -al |more also create circular references (like circular
List the content of the current directory, all files references in spreadsheets or databases, e.g., "a"
(also those starting with a dot), and in a long form. points to "b" and "b" points back to "a").
Pipe the output through the "more" command, so
that the display pauses after each screenful. rm files
Remove (delete) files. You must own the file in
cd directory order to be able to remove it. On many systems,
Change directory. Using "cd" without the directory you will be asked or confirmation of deleation, if
name will take you to your home directory. "cd -" you don't want this, use the "-f" (=force) option,
will take you to your previous directory and is a e.g., rm -f * will remove all files in my current
convenient way to toggle between two directories. working directory, no questions asked.
"cd .." will take you one directory up.
mkdir directory
cp source destination Make a new directory.
Copy files. E.g., cp /home/stan/existing_file_name .will
copy a file to my current working directory. Use the rmdir directory
"-r" option (for recursive) to copy the contents of Remove an empty directory.
whole directories, e.g. , cp -r my_existing/dir/ ~ will
rm -r files
(recursive remove) Remove files, directories, and
their subdirectories. Careful with this command as xinit
root--you can easily remove all files on the system Start a barebone X-windows server (without a
with such a command executed on the top of your windows manager).
directory tree, and there is no undelete in Linux
startx
(yet). But if you really wanted to do it (reconsider),
here is how (as root): rm -rf /* Start an X-windows server and the default windows
manager. Works like typing "win" under DOS with
cat filename | more Win3.1
View the content of a text file called "filename", one
startx -- :1
page a time. The "|" is the "pipe" symbol (on many
American keyboards it shares the key with "\") The Start another X-windows session on the display 1
pipe makes the output stop after each screenful. For (the default is opened on display 0). You can have
long files, it is sometimes convenient to use the several GUI terminals running concurrently. Switch
commands head and tail that display just the between them using <Ctrl><Alt><F7>,
beginning and the end of the file. If you happened <Ctrl><Alt><F8>, etc.
to use "cat" a binary file and your terminal displays
xterm
funny characters afterwards, you can restore it with (in X terminal) Run a simple X-windows terminal.
the command "reset". Typing exit will close it. There are other, more
advanced "virtual" terminals for X-windows. I like
less filename
Scroll through a content of a text file. Press q when the popular ones: konsole and kvt (both come with
done. "Less" is roughly equivalent to "more" , the kde) and gnome-terminal (comes with gnome). If you
command you know from DOS, although very often need something really fancy-looking, try Eterm.
"less" is more convenient than "more".
xboing
(in X terminal). Very nice, old-fashioned game.
pico filename
Edit a text file using the simple and standard text Many small games/programs are probably installed
editor called pico. on your system. I also like xboard (chess).

shutdown -h now
pico -w filename
Edit a text file, while disabling the long line wrap. (as root) Shut down the system to a halt. Mostly
Handy for editing configuration files, e.g. /etc/fstab. used for a remote shutdown. Use <Ctrl><Alt><Del>
for a shutdown at the console (which can be done
find / -name "filename" by any user).
Find the file called "filename" on your filesystem
halt
starting the search from the root directory "/". The
reboot
"filename" may contain wildcards (*,?).
(as root, two commands) Halt or reboot the
locate filename
machine. Used for remote shutdown, simpler to
Find the file name of which contains the string type than the previous command.
"filename". Easier and faster than the previous
command but depends on a database that normally Network apps
rebuilds at night.
netscape
./program_name (in X terminal) Run netscape (requires a separate
Run an executable in the current directory, which is Netscape installation). The current versions of
not on your PATH. Netscape (4.x) are known to be big and buggy. They
occasionally crash by vanishing (no other harm
touch filename done). Also, when not connected to the network ,
Change the date/time stamp of the file filename to Netscape likes to refuse to do anything (looks like it
the current time. Create an empty file if the file hanged)-it revives when you connect.
does not exist.
netscape -display host:0.0
(in X terminal) Run netscape on the current
machine and direct the output to machine named mc
"host" display 0 screen 0. Your current machine Launch the "Midnight Commander" file manager
must have a permission to display on the machine (looks like "Norton Commander" for Linux).
"host" (typically given by executing the command
telnet server
xhost current_machine_name in the xterminal of the
machine host. Other X-windows program can be run Connect to another machine using the TELNET
remotely the same way. protocol. Use a remote machine name or IP
address. You will be prompted for your login name
lynx file.html and password--you must have an account on the
View an html file or browse the net from the text remote machine to login. Telnet will connect you to
mode. another machine and let you operate on it as if you
were sitting at its keyboard (almost). Telnet is not
pine very secure--everything you type goes in open text,
A good text-mode mail reader. Another good and even your password!
standard one is elm. Your Netscape mail will read
the mail from your Internet account. pine will let you rlogin server
read the "local" mail, e.g. the mail your son or a (=remote login) Connect to another machine. The
cron process sends to you from a computer on your login name/password from your current session is
home network. The command mail could also be used; if it fails you are prompted for a password.
used for reading/composing mail, but it would be
rsh server
inconvenient--it is meant to be used in scripts for
automation. (=remote shell) Yet another way to connect to a
remote machine. The login name/password from
elm your current session is used; if it fails you are
A good tex-mode mail reader. See the previous prompted for a password.
command.
ftp server
mutt Ftp another machine. (There is also ncftp which adds
A really basic but extremally useful and fast mail extra features and gftp for GUI .) Ftp is good for
reader. copying files to/from a remote machine. Try user
"anonymous" if you don't have an account on the
mail remote server. After connection, use "?" to see the
A basic operating system tool for e-mail. Look at the list of available ftp commands. The essential ftp
previous commands for a better e-mail reader. mail command are: ls (see the files on the remote
is good if you wanted to send an e-mail from a shell system), ASCII, binary (set the file transfer mode to
script. either text or binary, important that you select the
proper one ), get (copy a file from the remote
licq system to the local system), mget (get many files at
(in X term) An icq "instant messaging" client. once), put (copy a file from the local system to the
Another good one is kxicq. Older distributions don't remote system), mput (put many files at once), bye
have an icq client installed, you have to do (disconnect). For automation in a script, you may
download one and install it. want to use ncftpput and ncftpget, for example:
ncftpput -u my_user_name -p my_password -a
talk username1 remote.host.domain remote_dir *local.html
Talk to another user currently logged on your
machine (or use "talk username1@machinename" to talk minicom
to a user on a different computer) . To accept the Minicom program (looks like "Procomm for Linux").
invitation to the conversation, type the command
"talk username2". If somebody is trying to talk to you File (de)compression
and it disrupts your work, your may use the
command "mesg n" to refuse accepting messages. tar -zxvf filename.tar.gz
You may want to use "who" or "rwho" to determine (=tape archiver) Untar a tarred and compressed
the users who are currently logged-in.
tarball (*.tar.gz or *.tgz) that you downloaded from batch any_command
the Internet. Run any command (usually one that is going to take
more time) when the system load is low. I can
tar -xvf filename.tar logout, and the process will keep running.
Untar a tarred but uncompressed tarball (*.tar).
at 17:00
gunzip filename.gz Execute a command at a specified time. You will be
Decompress a zipped file (*.gz" or *.z). Use gzip prompted for the command(s) to run, until you
(also zip or compress) if you wanted to compress files press <Ctrl>d.
to this file format.
kill PID
bunzip2 filename.bz2 Force a process shutdown. First determine the PID
(=big unzip) Decompress a file (*.bz2) zipped with of the process to kill using ps.
bzip2 compression utility. Used for big files.
killall program_name
unzip filename.zip Kill program(s) by name.
Decompress a file (*.zip) zipped with a compression
utility compatible with PKZIP for DOS. xkill
(in an xwindow terminal) Kill a GUI-based program
unarj e filename.arj with mouse. (Point with your mouse cursor at the
Extract the content of an *.arj archive. window of the process you want to kill and click.)

uudecode -o outputfile filename lpc


Decode a file encoded with uuencode. uu-encoded (as root) Check and control the printer(s). Type "?"
files are typically used for transfer of non-text files to see the list of available commands.
in e-mail (uuencode transforms any file into an
ASCII file). lpq
Show the content of the printer queue. Under KDE
(X-Windows), you may use GUI-based "Printer
4 Process control Queue" available from "K"menu-Utilities.
ps lprm job_number
(=print status) Display the list of currently running Remove a printing job "job_number" from the
processes with their process IDs (PID) numbers. Use queue.
ps axu to see all processes currently running on your
system (also those of other users or without a nice program_name
controlling terminal), each with the name of the Run program_name adjusting its priority. Since the
owner. Use "top" to keep listing the processes priority is not specified in this example, it will be
currently running. adjusted by 10 (the process will run slower), from
the default value (usually 0). The lower the number
fg PID (of "niceness" to other users on the system), the
Bring a background or stopped process to the higher the priority. The priority value may be in the
foreground. range -20 to 19. Only root may specify negative
values. Use "top" to display the priorities of the
bg PID
running processes.
Send the process to the background. Opposite to fg.
The same can be accomplished with <Ctrl>z. If you renice -1 PID
have stopped jobs, you have to type exit twice in (as root) Change the priority of a running process to
row to log out. -1. Normal users can only adjust processes they
own, and only up from the current value (make
any_command&
them run slower).
Run any command in the background (the symbol
"&" means "run the proceeding command in the <Ctrl>c, <Ctrl>z, <Ctrl>s, and <Ctrl>q
background"). also belong to this chapter but they were described
previously. In short they mean: stop the current useradd user_name
command, send the current command to the The same as the command " adduser user_name ".
background, stop the data transfer, resume the data
userdel user_name
transfer.
Remove an account (you must be a root). The user's
home directory and the undelivered mail must be
dealt with separately (manually because you have
5 Basic administration commands to decide what to do with the files).

printtool groupadd group_name


(as root in X-terminal) Configuration tool for your Create a new group on your system. Non-essential
printer(s). Settings go to the file /etc/printcap. but can be handy even on a home machine with a
small number of users.
setup
(as root) Configure mouse, soundcard, keyboard, X- passwd
windows, system services. There are many Change the password on your current account. If
distibution-specific configuration utilities, setup is you are root, you can change the password for any
the default on RedHat. Mandrake 7.0 offers very user using: passwd user_name
nice DrakConf .
chmod perm filename
linuxconfig (=change mode) Change the file access permission
(as root, either in text or graphical mode). You can for the files you own (unless you are root in which
access and change hundreds of setting from it. Very case you can change any file). You can make a file
powerful--don't change too many things at the accessible in three modes: read (r), write (w),
same time, and be careful with changing entries you execute (x) to three classes of users: owner (u),
don't understand. members of the same group as the owner (g),
others on the system (o). Check the current access
xvidtune permissions using:
(in X-terminal). Adjust the settings of the graphical ls -l filename
display for all resolutions so as to eliminate black If the file is accessible to all users in all modes it will
bands, shift the display right/left/up/down, etc. show:
(First use the knobs on your monitor to fit your text rwxrwxrwx
mode correctly on the screen.) To make the changes The first triplet shows the file permission for the
permanent, display the frequencies on the screen owner of the file, the second for his/her group, the
and transfer them to the setup file third for others. A "no" permission is shown as "-".
/etc/X11/XF86Config. E.g., this command will add the permission to read
the file "junk" to all (=user+group+others):
alias ls="ls --color=tty" chmod a+r junk
Create an alias for the command "ls" to enhance its This command will remove the permission to
format with color. In this example, the alias is also execute the file junk from others:
called "ls" and the "color" option is only envoke chmod o-x junk
when the output is done to a terminal (not to files). Also try here for more info.
Put the alias into the file /etc/bashrc if you would like You can set the default file permissions for the news
the alias to be always accessible to all users on the files that you create using the command umask (see
system. Type "alias" alone to see the list of aliases on man umask).
your system.
chown new_ownername filename
adduser user_name chgrp new_groupname filename
Create a new account (you must be root). E.g., Change the file owner and group. You should use
adduser barbara Don't forget to set up the password these two commands after you copy a file for use by
for the new user in the next step. The user home somebody else.
directory is /home/user_name.
su
(=substitute user id) Assume the superuser (=root)
identity (you will be prompted for the password). to /etc/rc.d/rc.local if you want it to be set at the boot
Type "exit" to return you to your previous login. time. See man setserial for good a overview.
Don't habitually work on your machine as root. The
root account is for administration and the su fdisk
command is to ease your access to the (as root) Linux hard drive partitioning utility (DOS
administration account when you require it. You can has a utility with the same name).
also use "su" to assume any other user identity, e.g.
cd /usr/src/linux-2.0.36
su barbara will make me "barbara" (password
make xconfig
required unless I am a superuser). (as root in X terminal). Nice GUI front-end for
configuration of the kernel options in preparation
kernelcfg
(as root in X terminal). GUI to to add/remove kernel for compilation of your customized kernel. (The
modules. You can do the same from the command directory name contains the version of your Linux
line using the command "insmod", but "insmode" is kernel so you may need to modify the directory
less "newbie-friendly". name if your Linux kernel version is different than
2.0.36 used in this example. You also need the "Tk"
lsmod interpreter and the kernel source code installed. )
List currently loaded kernel modules. A module is The alternatives to "make xconfig" are: "make
like a device driver--it provides operating system config" (runs a scripts that asks you questions in
kernel support for a particular piece of hardware or the text mode) and "make menuconfig" (runs a text-
feature. based menu-driven configuration utility). Try: less
/usr/doc/HOWTO/Kernel-HOWTO for more information.
modprobe -l |more After the configuration, you may choose to proceed
List all the modules available for your kernel. The with kernel compilation of the new kernel by issuing
available modules are determined by how your the following commands:
Linux kernel was compliled. Every possible make dep
module/feature can be compiled on linux as either make zImage
"hard wired" (fast, non-removable), "module" The last command will take some time to complete
(maybe slower, but loaded/removable on demand), (maybe 0.5 h, depending on your hardware). It
or "no" (no support for this feature at all). produces the file "zImage", which is your new Linux
kernel. Next:
insmod parport make modules
insmod ppa make modules_install
(as root) Insert modules into the kernel (a module is Read: /usr/doc/HOWTO/Kernel-HOWTO for
roughly an equivalent of a DOS device driver). This information on how to install the new kernel. You
example shows how to insert the modules for will probably also find it useful to read "man
support of the external parallel port zip drive (it depmode". Configuration, compilation and
appears to be a problem to get the external zip installation of a new kernel is not difficult but it CAN
drive to work in any other way under RH6.0 ). lead to problems if you don't know what you are
doing.
rmmod module_name Compilation of a kernel is a good way to test your
(as root, not essential). Remove the module hardware, because it involves a massive amount of
module_name from the kernel. computing. If your hardware is "flaky", you will most
likely receive the "signal 11" error (read the beatiful
setserial /dev/cua0 port 0x03f8 irq 4 /usr/doc/FAQ/txt/GCC-SIG11-FAQ ).
(as root) Set a serial port to a non-standard setting.
The example here shows the standard setting for depmod -a
the first serial port (cua0 or ttyS0). The standard PC (as root) Build the module dependency table for the
settings for the second serial port (cua1or ttyS1) kernel. This can, for example, be useful after
are: address of i/o port 0x02f8, irq 3. The third serial installing and booting a new kernel. Use "modprobe
port (cua2 or ttyS2): 0x03e8, irq 4. The forth serial -a" to load the modules.
port (cua3 or ttyS3): 0x02e8, irq 3. Add your setting
ldconfig
(as root) Re-create the bindings and the cache for
the loader of dynamic libraries ("ld"). You may want rpm -qpi filename.rpm
to run ldconfig after an installation of new (=RedhatPackageManager, query, package, list.)
dynamically linked libraries on your system. (It is Read the info on the content of a yet uninstalled
also re-run every time you boot the computer, so if package filename.rpm.
you reboot you don't have to run it manually.)
rpm -qpl filename.rpm
mknod /dev/fd0 b 2 0 (=RedhatPackageManager, query, package,
(=make node, as root) Create a device file. This information.) List the files contained in a yet
example shows how to create a device file uninstalled package filename.rpm.
associated with your first floppy drive and could be
rpm -qf filename
useful if you happened to accidentally erase it. The
options are: b=block mode device (c=character (=RedhatPackageManager, query, file.) Find out the
mode device, p=FIFO device, u=unbuffered name of the *.rpm package to which the file
character mode device). The two integers specify filename (on your hardrive) belongs.
the major and the minor device number.
rpm -e packagename
(=RedhatPackageManager, erase=uninstall.)
fdformat /dev/fd0H1440
mkfs -c -t ext2 Uninstall a package pagckagename. Packagname is
(=floppy disk format, two commands, as root) the same as the beginning of the *.rpm package file
Perform a low-level formatting of a floppy in the but without the dash and version number.
first floppy drive (/dev/fd0), high density (1440 kB).
kpackage
Then make a Linux filesystem (-t ext2),
gnorpm
checking/marking bad blocks (-c ). Making the files glint
system is an equivalent to the high-level format. (in X terminal, as root if you want to be able to
install packages) GUI fronts to the Red Hat Package
badblocks /dev/fd01440 1440
Manager (rpm). "glint" comes with RH5.2,
(as root) Check a high-density floppy for bad blocks
"gnorpm" with RH6.0, "kpackage" comes with
and display the results on the screen. The
RH6.1 or must be installed separately but is the best
parameter "1440" specifies that 1440 blocks are to
of the three. Use any of them to view which
be checked. This command does not modify the
software packages are installed on your system and
floppy.
the what not-yet-installed packages are available on
fsck -t ext2 /dev/hda2
your RedHat CD, display the info about the
(=file system check, as root) Check and repair a packages, and install them if you want (installation
filesystem. The example uses the partition hda2, must be done as root).
filesystem type ext2.

dd if=/dev/fd0H1440 of=floppy_image Accessing drives/partitions


dd if=floppy_image of=/dev/fd0H1440
(two commands, dd="data duplicator") Create an mount
image of a floppy to the file called "floppy_image" See here for details on mounting drives. Examples
in the current directory. Then copy floppy_image (file) are shown in the next commands.
to another floppy disk. Works like DOS "DISKCOPY".
mount -t auto /dev/fd0 /mnt/floppy
(as root) Mount the floppy. The directory /mnt/floppy
Program installation must exist, be empty and NOT be your current
directory.
rpm -ivh filename.rpm
mount -t auto /dev/cdrom /mnt/cdrom
(=RedhatPackageManager, install, verbose, hashes
displayed to show progress, as root.) Install a (as root) Mount the CD. You may need to
content of RedHat rpm package(s) and print info on create/modify the /dev/cdrom file depending where
what happened. Keep reading if you prefer a GUI your CDROM is. The directory /mnt/cdrom must exist,
installation. be empty and NOT be your current directory.
mount /mnt/floppy (three commands, RH6.0). Does the same as the
(as user or root) Mount a floppy as user. The file previous command. Substitute the "x"s with digits
/etc/fstab must be set up to do this. The directory of your class "C" IP address that you assigned to
/mnt/floppy must not be your current directory. your home network. In RH6.1, masquarading seems
broken to me--I think I will install Mandrake Linux:).
mount /mnt/cdrom
(as user or root) Mount a CD as user. The file ifconfig
/etc/fstab must be set up to do this. The directory (as root) Display info on the network interfaces
/mnt/cdrom must not be your current directory. currently active (ethernet, ppp, etc). Your first
ethernet should show up as eth0, second as eth1,
umount /mnt/floppy
etc, first ppp over modem as ppp0, second as ppp1,
Unmount the floppy. The directory /mnt/floppy must etc. The "lo" is the "loopback only" interface which
not be your (or anybody else's) current working should be always active. Use the options (see ifconfig
directory. Depending on your setup, you might not --help) to configure the interfaces.
be able to unmount a drive that you didn't mount.
ifup interface_name
(/sbin/ifup to it run as a user) Startup a network
6 Network administration tools interface. E.g.:
ifup eth0
ifup ppp0
netconf
Users can start up or shutdown the ppp interface
(as root) A very good menu-driven setup of your
only when the right permission was checked during
network.
the ppp setup (using netconf ). To start a ppp
pingmachine_name interface (dial-up connection), I normally use kppp
Check if you can contact another machine (give the available under kde menu "internet".
machine's name or IP), press <Ctrl>C when done (it
ifdown interface_name
keeps going).
(/sbin/ifdown to run it as a user). Shut down the
route -n network interface. E.g.: ifdown ppp0 Also, see the
Show the kernel routing table. previous command.

nslookup host_to_find netstat | more


Query your default domain name server (DNS) for Displays a lot (too much?) information on the status
an Internet name (or IP number) host_to_find. This of your network.
way you can check if your DNS works. You can also
find out the name of the host of which you only Music-related commands
know the IP number.
cdplay play 1
traceroute host_to_trace Play the first track from a audio CD.
Have a look how you messages trave to host_to_trace
(which is either a host name or IP number). eject
Get a free coffee cup holder :))). (Eject the CD
ipfwadm -F -p m ROM tray).
(for RH5.2, seen next command for RH6.0) Set up
the firewall IP forwarding policy to masquerading. play my_file.wav
(Not very secure but simple.) Purpose: all Play a wave file.
computers from your home network will appear to
the outside world as one very busy machine and, mpg123 my_file.mp3
for example, you will be allowed to browse the Play an mp3 file.
Internet from all computers at once.
mpg123 -w my_file.wav my_file.mp3
echo 1 > /proc/sys/net/ipv4/ip_forward Create a wave audio file from an mp3 audio file.
ipfwadm-wrapper -F -p deny
ipfwadm-wrapper -F -a m -S xxx.xxx.xxx.0/24 -D 0.0.0.0/0
knapster
(in X terminal) Start the program to downolad mp3
files that other users of napster have displayed for
downloading. Really cool!

cdparanoia -B "1-"
(CD ripper) Read the contents of an audio CD and
save it into wavefiles in the current directories, one
track per wavefile. The "1-"
means "from track 1 to the last". -B forces putting
each track into a separate file.

playmidi my_file.mid
Play a midi file. playmidi -r my_file.mid will display text
mode effects on the screen.

sox
(argument not given here) Convert from almost any
audio file format to another (but not mp3s). See
man sox.

Graphics-related commands
kghostview my_file.ps
Display a postscript file on screen. I can also use the
older-looking ghostview or gv for the same end effect.

ps2pdf my_file.ps my_file.pdf


Make a pdf (Adobe portable document format) file
from a postscript file.

gimp
(in X terminal) A humble looking but very powerful
image processor. Takes some learning to use, but it
is great for artists, there is almost nothing you can't
do with gimp. Use your mouse right button to get
local menus, and learn how to use layers. Save your
file in the native gimp file format *.xcf (to preserve
layers) and only then flatten it and save as png (or
whatever). There is a large user manual /usr/

gphoto
(in X terminal) Powerful photo editor.

giftopnm my_file.gif > my_file.pnm


pnmtopng my_file.pnm > my_file.png
Convert the propriatory giff graphics into a raw,
portable pnm file. Then convert the pnm into a png
file, which is a newer and better standard for
Internet pictures (better technically plus there is no
danger of being sued by the owner of giff patents).

You might also like