Linux Shortcuts and Commands

xiaoxiao2021-03-05  31

Contents of this section: 5.1 Linux essential shortcuts and sanity commands5.2 Help commands5.3 System info5.4 Basic operations5.5 File management5.6 Viewing and editing files5.7 Finding files5.8 Basics of X-windows5.9 Network apps5. 10 File (de) compression5.11 Process control5.12 Basic administration commands5.13 Disk Utilities5.14 Management of user accounts and files permissions5.15 Program installation5.16 Accessing drives / partitions5.17 Network administration tools5.18 Sound-related commands5. 19 Graphics-related commands5.20 Small gamesIntro. This is a practical selection of the commands we use most often, find useful, and which came on our Linux distribution CDs (RedHat or Mandrake). Press on the empty command line to see the listing of all available commands (on your PATH). On my small home system, it says there are 3786 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. The command line (unsses you DIDN)

t install the package, but they all came on our CDs). Programs that require GUI have to be run from under the GUI, for example from a terminal opened in kde or gnome (eg, xterm). Some more advanced (less useful for ? a newbie) tools are described in the Part Learning with Linux of this Guide.Notes for the UNIX Clueless: 1 LINUX IS CASE-SENSITIVE for example:.. Netscape, NETSCAPE and nEtscape, and netscape would be four different commands (but of the four, only netscape is available on my system). 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, "." (DAS), "-", Plus Some Other Non-Recommended Characters .3. Files with names Starting with "." Are Normally Not Shown by The LS (List) or Dir Command. Think of these "DOT" f Iles as "hidden". Use ls -a (list with the option "all") to see these files.4. "/" is an an equivalent to dos "/" (root directory, meaning the parent of all Other Director, OR a separator between a directory name and a subdirectory or filename). For example, try cd / usr / doc5. Under Linux, all directories appear under a single directory tree (there are no DOS-style drive letters). This means directories and files From All Physical Devices Are Merged Into this Single-View Tree.6. in A Configuration File, a line Starting with # is a comment .hen Changing a configuration file, don '

t delete old settings - comment out the original lines with # Always insert a short comment describing what you have done (for your own benefit!) 7 Linux is inherently multi-user Your personal settings (and all other personal files.... ) are in your home directory which is / home / your_user_login_name. Many settings are kept in files with names starting with a dot "." so as to keep them out of your way (see point 3 above) .8. System-wide settings are kept in the directory / etc .9. Under Linux, as in any multiuser operating system, directories and files have an owner and set of permissions. You will typically be allowed to write only to your home directory which is / home / your_user_login_name. Learn to use the file permissions else you will be constantly annoyed with Linux.10 Command options are introduced by a dash,. "-", followed by a single letter. (or - when the option is more than one letter) Thus " - "IS An Equivalent of DOS'S SWITCH" / ". for example, try rm --help.11. Type Command & (THE command name followed by an &) to start a command in the background. This is usually the preferred way of starting a program from the X-window terminal.5.1 Linux essential keyboard shortcuts and sanity commands Switch . to the first text terminals Under Linux you can have several (6 in standard setup) terminals opened at the same time This is a keyboard shortcut, which means:. "press the control key and the alt key, hold them Now press <. F1>. Release All Keys. " (n = 1..6) Switch to the nth text terminal. (The Samely Used Command Chvt n." ChVT "Stands "

"). in text terminal (outside x), you can also use (the key is not needed) .ttyprint the name of the terminal in which you are type this command. if You Prefer the Numr of the Active Terminal (= "Foreground Console"). switch to the first gui terminal (if x- Windows Is Running On The 7th Terminal, WHERE IT TYPCIALLY IS). (n = 7..12) Switch to the nth gui terminal (if a gui terminal is running on screen n-1) On Default on Terminal 7. on Default, Nothing Is Running on Terminals 8 To 12 - You CAN Start Subsequent X Server the. (In a Text OR X Terminal) AutoComplete The Command IF There is Only One Option, Or Else Show All The Available Options. On Newer Systems You May NEED TO PRESS . This Shortcut IS Great, IT CAN Truely Save You Lots of Time. (in A Text or x terminal) Scroll and edit the command hist ory. Press to execute a historical command (to save on typing). scrolls back. Scroll terminal output up. This works also at the login prompt, so you can scroll through your bootup Messages. The Amount / Usage of Your Video Memory Determines How Far Back You Can Scroll The Display. Scrolls The Terminal Output Down. < >

(in x-windows) Change to the next x-server resolution (if you set up the x-server to more one resolution). For Multiple Resolutions on My Standard Svga Card / Monitor, I Have The Following Line in the file / etc / X11 / XF86Config (the first resolution starts on default, the largest resolution determines the size of the "virtual screen"): Modes "1024x768" "800x600" "640x480" "512x384" "480x300" "400x300" "1152x864" ZOf course, first I had to configure the X server, either by using Xconfigurator, xf86config, or manually by edition the file / etc / X11 / XF86Config, so that it supports the above resolutions (mostly the matter of uncommenting the line that defines my video chipset, and specifying the synchronization frequencies my monitor supports) XFdrake (Mandrake configuration utility) can do it from GUI See also the commands xvidtune and xvidgen ... <-> (in X-windows) Change to the Previous X-Server Resolution. (in X-Windows, KDE) Kill The Window I am Going to Click With my mouse pointer (the pointer changes to something like a death symbol). Similar result can be obtained with the command xkill (typed in X-terminal). Useful when an X-window program does not want to close (hangs?). < Ctrl> (in x-windows) Kill The Current X-Windows Server. Use if the x-windows server cannot be exited normally. (in text terminal) Shut Down THISTEM AND REBOOT. THIS The Normal Shutdown Command for a User At The Text-mode Console. Don't just press! RESET "Button for Shutdown!

cKill the current process (works mostly with small text-mode applications). d (pressed at the beginning of an empty line) Log out from the current terminal. See also the next command. dSend [End-of -File] to the current process. Do not press it twice else you also log out (see the previous command). sStop the transfer to the terminal. qResume the transfer to the terminal. Try if your terminal mysteriously stops responding. See the previous command. zSend the current process to the background.exitLogout. I can also use logout for the same effect. (If you have started a second shell, eg, using bash, this command will make you exit the second shell, and you will be back in the first shell, not logged out. Then use another exit to logout.) resetRestore a screwed-up terminal (a terminal showing funny characters) to default setting. use if you tried to "cat" a binary file. You may not Be Able To See the Command As You Type IT, But It Still Will Work. Paste the text which is currently highlighted somewhere else. This is the normal "copy-paste" operation in Linux. It a fast and powerful supplement to the widely-known GUI "copy-paste" menu-based operation. (It does not work inside older versions of Netscape which use the Mac / MS Windows-style "copy-paste" exclusively. It does work in the text terminal if you enabled "gpm" service using "setup". It also works inside any dialog boxes, etc . - Really Convenient!) IT is Best Used with a Linux-Ready 3-Button Mouse (Logitech Or Similar) OR Else Set "3-Mouse Button Emulation". The

is normally emulated on a 2-button mouse by pressing both mouse buttons simultanously. ~ (tilde character) My home directory (normally the directory / home / my_login_name). For example, the command cd ~ / my_dir will change my working directory to the subdirectory "my_dir" under my home directory. Typing just "cd" alone is an equivalent of the command "cd ~". I keep all my files in my home directory .. (dot) Current directory. For example, ./my_program will attempt to execute the file "my_program" located in your current working directory ... (two dots) Directory parent to the current one. For example, the command cd .. will change my current working directory one one level up.Some additional KDE Keyboard Shortcuts (useful, but non-essential Walk Through Windows. To Walk Backwards: Walk Through Desktops: show the table of processes Running on My System. Allow Me To Kill Any of The Processes I Started (Or SE Nd Other Signals to Therm. Access The K-MENU ("Equivalent to MS Windows" Start "Menu). Emulated The Mouse Using The Arrow Keys on The Keyboard. Drag a window to move it. Normally, I move a window by dragging its top title bar, but occassionally I manage to get it off the screen. With this shortcut, I can drag by any part of the window. Take a snapshot of the current. Take a snapshot of the entire desktop into the clipboard.

Lock The Desktop. Toggle Hide / Show The Desktop (Great To Hide The Solitaire Game When Your Boss Walks in). (Non-Essential.) This is IS a group of key combinations implemented at the Linux kernel level (a low level) It means, chances are these key combinations will work most of the time The combinations are meant for debugging purposes and in an emergency (mostly developers);.. you should Try Other, Safer Solutions First. The key IS Also Knows on PC AS . The combination the relevant kernel variable to "1" or "0", EG: ECHO "1" > / proc / sys / kernel / sysrq Kill All Processes (Including X) Which Are Running on The Currently Active Virtual Console. This key combination is know as "Secure Access Key". send the Term Signal To All Running Processes Except init., Asking The To EXIT. Send The Kill Signal To All Running Processes Except Init. This May Be Mo re successful in killing runaway processes than the previous key combination, but it may cause some of them to exit abnormally. Send the KILL signal to all processes, including init. The system will not be functional. Run An Emergency Sync (Cache Write) on All Mounted Filesystems. This Can Prevent Data Loss. Remount All Mounted FileSystems As Read-Only. This Has Has THE Same Effect As The Sync Combination Above, But With One Important Benefit: if The Operation Is Successful, Fsck Won '

t have to check all filesystems after a computer hardware reset. Turn off keyboard raw mode. This can be useful when your X session hangs. After issueing this command you may be able to use . reboot immediately without syncing or unmounting your disks. Your Will Likey End Up with filesisystem errors. Shut the system off (if configured And supported).

dump the current registers and flags to your console. dump a list of current tasks and their information to your console. dump memory info to your console. Sysrq> The Digit IS '0' To '9'. set the console log level, controling which kernel message, for example, '0' will cause only emergency messages like PANICs or OOPSes displayed on your console. Display help. Also, any other unsupported combination will display the same help. 5.2 Help Commandsany_Command - Hel P | Moredisplay a brief Help ON A Command (Works With Most Commands). for Example, Try Cp --help | More. "- Help" Works Similar to DOS "/ H" Switch. The "more" PIPE IS NEEDED WHEN The Output Is Longer Than One Screen.man TopicDisplay The Contents of The System Manual Pages (Help) on the topic. Press "Q"

. To quit the viewer Try man man if you need any advanced options The command info topic works similar to man topic, yet it may contain more up-to-date information Manual pages can be hard to read -.. They were written for UNIX programmers Try any_command --help for a brief, easier to digest help on a command Some programs also come with README or other info files -... have a look to the directory / usr / share / doc to display manual page from A Specific Section, I May Use Something Like: Man 3 Exit (this Displays An Info On The Command Exit from Section 3 of the Manual Pages) Or Man -a EXIT (This Displays Man Pages for Exit from all seats). The Man Sections Are: Section 1-User Commands, Section 2-System Calls, Section 3-Subroutines, Section 4-Devices, Section 5-File Formats, Section 6-Games, Section 7-Miscellaneous, Section 8-System Administration, Section 9, Section N-New. To Print A Manual Page, I Use: Man Topic | Col -B | LPR (The Option Col-B Removes Any Backspace Or Other Characters that could make the printed manpage difficult to read) .info topicDisplay the contents of the info on a particular command. info is a replacement for man pages so it contains the most recent updates to the system documentation. Use and TO MOVE AROUND or You May Get Confused. Press "q"

to quit A replacement for the somewhat confusing info browsing system might be pinfo -. try if you like it any better.apropos topicGive me the list of the commands that have something to do with my topic.whatis topicGive me a short list of commands matching my topic whatis is similar to apropos (see the command above) -.. they both use the same database But whatis searches keywords, while apropos also searches the descriptions of the keywords.help commandDisplay brief info on a bash (shell) built- In Command. Using Help With no commist-in Commands. The Shortest List of Bash Built-in Commands Would PROBABLY INCLUDE: Alias, BG, CD, Echo, Exit, Export, FG, Help, HISTORY, jobs, kill, logout, pwd, set, source, ulimit, umask, unalias, unset.kdehelpkdehelpcenter (in X-terminal, two commands, use the one that works on your system). Browse the whole system help using the graphical KDE help Navigator. Normally, Kde Help Is Invoked by Pressing The Appropriate icon O n the KDE control panel. Use gnome-help-browser for the GNOME equivalent.5.3 System infopwdPrint working directory, ie, display the name of my current directory on the screen.hostnamePrint the name of the local host (the machine on which I am Working. Use netconf (as root) to change the name of the machine.whoamiprint my login name.id usernameprint User ID (UID) And His / Her Group ID (GID), Effective ID (if Different Than The Real ID) and . the supplementary groups.datePrint the operating system current date, time and timezone For an ISO standard format, I have to use: date -IsecondsI can change the date and time to 2000-12-31 23:57 using this command: date 123123572000or Using these Two Commans (Easier to Remember):

Date --set 2000-12-31date --set 23: 57: 00to Set The Hardware (BIOS) Clock from The System (Linux) Clock, I can Use the Command (As root): SetClockthe International (ISO 8601) Standard Format For All-Numeric Date / Time Has The Form: 2001-01-31 (As Linux Default "C" Localization). You can be more precise if you wish Using, for Example: 2001-01-31 23: 59: 59.999 -05: 00 (representing I milisecond before February 2001, in a timezone which is 5 hours behind the Universal Coordinated Time (UTC)) The most "kosher" representation of the same point in time could be:. 20010131T235959,999-0500. See the standard atftp: //ftp.qsl.net/pub/g1smd/8601v03.pdf.

.. TimeDetermine the amount of time that it takes for a process to complete other process accounting Do not confuse it with the date command (see previous entry) Eg I can find out how long it takes to display a directory content using: time ls. Or I can test the time function with time sleep 10 (time the commands the does nothing for 10 seconds) .clockhwclock (two commands, use either). Obtain date / time from the computer hardware (real time, battery-powered) . clock You can also use one of this commands to set the hardware clock, but setclock may be simplier (see 2 commands above) Example:. hwclock --systohc --utc sets the hardware clock (in UTC) from the system clock. whoDetermine the users logged on the machine.wDetermine who is logged on the system, find out what they are doing, their processor ussage, etc. Handy security command.rwho -a (= remote who) Determine users logged on other computers on your network The rwho service must be enabled for this command to run. If it isn't, Run SE tup (RedHat specific) as root to enable "rwho" .finger user_nameSystem info about a user Try:.. finger root One can use finger with any networked computer that exposes the finger service to the world, eg, I can do (try) : finger @ finger.kernel.orglastShow listing of users last logged-in on your system Really good idea to check it from time to time as a security measure on your system.lastb ( "= last bad") Show the last bad (. Unsuccessful) Login Attempts on My System. It Did Not Work ON My System, So Got It Started with: Touch / Var / Log / BTMP "The a good reason why / var / log / btmp isn't Available On Any Sane set UP - IT '

sa world-readable file containing login mistakes. Since one of the most common login mistakes is to type the password instead of the username, / var / log / btmp is a gift to crackers. "(Thanks to Bruce Richardson). It appears the problem can be solved by changing the file permissions so only root can use "lastb":. chmod or / var / log / btmp history | moreShow the last (1000 or so) commands executed from the command line on the current account The "| more "causes the display to stop after each screenful. to see what another user was doing on your system, login as" root "and inspect his / her" history ". The history is kept in the file .bash_history in the user home directory (so yes, it can be modified or erased) .uptimeShow the amount of time since the last reboot.ps (= "print status" or "process status") List the processes currently run by the current user.ps axu | moreList all THE Processes Currently Running, Even Those without the controlling terminal s each process.topKeep listing the currently running processes on my computer, sorted by cpu usage (top processes first). Press c when done.PID = process identification.USER = name of the user who owns (started?) the process.PRI = priority of the process (the higher the number, the lower the priority, normal 0, highest priority is -20, lowest 20.NI = niceness level (ie, if the process tries to be nice by adjusting the priority by The Number Given. The Number, The Higher The Numness of The Process (IE, ITS Priority Is Lower) .size = Kilobytes of Code Data Stack Taken By The Process In Memory.RSS =

kilobytes of physical (silicon) memory taken.SHARE = ​​kilobytes of memory shared with other processes.STAT = state of the process: S-sleeping, R-running, T-stopped or traced, D-uniterruptable sleep, Z = zombie%. CPU = share of the CPU usage (since last screen update).% MEM = share of physical memory.TIME = total CPU time used by the process (since it was started) .COMMAND = command line used to start the task (careful with Passwords, etc., on command line, all permitted to run "TOP" May See Them! gtopktop (in x Terminal) Two Gui Choices for top. My Favourite Is Gtop (Comes with gtop (comes with gtop (comes with gtop). in KDE, KTOP is Also Available from The "K" Menu Under "System" - "Task Manager" .uname -a (= "Unix Name" with option "all") Info On Your (local) Server. I can Also Use Guname (in x-window terminal) to display the info more nicely.XFree86 -versionShow me the version of X windows I have on my system.cat / etc / issueCheck what distribution you are using you can put your own message in this text file -. it's displayed on login. IT IS more common to put your site-specific login message to the file / etc / motd ( "motd" = "message of the day"). freeMemory info (in kilobytes). "Shared" memory is the memory that can be shared between processes (EG, Executable Code Is "Shared"). "Buffered" and "cashed" Memory is the part key "of Recently Accessed Files - It can be shrunk if more memory is needed by processes.df -h (= Disk free ) Print Disk info about all the filesystems (in human-readable form) .du / -bh | more (= disk usage) Print Detailed Disk usage for easy subdirectory starting at the "/"

(Root) directory (in human legible form) .cat / proc / cpuinfoCpu info -. It shows the content of the file cpuinfo Note that the files in the / proc directory are not real files - they are hooks to look at information available to the kernel.cat / proc / interruptsList the interrupts in use. May need to find out before setting up new hardware.cat / proc / versionLinux version and other info.cat / proc / filesystemsShow the types of filesystems currently in use.cat / etc / printcap | moreow the setup of printers.lsmod (= "List modules". as root. Use / sbin / lsmod to execute this command when you are a non-root user.) Show the kernel modules currently loading.set | moreShow the current user environment (in full). Normally too much to bother.echo $ PATHShow the content of the environment variable "PATH". This command can be used to show other environment variables as well. Use set to see the full environment ( See the prepvious command .dmesg | Lessprint Kernel Messages (The Content of the So-Called Kernel Ring BUF fer). Press "q" to quit "less". Use less / var / log / dmesg to see what "dmesg" dumped into this file right after the last system bootup.chage -l my_login_nameSee my password expiry information.quotaSee my disk . quota (the limits of disk usage) .sysctl -a | moreDisplay all the configurable Linux kernel parameters.runlevelPrint the previous and current runlevel The output "N5" means: "no previous runlevel" and "5 is the current runlevel" To. Change the runlevel, use "init", eg, init 1 switches the system to a single user mode.runlevel is the mode of operation of tinux. Runlevel Can Be Switch "on the fly"

Switch Me To Runle 3. The Following Runlevels Are Standard: 0 - Halt (Do Not Set InitDefault To this) 1 - Single User Mode2 - Multiuser, WITHOUT NFS (The same as 3, if you do not have networking) 3 - Full multiuser mode4 - unused5 - X116 - reboot (do nOT set initdefault to this) The system default runlevel is set in the file:. / etc / inittab sarView information extracted the system activity log file (/ var / log / sarxx where xx is the current day number). sar can extract many kinds of system statistics including CPU load averages, i / o statistics, and network trafic statistics for the current day and (usually) several . days backs.5.4 Basic operationslsdirList the contents of the current directory The command dir is an alias to ls so these two commands do exactly the same thing The file listing is normally color-coded:. dark blue = directories, light grey = regular files , Green = Executable Files, Magenta = graphics files, red = compres sed (zipped) files, light blue = symbolic links, yellow = device files, brown = FIFO ( "First-In First-Out" named pipes) .ls -al | moreList the content of the current directory, all files (also those starting with a dot), and in a long form. Pipe the output through the "more" command, so that the display pauses after each screenful. The ls command has several very useful options. Some of these may have shortcuts (aliases) to Avoid Clumsy Typing. Try LL (= "long ls", an alias to ls --l). Another Option I use quite offen is ls -ad (list all the subdirector in My Current Directory, Button n't List their Contents). CD DirectoryChange Directory. Using "CD"

without the directory name will take you to your home directory "cd -". will take you to your previous directory and is a convenient way to toggle between two directories "cd .." will take me one directory up (very useful).. ./program_nameRun an executable in the current directory The ./ is needed when the executable is not on my PATH An executable which is on my PATH is simply run using:.. program_nameshutdown -h now (as root) Shut down the system to a Halt. Mostly Used for a Remote Shutdown. Uses User (Which Can Be Done by Any User) Halt OR Reboot The Machine. Used for remote shutdown, simpler to type than the previous command Also great if the computer "hangs" (I lose control over the keyboard) -.. I telnet to it from another machine on the network and remotely reboot it I use for Normal Shutdown at The Console of a local computer.vlock (not present on open.) Lock Al Ocal (TEXT MODE) Terminal. I can ALSo Use Vlock -a to Lock All Terminals (Probably NOTE A good IDEA). The Best Is Probably to log out. You don't use vlock in gui - The Windows Managers come with password -protected screensaver and a locking utility (the small icon with padlock in KDE, the keyboard shortcut ) .5.5 File managementcp source destinationCopy files. Eg, cp / home / stan / existing_file_name. will copy a File to my current working directory. Use the "-r" option (Stands for "Recursive"

) To copy the contents of whole directory trees, eg, cp -R my_existing_dir / ~ will copy a subdirectory under my current working directory to my home directory.mcopy source destinationCopy a file from / to a DOS filesystem (no mounting of the DOS filesystem IS Necessary). Eg, Mcopy A: /autoexec.bat ~ / junk. Seeman Mtools for Other Commands That Can Access Dos Files Withouting: Mdir, MCD, MREN, MMOVE, MDEL, MMD, MRD, MFormat .... We do not use the mtool commands that often -. operations on DOS / MS Windows files can be performed using regular Linux commands after you mount the DOS / MS Windows filesystem.mv source destinationMove or rename files The same command is used for moving and renaming files and directories.rename string replacement_string filenameFlexible utility for changing parts of filenames for example:.. rename .htm .html * .htmln source destinationCreate a hard link called destination to the file called source The link appears as a copy of the original Files, But in realit y only one copy of the file is kept, just two (or more) directory entries point to it. Any changes to the file are automatically visible throughout. When one directory entry is removed, the other (s) stay (s) intact. The limitation of the hard links are: the files have to be on the same filesystem, hard links to directories or special files are impossible.ln -s source destinationCreate a symbolic (soft) link called "destination" to the file called "source" . The symbolic link Just Specifies a path where to look for the "real"

. File In contradistinction to hard links, the source and destination do not have to be on the same filesystem In comparison to hard links, the drawback of symbolic links are:. If the original file is removed, the link is "broken" - it points to nowhwere;. symbolic links can create circular references (like circular references in spreadsheets or databases, eg, "a" points to "b" and "b" points back to "a") in short, symbolic links are a great Tool and are Very Offers, But The Create An Extra Level of Complexity.rm FileSremove (Delete) Files. You Must Ow Remove It (or Be "root" ). ON MANY SYSTEMS, You Will Be asked for a confirmation of deletion; if you don't want this, use the "-f" (= force) Option, EG, RM -F * WILL REMOVE All Files in My Current Working Directory, No Questions asked.mkdir Directorymake A New Directory.rmdir DirectoryRemove An Empty Directory.rm -r Files (Recursive Remove) Remove Files, Directories, A nd their subdirectories Careful with this command as root -. you can easily remove all files on the system with such a command executed on the top of your directory tree, and there is no undelete in Linux (yet) But if you really wanted. To do it (reconsider): RM-RM-RM-RM-RM -RF Files (Recursive Force Remove). AS ABOVE, But Skip The Prompt for Confirmation, IF One IS Set ON Your System. Careful with this command particularly as root -. see the command above.mcLaunch the "Midnight Commander" file manager (looks like "Norton Commander" for Linux) According to some computer dinosaurs, this is the best file manager ever.konqueror &

(In X terminal) Launch the KDE file manager. Perhaps this is the utltimate for file managment. Much better that the MS "Windows Explorer". It embeds web browsing, pdf viewing, and more. Really cool.xwc (in X terminal) . Another excellent file manager (called "X Win Commander"). Faster than konqueror, but not as loaded with features.nautilus & (in X terminal). A really cool file manager. Slower than konqueror, but offers me goodies like icon- preview of the content of files (!). It even "previews" the contents of sound files! speedwise, it runs great on my 1.33 GHz computer, but I do not use it on my 133MHz computer.5.6 Viewing and editing filescat filename | Moreview The Content of a Text File Called "FileName", One Page A Time. The "|" is the "pipe" Symbol (ON MANY American Keyboards It Sharees The Key with "/"). More Makes The Output Stop After Each Screenful. for long long files e, or less that enables scrolling up and down If you happened to use cat a binary file and your terminal displays funny characters afterwards, you can restore it with the command reset.cat filename |. lessless filename (two commands, use either) Scroll A Content of a Text File. Press Q by Done. "Less" is Roughly An Equivalent To "More", The Command You know from dos, but offen "less" is more convenient tour "more"

because it lets me scroll both up and down.head filenamePrint first 10 lines of the (long) text file.tail filenamePrint last 10 lines of a long or growing text file. Use tail -f filename for tail to follow the file as it grows --really handy for continuing inspection of log files.pico filenameEdit a text file using the simple and standard text editor called pico. Use x to exit. There are many text editors for Linux, including several GUI-based. A brand New Clone of Pico (gpled) IS nano.pico -w filenameEdit a Text File, while disabling the long pap. Handy for Editing Configuration Files, Eg /etc/fstab.kwrite(In X Terminal) Very Nice, "Advanced Text Editor ". Supports veritical text selection! katekeditgedit (in X terminal). Simple yet nice text editors (GUI based) .gxedit (in X terminal) Another multi-purpose, feature packed text editor. This one even has timed backup.latte (in X Terminal) "Code" Editor, IE, Plain Text Editor Meant for Writing Programs.NEDIT (In x Terminal) Anot her programmer editor. Very nice and loaded.bluefish (in X terminal) html editor (source with syntax highlighting and maaaany tools and options) .ispell filenameSpell check an ASCII text file. AbiWord, WordPerfect, StarOffice and other word processors come with "as -you-type "spellchecking, so you really do not have to worry about the simple ispell unless you need it. Newer Linux distributions (eg, RH7.0) contain an improved spellchecking module called aspell, yet the above command will still work .look thermolook up the dictionary on your system (/ usr / share / dict / word) for Words Which Start with "thermo" .wvhtml ms_word_document.doc>

filename.htmlConvert a MS Word document to the html file format.5.7 Finding filesfind / -name "filename" Find the file called "filename" on your filesystem starting the search from the root directory "/". The "filename" may contain wildcards (* ,?). The Find Command Is Very Powerful. IT Has Many Options That Will Let You Search for Files in A Variety of Ways Eg, By Date, Size, Permissions, Owner, .... Yet Search Queries Can Take you more than a minute to compose See info find Here are some more complex examples for using find to accomplish some useful tasks.find $ HOME -name core -exec rm -f {} /;.. The above command finds files named "core "For Each Such File Found, IT Perform The Action" RM-DELETING THE ". The {} Stands for the File Found, and The" / "Terminates the Command List. Find / dev -user "peter" | Morethe Above Command Prints The FileName for All Devices OwnEd by User "Peter" .printing the filename is the default "action" of Find, So It Does Not Have to Be Specified if this is all I need.find / home / peter -nouser -exec ls -l {} /; -ok chown peter.peter {} /; find files without a valid Owner in The / home / peter directory. List the file in a long finalship to the user "peter" and the group "peter". You Probably Need to be root to hand over the ownership of a file.locate FileNameFind The File Name Which Contains The String "FileName"

. Easier and faster than the previous command but depends on a database that normally rebuilds at night, so you can not find a file that was just saved to the filesystem To force the immediate update of the database, I may do (as root).: updatedb & .which executable_nameShow me the full path to the executable that would run if I just typed its name on the command line for example, this commmand:. which netscapeon my system produces: / usr / bin / netscapewhereis commandPrint the locations for the binary, Source, And Manual Page Files of the Command "Command" .rgrep -r 'caleste'. | more (Two Commands, Use the one "forks on your system.) Search All Files in The Current directory and all its subdirectories (the option "-r" stands for "recursive") for the example string "celeste". Print the filename and the line in the file that contains the searched string.kfind & (in X terminal). A GUI Front-End to Find and grep. Very Nice. The & at the end of the commnd makes kfind run in the background so that the X terminal remains available.5.8 Basics of X-windowsxinit & Start a barebone X-windows server (without a windows manager). The "&" makes the command run in the background.startx & Start an X-windows server and the default windows manager Works like typing "win" under DOS with Win3.1.startx -:. 1 & Start another X-windows session on the display 1 (the default is opened on display 0) You can have several GUI terminals. Running concurrently. Switch Between the using ,

ETC.XTERM (IN X Terminal) Run A Simple X-Windows Terminal. Theping Exit Will Close It. There Are Other, More Advanced "Virtual" Terminals for xwindows. I like The Popular Ons: Konsole and Kvt (Both Come with KDE ) and gnome-terminal (comes with gnome). If you need something more fancy-looking, try Eterm. For something plain and fast, I could select rxvt.startkdegnome-sessionxfceafterstepAnotherLevelfvwm2fvwm (in X terminal, 7 different commands, use the one which starts your fav windows manager) Start your favourite windows manager in an X terminal on bare X server.5.9 Network appsnetscape & (in X terminal) Run netscape. The current (Nov. 2001) Netscape 4.78 is pretty good. Some previous versions of Netscape were known to be buggy: they occasionally crashed by vanishing (no other harm done), when not connected to the network, they liked to refuse to do anything (looked like it hanged) only to revive on connect Mozilla is a modern replacement for. Netscape and it quite work in Version 0. 95 but it is still slower than netscape on restricted hardware konqueror may be a good alternative if Netscape does not satisfy your need galeon is currently my choice (try typing galeon & in your Xterminal) .netscape -display host:.. 0.0 & (in X terminal) Run netscape on the current machine and direct the output to machine named "host" display 0 screen 0. Your current machine must have a permission to display on the machine "host" (typically given by executing the command xhost current_machine_name in the xterminal Other X-Windows Program CAN Be Run Remotely the Same Way.Lynx File.htmlView An Html File or Browse The Net from The Text Mode. Alth Lynx '

s look or convenience of use is not as great as GUI-based browser, it is light-weight, almost always works, and does not require any configuration, as long as your networks is functional.konqueror & (in X terminal) File manager and web browser in one. Very nice, in many ways better than netscape. Comes with KDE.pineA good text-mode mail reader. Another good and standard one is elm. your Netscape mail will read the mail from your Internet account. pine will . let you read the "local" mail, eg the mail your son or a cron process sends to you from a computer on your home network The command mail could also be used for reading / composing mail, but it would be inconvenient - it is meant to be used in scripts for automation.muttA really basic but extremally useful and fast mail reader.mailA basic operating system tool for e-mail. Look at the previous commands for a better e-mail reader. mail is good if you wanted To send an e-mail from a shell script.kmail & (in x-terminal) Nice, GUI Mail Progr am. I use kmail, it is much better than netscape mail. I can have multiple accounts and retrieve mail from the smtp (local) server and pop3 servers (internet service provider) to the same mailbox. Simple and elegant. Supports digital signatures. licq & (in X terminal) An icq "instant messaging" client. Another good one is kxicq. Older distributions do not have an icq client installed, you may have to do download one and install it.knode & (in X terminal) Start my favourite newsgroup (usenet) reader. It is MUCH better than the netscape's built-in reader.talk username1Talk to another user currently logged on your machine (or use "talk username1 @ machinename"

to talk to a user on a different computer). To accept the invitation to the conversation, type the command "talk username2". If somebody is trying to talk to you and it disrupts your work, your may use the command "mesg n" to refuse accepting messages. You may want to use "who" or "rwho" to determine the users who are currently logged-in. talk is one of the old-fashioned "standard" UNIX tools, yet it still can be cool and useful in some situations.telnet serverConnect to another machine using the TELNET protocol Use a remote machine name or IP address you will be prompted for your login name and password -.. you must have an account on the remote machine to login Telnet will connect. you to another machine and let you operate on it as if you were sitting at its keyboard (almost) Telnet is not very secure -.! everything you type moves through the networks in open text, even your password A competent system administrator on a Computer "On-Route" Can Read What You Type. Use SSH (Requires S ome setup) for encrypted transmission.rlogin server (= remote login) Connect to another machine The login name / password from your current session is used;. if it fails you are prompted for a password.rsh server (= remote shell) Yet another way to connect to a remote machine The login name / password from your current session is used;. if it fails you are prompted for a password.ssh servername -l username (= secure shell) Connect to a server (remote login) using a Secure Connection. SSH IS Secure Because Encrypts All The Data Transfered Over The Network Using A Pair of Rsa "Public-Private" Keys. if you don '

t specify the username, your current user name is assumed.Both the client and the server must have ssh service (daemon) running. They are normally available on newer Linux distributions (eg, RH7.0). Before using ssh, some setup may Be Necessary. The User Creates HIS / HER RSA Key Pair (for Encryption) by Running The Command SSH-KEYGEN. THISTES The Private Key In The File $ Home / .ssh / Identity and The Public Key in $ Home / .ssh / identity.pub in the user's home directory. to allow automatic login, the user should copy the identity.pub to $ HOME / .ssh / authorized_keys in his / her home directory on the remote machine After this, the user can log in without giving the password. The most convenient way to use RSA authentication may be with an authentication agent. See man 1 ssh-agent for more information. If automathic authentication methods fail, ssh prompts the user for a password. The password is sent to the remote host For Checking; However, Since All Communications Are Encrypted, The Passwor d can not be seen by someone listening on the network.From: Benjamin Smith (edited for space): I recently got openssh 2.9.2p1 up and running, along with the password-free login option It took. Some doing and none of the howtos covered this. Would you like the "magic tidbit" That Makes it all work? Here it is: "The default is to ssh2 and dsa keys, Which you generate with 'ssh-keygen -d' and IT goes Into ~ / .ssh / id_dsa.pub, Which you wouldopy to removehost: .ssh / authorized_keys2 "use this instead of the usufact" Authorized_keys "

file given in the howtos, and VOILA! It actually works.ftp serverFtp another machine. (There is also ncftp which adds extra features and gftp for GUI.) Ftp is good for copying files to / from a remote machine. Try user "anonymous "if you do not have an account on the remote server After connection, use." "to see the list of available ftp commands The essential ftp commands are:?. ls (see the files on the remote system), ASCII, binary (set the file transfer model, entry ", put (Copy A File) from the local system to the remote system), mput (put many files at once), bye (disconnect) for automation in a script, you may want to use ncftpput and ncftpget, for example:. ncftpput -u my_user_name -p my_password - A remote.host.domain remote_dir * local.html "ncftp" Seems to have a problem if you computer is behind a firewall - you need to configure t He file /Home/USR_Name/.ncftp/firewall. Alternative, You May "LFTP" to Accomplish The Same, for Example: Lftp -e "MPUT -A * local.html" -u my_user_name, my_passwordftp: // transote. Host.domain

For Keeping Mirrors of FTP Directories, One Can Use FmirrorWget -M --NO-Parent

http://sunsite.dk/linux-newbie

Copy File Above Uses The Option -m (= mirror) TO RETRIEVE A Complete Set of Files from the master site of this guide. The option "--no-parent" Limits the Retrieval to the files in the retrieval given directory and its subdirectories.minicomMinicom program for serial port "terminal emulation". Looks and works like "Procomm" or "Telix". It is useful for testing and debugging your serial communication.rxReceive files using the Zmodem, Ymodem, or Xmodem protocol . Xmodem requires a filename. use rx --help for more info. Who uses these protocols any more anyway? "I use Zmodem regularly. I have two computers running (SuSE) Linux, a laptop and a desktop. The desktop computer does not have access to an internet connection. So, in order to get files I downloaded from one computer to the other, I send them over via a null-modem cable, using Minicom and the Zmodem protocol. This way I can even connect my laptop from Work running win2000 to my linux machine using reflexion (a Win32 Terminal Emulation PROG "(from Berry Vos, B.vos @ getronics.com

2001 08 28) .5.10 File (de) compressionstar -zxvf filename.tar.gz (= Tape Archiver) Untar a tarred and compressed tarball (* .tar.gz or * .tgz) That You Downloaded from the Internet.tar - XVF filename.taruntar a tarred but uncompressed tarball (* .tar) .tar czvpf /va/backups/mybackup.tar.gz / homecd /; tar xzvpf /var/backups/mybackup.tar.gz '* / myfile.rtf' (as root) Create a backup of / home to a compressed file. The second shopping shows how to restore a file from the backup.gunzip file.com the backup.gunzip filename.gzdecompress a zipped file (* .gz "or * .z). Use Gzip (Also zip or compress) if you wanted to compress files to this file format Note the funny pronounciation of "gun zip" .zcat filename.gz |.. more (= zip cat) Display the contents of a compressed file Other utilities for operating on compressed files without prior decomprssion are also available: zless, zmore, zgrep, ... bunzip2 filename.bz2 (= big unzip) Decompress a file (* .bz2) zipped with bzip2 compression utility Used for big files.unzip filename.zipDecompress. a file (* .zip) zipped with a compression utility compatible with PKZIP for DOS.zip filename.zip filename1 filename2Compress two files "filename1" and "filename2" to a zip archive called "filename.zip"

.unarj e filename.arjExtract the content of an * .arj archive.lha e filename.lhaExtract the content of an lharc archive.uudecode -o outputfile filenameDecode a file encoded with uuencode. uu-encoded files are typically used for transfer of non- text files in e-mail (uuencode transforms any file into an ASCII file) .cat filename | mimencode -o filename.mimecat filename.mime | mimencode -u -o filname (. 2 commands) Encode and then decode back a file to / from the mail-oriented Internet standard for 7-bit data transfer called "mime". On older distributions, the command that does the work (mimencode) is called mmencode. Usually, you do not have to bother with these commands, your mailer should do the mime encoding / decoding in a transparent way.ar -x my_archive.a file1 file2 (= archiver). Extract files file1 and file2 from an archive called my_archive.a. The archiver utility ar is mostly used for holding libraries.ark & (in x Terminal). A gui (qt-based) Archiver Application. Perhaps That's Everything W hat you need to manage your compressed files. An alternative is gnozip.5.11 Process controlps (= "print status" or "process status") Display the list of currently running processes with their process ID (PID) numbers. Use ps axu to see all processes currently running on your system (also those of other users or without a controlling terminal), each with the name of the owner. Use "top" to keep listing the processes currently running.any_command & Run any command in the background (the symbol "&" Means "Run the Preceding Command in The Background"). The Job_Number Is Printed On The Screen So You Can Bring The Command in The Foreground (See Below) If You Want. I Use

& "Often when starting a GUI program from an X-terminal.jobsList my background or stopped processes and show their job numbers.fg job_numberBring a background or stopped process to the foreground.bg job_numberPlace a process in the background, so it is exactly as if it had been started with &. This will restart a stopped background process. The current foreground process can often be stopped with z. If you have stopped or background jobs, you have to type exit twice in row to log out. batchat> updatedb dRun any command (usually one that is going to take more time to complete) when the system load is low. I can logout, and the process will keep running. When the command completes, an email will be sent To me with the output. in The Example Above, The "at>" REPRESENTS A Prompt, The Command To Run IS Updatedb, And The Terminates My Input To Batch (I Could Start Many Commands To Run, Separate) BY ) .at 17: 00Execute A Command at a Specified Time. You Will Be Prompt ed for the command (s) to run, until you press d. The associated commands are atq (display the queue of processes started with at) and atrm (remove a process from the "at queue"). kill PIDForce a process shutdown. First determine the PID of the process to kill using ps.killall program_nameKill program (s) by name. For example, killall pppd will disconnect your dialup network.nohup program_name (=

no hungup). Run program_name so that it does not terminate when you log out. Output is redirected to the file nohup.out in your home directory. You surely do not want to run an interactive program under nohup.xkill (in X terminal) Kill a GUI-based program with mouse. (Point with your mouse cursor at the window of the process you want to kill and click.) kpm (in X terminal) KDE process manager.lpc (as root) Check and control the printer ( S). TYPE "?" to see the list of available commands.lpqshow the content of the print queue. Under Kde (X-Windows), You May Use Gui-based "Printer Queue" Available from "K" Menu-utilities. lprm job_numberRemove a printing job "job_number" from the queue.nice program_nameRun program_name adjusting its priority. Since the priority is not specified in this example, it will be increased by 10 (the process will run slower), from the default value (usually 0 ). The Lower The Number (of "niceness" to other users on the system), The Prior THE PRIORITY. The Priority VA lue may be in the range -20 to 19. Only root may specify negative values. Use top to display the priorities of the running processes.renice -18 PID (as root) Change the priority of a running process to minus 18. Normal users can only adjust processes they own, and only up from the current value (make them run slower). One could also renice 10 -u peter to make user peter use fewer cpu clicks so that other user do not suffer when he runs his Computing-Intensive Tasks. C, Z, S, AND

q also belong to this chapter but they were described previously In short they mean:. stop the current command, send the current command to the background, stop the data transfer, resume the data transfer.lsofList the opened files If I am a root. All Files Will Be listed. i can limit myself to files opened by process console if i use lsof / dev / tty1. to list only network files (useful for a security audit), I Would Do Lsof -i ( as root) .watch -n 60 my_commandExecute my_command repeatedly at 60-second intervals (the default interval is 2 seconds) .5.12 Some administration commandssu (= substitute user id) Assume the superuser (= root) identity (you will be prompted for the password). Type "exit" to return you to your previous login. Do not habitually work on your machine as root. The root account is for administration and the su command is to ease your access to the administration account when you require it. You can also use "su" to assumethy other user identity, eg Su Barbara Will Make Me "Barbara" .alias ls = "ls --color = tty" Create An Alias ​​for the Command "LS" to enhance ITS Format with color. in this Example, The alias is also called "ls" and the "color" option is only evoked when the output is done to a terminal (not to files). Put the alias into the file / etc / bashrc if you would like the alias to be always accessible TO All Users on the system. Aliases Are A Handy Way To Customize Your System. Type "Alias"

alone to see the list of aliases for your account. Use unalias alias_name to remove an alias.cat / var / log / httpd / access_logShow who connected to your http (apache) server since the last time the log file was "rotated" (normally Rotated ONCE A Day, WHEN CRON RUNS). The Previous Log File IS Access_log.1 idea to do it from time to time if you use Internet access.ftpwho (as root) Determine who is currently connected to your ftp server.printtool (as root in X-terminal) Configuration tool for your printer (s). Settings go to the file / etc / printcap and (strangely) /var/spool/lpd.setup(as root) Configure mouse, soundcard, keyboard, X-windows, and system services. There are many distibution-specific configuration utilities, setup is the default On Redhat. Mandrake 7.0 Offers Very Nice Drakconf .linuxConf (As root, Either in text mode or in the x terminal). You can access and change Hundreds of NetWork Setting from Here. Very Powerful - Don't change Too Many Things At the Same Time, And Be Careful with Changing Entries you don '

t understand. ReadHats network configuration utility netconf is a subset of linuxconf, therefore it is simpler and sometimes easier to use.mouseconf (as root). Simple tool to configure your mouse (after the initial installation). Mandrake includes also an alternative mousedrake. kudzu (as root). Automatically determines and configures your hardware. If having mysterious problems with your mouse (or other serial hardware), you may want to disable kudzu, so it does not run on the system startup (kudzu messed up my system so I could not have my mouse working). you can run it manually when you need it.timeconfig (as root) Set the timezone for your system. My computer hardware clock (BIOS setup) keeps time in UTC (Coordinated Universal Time, which was once called GMT or the Greenwich Mean Time). This way, I avoid any possible problems associated with switching timezones due to the daylight savings time, transfering files across the globe through the network, or a physical travel. It is customar y to keep time on a server computers in UTC to avoid time ever going "backwards" (which could cause problems). Timestamps on files are always kept in UTC and displayed in the local time using the time zone information. For example, many applications (eg, compilers, databases) depend on being able to distinguish a newer file from an older one by comparing their timestamps. It is important to keep the timezone correct. The only reason why I could select to keep BIOS time in the local time is TO AVOID Problems When Dual Booting from The Same Computer, And WHEN THE OTHER OPERATING SYS NOT KNOW HOW HANDLE UTC. THEN, I Let My Linux Server Know About this by checking the box "

Hardware clock set to GMT ", so that Linux can backcalculate the UTC which it needs.setclock (as root). Set your computer hardware clock from the current linux system time. Use the command" date "first to set up the linux system time . Eg, I could change the date and time to 2000-12-31 23:57 using this command: date 123123572000and then write the time to the hardware clock using: setclockdateconfig & (in X-terminal, as root else you will be asked for the root password). An excellent GUI utility to set my operating system and hardware clock and timezone, and tell my BIOS to keep time in UTC. I do not need the previous two commands.xvidtune (in X-terminal). Adjust the settings for your monitor display for all resolutions so as to eliminate black bands, shift the display right / left / up / down, etc. (First use the knobs on your monitor to fit your text mode correctly on the screen). Then use xvidtune To Adjust The Monitor Frequencies for Each Resolution SO It Fits Well in Your Secree. To make the ch . Anges permanent, display the frequencies on the screen and then transfer them to the setup file / etc / X11 / XF86Config On newer monitors, you may really prefer to adjust your monitor using the built-in monitor settings - xvidtune is for older monitors which do not have the capability to remember their settings.kvideogen (in X-terminal). Generate "modelines" for customized resolutions of your screen. After you generated the setup text (the "modelines"), you can copy-paste it to The x-windows setup file / etc / x11 / xf86config (OR / ETC / X11 / XF86Config-4 if You Use X-Server Version 4.xx). See Also The Keyboard Shortcut < >

SVGATextMode 80x25x9SVGATextMode 80x29x9 (as root) Change the text resolution in the text terminal. In the above example (second line) I changed the text screen to 80 columns x 29 lines with characters 9 pixels high. The first line defines a resolution that always works , so that if the second command did not work on my system, I can press twice and to regain control over my screen The possible modes depend on your video card and your monitor synchronization frequencies -. I needed to edit (as root) the file / etc / TextConfig and (un) comment the proper lines to let SVGATextMode know what my system supports.SuperProbe (as root). A utility to determine the type of the video card and the amount of its memory .cat /var/log/xfree86.0.loga log file for x That Can Be Useful to determine What is Wrong with your x setup. The "0" in The FileName Stands for "Display 0" - Modify The FileName Accordingly IF You need log for displays "1", "2", etc.lspcishow info on your motherboard and wha t cards are inserted into the pci extension slots My older computer has ISA slots (or EISA) slots, no pci.lsdevDisplay info about your hardware (DMA, IRQ, IO ports) .lsof |. moreList files opened on your system.kernelcfg ( . as root in X terminal) GUI to to add / remove kernel modules Module is like a device driver -.. a piece of Linux kernel that provides support for a particular piece of hardware or functionality You can do the same from the command line Using the command insmod.lsmod (=

. List modules) List currently loaded kernel modules A module is like a device driver - it provides operating system kernel support for a particular piece of hardware or feature.modprobe -l |.. MoreList all the modules available for your kernel The available modules are determined by how your Linux kernel was compliled. Almost every possible module / feature can be compiled on linux as either "hard wired" (perhaps a bit faster, but non-removable), "module" (maybe a bit slower, but loaded / removable on demand), or "no" (no support for this feature at all). The modules which your kernel supports (with which it was compiled) are all as files under the directory / lib / modules (and the subdirectories) so browsing it may give you a clue if you are lost. If your kernel does not support a module you require, you may need to re-compile your kernel with this module enabled (this is rare because the "stock" RedHat or Mandrake Linux kernels Come with Almost All Common and Non-Experimental Modules pre-com piled. Still, if you have a bleeding edge hardware ...) .modprobe sbLoad the soundblaster (sb) module. Use the previous command to find other kernel modules there are to load.insmod parportinsmod ppa (as root) Insert modules into the KERNEL (A Module Is Roughly An Equivalent of A DOS Device Driver). Normally, I Use "Modprobe"

(See the previous command) to insert modules. This example shows how to insert the modules for support the external parallel-port 100-MB zip drive (it appears to be a problem to get the external zip drive to work in any other way under RH6.0 and 6.1). For the 250-MB external zip, I use the imm module instead of ppa.rmmod module_name (as root, not essential). Remove the module module_name from the kernel.depmod -a (as root) Build The Module Dependency Table for the Kernel. NOT Essential Unless Don '

Twish to reboot.setserial / dev / coot.SetSerial / dev / cur ot (as root) Set a serial port to a non-standard setting for the first serial port (cua0 or ttys0). The Standard PC Settings for the Second Serial Port (CUA1R TTYS1) Are: Address of I / O Port 0x02F8, Irq 3. The Third Serial Port (Cua2 or Ttys2): 0x03E8, Irq 4. The Forth Serial Port (Cua3 or Ttys3): 0x02E8, Irq 3. Add your setting to /etc/rc.d/rc.local if you want it to be set at the boot time. See man setserial for good a overview.tunelp (as root, rarely needed) Tune Up Your Parallel Ports ./sbin/chkconfig --level 123456 kudzu off (as root) A tool to check / enable / disable system services which will automatically start under different runlevels. Typically, I just use RedHat ntsysv utility if I need to enable / disable a service In The Current RunleVel, But Chkconfig Does Give Me An Alternative Tool Is Tksysv (X-Based). The Example Above Shows How To Disable Kudzu Service SO IT does not start up at any runlevel (it messes up mouse on one of my computers) To list all the services started / stopped under all runlevels, I use:. chkconfig --list | moreTo check the current status of services, I may use : service --status-allTo start a service right now, I may use something like (starts an ftp server): service wu-ftpd startTo re-start samba networking (eg, after I changed its configuration), I may use: service SMB RESTARTSYMLINKS -R -CDS / (As root) Check and fix the symbolic links on my system. start from / and progress through all the subdirector (option -r = "recurse"

) And change absolute / messy links to relative, delete dangling links, and shorten lengthy links (options -cds). If my filesystem spreads over different hard drive partitions, I need to re-run this command for each of them (eg, symlinks -r -cds /usr ).cd /usr/src/linux-2.4.7-10make xconfig (as root in x terminal). A Nice GUI Front-End-end for configuration for Compilation of Your Customized Kernel . (The directory name in the example contains the version of my Linux kernel so you may need to modify the directory name if your Linux kernel version is different than 2.4.7-10 used in this example. you need the "Tk" interpreter to run "make xconfig", and the kernel source code installed) The alternatives to "make xconfig" are:. "make config" (runs a scripts that asks you questions in the text mode) and "make menuconfig" (runs a text- Based Menu-Driven Configuration Utility. Try: Less / USR / DOC / HOWTO / KERNEL-HOWTO for more information.AFTER Configurating the Opti ons for the new kernel with "make xconfig", I may proceed with compilation of the new kernel by issuing the following commands: make clean (this is optional; it cleans the old object files, may lengthen compilation, may prevent problems in some situations ) make depmake bzImageThe last command will take some time to complete (maybe 10 min or 2 h, depending on your hardware) It produces the file arch / 386 / boot / bzImage, which is your new Linux kernel Next:.. make modulesmake modules_installNow You Have The New Modules Installed In /Lib/Modules/kernelname.don't rename The module Directory if you want to run multiple kernels - The Kernel Must Be Able To Find ITS "Match"

Modules. If I want to change the kernel name, I have to edit the main kernel makefile (eg, /usr/src/linux-2.2.14/makefile) And Change the lines right at the top. mine (Default RH7.2) ) are: VERSION = 2PATCHLEVEL = 4SUBLEVEL = 7EXTRAVERSION = -10customThe kernel name for the currently running kernel can be displayed using uname -r Mine (default RH7.2) is "2.4.7-10custom" Now I can install the new.. . kernel The installation involves copying the new kernel (while renaming it) into the / boot directory: cp arch / 386 / boot / bzImage /boot/vmlinuz-2.4.7-10customcp System.map /boot/System.map-2.4. 7-10CustomAnd Making Changes To /etc/lilo.conf or /boot/grub/grub.conf So I Can Select At the Boot Time Which Kernel (The Old or the New) To Boot. It is strongly advised That you preserve the old kernel as a boot option (in case the new kernel refuses to boot) .If you use initrd (initial ram disk) for two-stage booting, you may also need to create an image with modules used by the kernel during startup: mkin ITRD /BOOT/INITRD-2.4.7-10Custom.Img 2.4.7-Customsee this for details on kernel Patching. Quick Reference: CD /USR/SRC/LINUX-2.4.7-10PATCH -E -P1

). You may want to run ldconfig after an installation of new dynamically linked libraries on your system. (It is also re-run every time you boot the computer, so if you reboot you do not have to run it manually.) Mknod / dev / fd0 b 2 0 (= make node, as root) Manually create a device file. This example shows how to create a device file associated with your first floppy drive and could be useful if you happened to accidentally erase it. The options are: b = block mode device, c = character mode device, p = FIFO device, u = unbuffered character mode device The two integers specify the major and the minor device number I normally would not know the parameters which mknod requires... So to make devices, I first read man MAKEDEV to figure the name of the device and then run the script / dev / MAKEDEV which knows about Linux devices by their names -. see the next command If the mentioned manual page does not help, I May Refer to the Ultimate Documentation Included with the Kernel Source Code: Less / USR / SRC / Linux /Documentation/devices.txtcd /dev./MAKEDEV audio (as root). Restore the "audio" device that I just somehow screwed up. Also see the previous command.5.13 Hard Drive / Floppy Disk Utilitiesfdisk / dev / hda (= " fixed disk ". As root.) Linux hard drive partitioning utility (DOS has a utility with the same name). In the example above, I specified that I would like to partition the first harddrive on the first IDE interface, hence" hda "

I WERE you, I Would Backup Any Important Data Before Using Fdisk On Any Partition. I do not not know anybody who likes fdisk (Either Linux or dos edition) - I Prefer Easier To Use cfdisk, see next command.cfdisk / dev / hda (as root) Hard drive partitioning utility, menu-based. Easier to use then the plain-vanilla fdisk (see the previous command). Physical drives can contain primary partitions (max 4 per disk), and logical partitions (no .. restriction on number) A primary partition can be bootable Logical partitions must be contained within "extended partitions"; extended partitions are not usable by themselves, they are just a container for logical partitions When partitioning a disk, I typically: (1. Create a primary partition (2) make the primary partition bootable (3) Create An Extended Partition, (4) Create Logical Partition (s) within the extended partition.sfdisk -l -x | more (as root) list the partition Tables (Including Extended Partitions for All Drives On My System.Parted / DE v / hdaA partition manipulation utility for Linux (ext2), and DOS (FAT and FAT32) hard drive partition. It is for creation, destroying, moving, copying, shrinking, and extending partitions. You should really like to backup your data and carefully read info parted before using it.fdformat / dev / fd0H1440mkfs -c -t ext2 / dev / fd0 (= floppy disk format, two commands, as root) Perform a low-level formatting of a floppy in the first floppy drive (/ dev / fd0), High Density (1440 kB). The Make a Linux FileSystem (-t ext2), checking / marking bag blocks (-c). Making the filesystem is an equivalent to the high-level formatting. i Can Also Format Floppies To DiffERENT (Also Non-Standard) Densities; Try Ls / DEV / FD0

.I am also able to format to the default density (normally 1440k) using fdformat /dev/fd0.badblocks / dev / fd01440 1440 (as root) Check a high-density floppy for bad blocks and display the results on the screen. The parameter "1440" specifies that 1440 blocks are to be checked. This command does not modify the floppy. badblocks can be also used to check the surface of a hard drive but I have to unmount the filesystem first to do a full read-write check : mount [to find out which device contains the disk partition I wish to check for bad blocks] umount / dev / hda8 [unoumnt the selected partition] badblocks -n / dev / hda8 [check the selected partition in a non-destructive read- Write Mode, SO That My Data IS Not ERASED!] Mount / dev / hda8 [Mount The Partition Back Since No Info On Bad Blocks Was Printed] IF Bad Blocks Are Found, They Can Be Marked On The Hard Drive So That Will NotB Used Using: E2FSck -c / dev / hda8fsck -t ext2 / dev / hda2 (= file system check, as root) Check and Repair A FileSystem, EG, A fter an "unclean" shutdown due to a power failure. The above example performs the check on the partition hda2, filesystem type ext2. You definitely want to unmount the partitions or boot Linux in the "single mode" to perform this (type "linux Single "

at the LILO prompt or use init 1 as root to enter the single user mode). If errors are found during the filesystem checkup, I accept the defaults for repair.tune2fs -j / dev / hda2 (as root, only for kernel that support ext3 -. RH7.2) Adjust the tuneable parameter of an ext2 filesystem The example above shows how to add a journal to a disk partition (hda2 in this example), effectively converting the file system to ext3 (journaling) filesystem to complete. the transition, you must also edit the file / etc / fstab and change the filesystem type from ext2 to ext3, else you may run into problems -! ext2 down journaled filesystem will not mount an uncleanly shut to check what is the type of the FileSystem Use mount (with no arguments) or cat / etc / mtab. if you need more information on ext3 setup, try: http://www.symonds.net/~rajesh/howto/ext3/ext3-5.html.

Other options of tune2fs let you me add a volume label, adjust the number of mounts after which the filesystem check is performed (maximal mount count), or turn on time-based filesystem checks instead (less often used) .dd if = / dev / fd0H1440 of = floppy_imagedd if = floppy_image of = / dev / fd0H1440 (two commands, dd = "data duplicator") Create an image of a floppy to the file called "floppy_image" in the current directory. Then copy floppy_image (file) to another floppy disk. Works like DOS "DISKCOPY" .mkbootdisk --device / dev / fd0 2.4.2-3Make an emergency boot floppy. you are typically asked if you would like to make a boot disk during the system installation. The above command Shows how to make it it install, on the first floppy driving (/ dev / fd0). Your kernel name (Needed in the command, here 2.4.2-3) Can Be determined Either by running uname -a or ls / lib / Modules .5.14 management of user accounts and files permissionsuseradd user_namepasswd user_name (as root) Create a new account (you must be ro . Ot) Eg, useradd barbara Do not forget to set up the password for the new user in the next step The user home directory (which is created) is / home / user_name You may also use an equivalent command adduser user_namels.. - L / home / peteruseradd peter -u 503 -g 503 (as root). Create An Account To Match An Existing Directory (Perhaps from Previous Installation). If The User ID and The Group ID (Shown for Each File) WERE Both 503, I create an account with a matching user name, the user ID (UID) and the group ID (GID). This avoids the mess with changing the ownership of user files after a system upgrade.userdel user_nameRemove 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 to decide what to do with the files). There is also groupdel to delete groups.groupadd group_name (as root) Create a new group on your system. Non -essential on a home machine, but can be very handy even on a home machine with a small number of users.For example, I could create a group "friends", usinggroupadd friendsthen edit the file / etc / group, and add my login Name and the names of my friends to the line, lis, so what: Friends: x: 502: Stan, Pete, Mariethen, i can change, mariet, i can change, mariet, i can change, mariet belongs to me aND the group "friends" .chgrp friends my_fileThus, the listed members of this group have special access to these files that the rest of the world might not have, for example read and write permission: chmod g = rw, o = MY_FILETHE ALTERNATIVE Would Be Go Give Write Permissions To Everybody, Which IS Definitely Unsafe even on a home computer. groupsList the groups to which the current user belongs. Or I could use groups john to find to which groups the user john belongs.usermodgroupmod (as root) Two command-line utilities to modify user accounts and groups without manual editing of the files / etc / passwd / etc / shadow / etc / group and / etc / gshadow. Normally non-essential.userconf (as root) Menu-driven user configuration tools (password policy, group modification, adding users, etc) . Part of linuxconf package, but can be run separately.passwdChange the password on your current account If you are root, you can change the password for any user using:. passwd user_namechfn (= "change full name"

). Change the information about you (full name, office number, phone number, etc). This information is displayed when the finger command is run on your login_name.chage -M 100 login_name (= "change age"). Set the password expiry to 100 days for the user named login_name .quota usernamesetquota usernamequotaon / dev / hdaquotaoff / dev / hdaA set of commands to manage user disk quotas. Normally not used on a home computer. "Disk quota" means per-user limits on the usage of disk space. The commands (respectively) display the user quota, set the user quota, turn the quota system on the for a given filesystem (/ dev / hda in the above example), turn the quota system off. "Typical" Linux distros I have seen set on default: no limits for all users, and the quota system is off on all filesystems.kuser (as root, in X terminal) Manage users and groups using a GUI Nice and probably covering most of what you may. NORMALLY NEED TO Management User Accounts.chmod Perm FileName (= Change Mode) Change The File Access Permission for the files You Own (Unless You Change Any File). You Can Make A File Accessible in Three Modes: Read (R), Write (W), Execute (x) To Three Classes of Users : owner (u), members of the group which owns the file (g), others on the system (o) Check the current access permissions using:. ls -l filenameIf the file is accessible to all users in all modes it will show .: rwxrwxrwxThe first triplet shows the file permission for the owner of the file, the second for the group that owns the file, and the third for others ( "the rest of the world") A "no" permission is shown as "- ".When setting permissions, these Symbols Are Used:" u "(=

User or owner of the file, "g" (= Group That Owns the file), "O" (= Others), "A" (= all, ie, oowner, group and others, "=" The permission to), " " (= add the permission), "= Take Away The Permission", "R" (= permission to read the file), "W" = (Write Permission, Meanning the Permission to MODIFY THE FILE, "X" (= Permission to Execute THE) .for example, this Command Will Add The Permission To Read The File Junk To All (= User Group Others): CHMOD A R JUNKTHIS COMMAND WILL REMOVE the permission to execute the file junk from others: chmod ox junk Also try here for more info.You can set the default file permissions for the new files that you create using the command umask (see man umask) .chown new_ownername filenamechgrp new_groupname filenameChange the file owner and group. you should use these two commands after you copy a file for use by somebody else. Only the owner of a file can delete it.lsattr filesList attributes for the file (s). Not very often used because the most interesting ATT ributes are still not implemented The attributes can be changed using the chattr command The attributes are:.. A (= do not update atime when the file is modified), S (= synchronous updates), a (= append only possible to this File, c (= file compressed on the kernel level, not implement yet), i (= immutable file), D (= no dump), s (=

secure deletion), and u (undeletable, not implemented yet). An interesting usage may be to make a file undeletable even by root (until s / he clears the attribute) .sudo / sbin / shutdown -h now (as a regular user , I will be prompted for my user password) Run the command "shutdown" (or another command which you have been given permission to run by your system administrator). With sudo, the administrator can give selected users the rights to run selected commands, without handing out the root password The file / etc / sudoers must be configured to contain something like:.. my_login_name my_host_computer_name = / sbin / shutdownpwckgrpck (as root, two commands) Verify the integrity of the password and group files.pwconvgrpconv (as root ) Unlikely you need these commands. They convert old-style password and group files to create the more-secure "shadow" files.5.15 Program installationrpm -ivh package_name-version.platform.rpm (as root) Install a package (option "i ", Must Be The First Letter After the Dash) While Talking to Me A Lot (Option "V '= Verbose) and print" Hashes "to show Installation Progress (Option" H "). RPM Stands for" Redhat Package Manager ".rpm -UVH package_name-version.platform.rpm (as root) Upgrade (Option "U", Must Be the first letter after the dash) a package, while being verbose (option "v") And Displaying hashes ("h"). rpm -ivh --force - nodep package_name-version.platform.rpm (as root) Install the package ignoring any possible conflicts and package dependency problems.rpm -e package_name (as root) Uninstall (option "e" = erase) the package package_name. Please note the absence of " -version.platform.rpm

at the end of the package name (the package name is the same as the name of the * .rpm file from which the package was installed but without the dash, version, platform and "rpm"). rpm -qpi package_name-version. platform.rpmQuery (option "q", must be the first letter after the dash) the yet uninstalled package (option "p") so that it displays the info (option "i") which the package contains.rpm -qpl package_name- Version.Platform.RPMQuery (Option "Q", Must Be the first letter installed package (option "L") of all the files the package contains. rpm -qf a_fileFind the name of the installed package to which the file "a_file" belongs or belonged. Useful if I accidentally erased a file and now I need to find the right package and re-install it.rpm -qi package_nameQuery the already installed Package So That It Displays The Info About Itself. please Note The Absence of "-version.platform.rpm" at the end of the package name.rpm -qai | moreQuery all the packages installed on my system so that they display their info On my simple system, I have ~ 600 packages installed so obviously, I must have a lot of time to read all their info To count your packages,.. Try: rpm -qa | grep -c '' to find a particular package, tryage: rpm -qa | grep -i the_string_to_find (The Option -i Makes Grep Ignore The Case of The Characters, So Upper or Lower Case Letters Will Match. RPM -VAVERIFY (The Option "V") All the packages (option "a"

) Installed on my system. This lists files that were modified since the installation. Here is the legend for the output :. Test passedc This is a configuration file5 MD5 checksum failedS File size is differentL Symbolic link has changedT File modification time changedD Device file is modifiedU User that owns the file has changedG Group that owns the file has changedM File mode (permissions and / or file type) has been modifiedkpackagegnorpmglint (in X terminal, as root if you want to be able to install packages, 3 commands) GUI fronts to the Red Hat Package (rpm) Manager. "glint" comes with RH5.2 and seems obsolete idiot idiot idiot idiot idiot gnorpm is the "official" RedHat GUI package installer, older versions are very slow and confusing but the newer version (the One That Comes with RH7.0) Is Vastly Improved. Kpackage Is The "OFFICIAL"

KDE program and has been pretty good all along. Use any of them to view which software packages are installed on your system and the what not-yet-installed packages are available on your RedHat CD, display the info about the packages, and install them if you want (installation must be done as root) .5.16 Accessing drives / partitionsmountSee here for details on mounting drives. Examples are shown in the next commands.mount -t auto / dev / fd0 / mnt / floppy (as root) Mount the Floppy. The Directory / MNT / FLOPPY MUST EXIST, BE EMPTY AND NOTO / DEV / CDROM / MNT / CDROM (As root) mount the cd. You may need to create / modify the / dev / cdrom file depending where your CDROM is. The directory / mnt / cdrom must exist, be empty and NOT be your current directory.mount / mnt / floppy (as user or root) Mount a floppy as user. The file / etc / fstab Must Be set up to do this. The Directory / MNT / FLOPPY MUST NOT BE Your Current Directory.mount / MNT / CDROM (AS User Or Root) Mount A CD AS User . The file / etc / fstab must be set up to do this. The directory / mnt / cdrom must not be your current directory.umount / mnt / floppyUnmount the floppy. The directory / mnt / floppy must not be your (or anybody else's ) current working directory. Depending on your setup, you might not be able to unmount a drive that was mount by somebody else.5.17 Network administration toolsnetconf (as root) A very good menu-driven setup for your network.ping machine_nameCheck if you can Contact Another Machine (Give The Machine's Name OR), Press C When Done (WITHOUT Keeps Going). As All Linux Commands, Ping Has Options, Including The "Ping of Death"

attack, when it seems you can ping some servers so they die - try the the opitons -f and -s.route -nShow the kernel routing table.host host_to_findnslookup host_to_finddig ip_to_find (. Three commands, use any) Query your default domain name server (DNS) for an Internet name (or IP number) host_to_find. This way you can check if your DNS works. you can also find out the name of the host of which you only know the IP number.traceroute host_to_traceHave a look how your messages trace to host_to_trace (which is either a host name or IP number) .mtr host_to_trace (as root) A powerful and nice tool that combines the functionality of the older ping and traceroute (RH7.0) nmblookup -A ip_addressStatus of a networked MS Windows machine (with an NetBIOS name). This command is an equivalent of Windows nbtstat command.ipfwadm -F -pm (for RH5.2, see the next command for RH6.0) Set up the firewall IP forwarding policy to masquerading. ( NOT VERY Secure But Simple.) Purpose: All Computers from Your Home twork will appear to the outside world as one very busy machine and, for example, you will be allowed to browse the Internet from all computers at once.echo 1> / proc / sys / net / ipv4 / ip_forwardipfwadm-wrapper -F -p Denyipfwadm-wrapper -f -am -s xxx.xxx.xxx.0 / 24 -d 0.0.0.0.0/0 (THREE COMMANDS, RH6.0). Does The Same as The Previous Command. Substitution The "X" s with Digits of Your Class "C"

IP address that you assigned to your home network. See Here for more details.ipchains -p forward denyipchains -a forward -s xxx.xxx.xxx.0/24 -d 0.0.0.0/0 -j Masq (Two Commands, RH7 .0). Same as previous commands, but works under RH7.0.ipchains -LList all firewall rules. Use to check if your firewalling setup works.iptables -LLinux kernel 2.4.x uses new firewalling "iptables". The above example lists the firewall rules.firewall-config (as root, in Xterm). A GUI for building your custom firewall.ifconfig (as root) Display info on the network interfaces currently active (ethernet, ppp, etc). your first ethernet should show up AS Eth0, Second As Eth1, ETC, First PPP over Modem AS PPP0, Second AS PPP1, etc. The "LO" Is The "Loopback Only" Interface Which Should Be Always Active. Use the Options (See iFconfig - HELP) TO Configure the interfaces.ifup interface_name (/ sbin / ifup to run as a user) Startup a network interface. EG: iFup eth0ifup PPP0IFUP PPP1USERS CAN Start Up or shutdown the PPP INTE RFACE ONLY WHEN THE PERMISSITION IS GIVENIN THETCONF). To Start a PPP Interface (Dial-Up Connection), I Normal Use Kppp Available Under The KDE "K"

menu (or by typing kppp in an X-terminal) ./ etc / rc.d / init.d / network restartRestart the network using its normal initialization script (the same which is used during bootup). Useful if you just have manually made changes to your network configuration. Any other service listed in init.d can be stopped, started, or restarted in a similar way (call the script with an options stop, start or restart) .ifdown interface_name (/ sbin / ifdown to run it As a user). SHUT DOWN THE NETWORK INTERFACE. EG: ifdown PPP0 Also, See The Previous Command.netStat | Moredisplays A Lot (Too Much?) Information on The Status of Your Network./usr/sbin/mtr --gtk ( as root, in X windows if you wish the nice gtk-based interface). Network diagnostic tool combining the capabilities of traceroute and ping. Comes with RH7.0.nmap ip_numberMap the ports on the machine with ip_number. REALLY useful to establish the security Of Your Network Configuration As You Can See The Opened Ports. Nmap Is Included on The RH7.0 "Linux Power Tools "CD, as is a convenient GUI front end," nmapfe ". Nmap can also do operating system" fingerprinting ". Normally, people (and their ISPs) do not like their computer ports being scanned (they view it as possbily probing before an attack) so they may complain if they find out -. learn how to use nmap on your own computers else you will soon hear from your ISP (the complaints will go to them) How do I know this ethereal (as root? , in xterminal - View the network trafic going through your computer. include on the rh7.0 "linux power" "

CD. Using ethereal may be unethical in some situations, and unauthorized use in the workplace could be a fireable offence.tcpdump -i ppp0 -a -x (as root) Print all the network traffic going through the first over-the-phone interface (ppp0) as ascii and hexadecimal. Probably too much printout. tcpdump is a rather raw tool and it can be useful for building more "customized" tools for listening to / log what you need.5.18 Music-related commandscdplay play 1Play the first track from a audio CD. Use cdplay to play the whole CD. Use cdplay stop when had enough.ejectGet a free coffee cup holder)). (Eject the CD ROM tray). This command defaults to the cdrom, but could be used to eject . other removable media by specifying the mount point or device Eg, I can eject the zipdisk from a parallel-port (external) zipdrive (as root) using: eject / dev / sda4play my_file.wavPlay a wave file.rec my_file.wavRecord a Wave file from my microphone.mpg123 my_file.mp3play an mp3 file.mpg123 -w my_file.wav my_file . .Mp3Create a wave audio file from an mp3 audio file Useful if you wanted to write a regular audio CD from mp3s - you have to convert the mp3s to the * .wav format first Do not be surprised the conversion is slow-. -decompressing mp3s is very processor intensive.xmms (in X terminal) Nice GUI mp3 player.freeamp (in X terminal) Another GUI mp3 player.lame input_file output_fileMP3 encoder.knapster (in X terminal) Start the program to downoload mp3 files that other Users of napster harness. You May Share Your Mp3S Too. Really Cool, While It Lasts. GNUTELLA AND FREENET WILL SOON Replace Them-> It gets Even Cooler.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.midPlay a midi file. playmidi -r my_file.mid will display text mode effects on the screen.sox audio_file another_format_audio_file (= "SOund eXchange") Convert from almost any audio file format to another (but not mp3s). Seeman Sox for the list of supported audio file formats. SOX Also lets you add special effects to your sound file.kscd (in x terminal) cd player.kmidi (in x terminal) MIDI Player.kmid (in x Terminal) MIDI PLAYER.KMID (IN x Terminal) ) MIDI / CARAOKE Player.kmix (in x Terminal) Sound Mixer.Studio (in xterminal) Sound Studio - Edit Sound Files, Add Effects, etc. Available On The PowerTools CD, RH7.X.EXTACE (in xterminal) Sound Visualization Utility.Festival - TTS my_file.txtsay the content of the my_file.txt file (asCIi text). "Festival" is a sperach synthesizer what comes on the RedHat 7.0 "Linux PowerTools" CD. To say something from the command line, you need to start up "festival" and then, at the "festival>" prompt, type the appropriate command ( "scheme" language interpreter), as In this Example (Bold Repesents The Prompt): FestivalFestival> (Saytext "Good Dog, Really Good Dog) Festival>

(Quit) 5.19 Graphics-related commandskghostview my_file.ps (in X terminal) Display a postscript file on screen. I can also use the older-looking ghostview or gv for the same end effect. I can print the postscript file from the viewer too . .xpdf my_file.pdf (in X terminal) View a pdf file.enscript my_file.txt -U 2Convert a text file to postscript and print it to the default printer I could also send the output to a postscript file: enscript my_file.txt -U 2 -o my_file.psThe option -U 2 makes enscript print 2 logical pages on one physical page which saves me paper, and creates more convenient, compact printouts. You may also select four pages per page, more makes the printout kind of difficult to read. enscript is really flexible, see man enscript to select from among the many formatting options.ps2pdf my_file.ps my_file.pdfMake a pdf (Adobe portable document format) file from a postscript file.mpage -2 my_file.ps> new_file .psprint the postscript file my_file.ps, Outputting Two Logical Pages on one physical page. Save the output to the file new_file.ps.ps2ps file.ps new_file.pspsnup -nup 2 -pletter new_file.ps new_file2.psAnother way of making a postscript file containing 2 logical pages on one physical page. First, I used the "postscript distiller" ps2ps to make the postscript file simpler (at the cost of it becoming much larger). Then, I used the psnup utility to make new_file2.ps which contains 2 logical pages per one physical page. I could have also put 4 or 8 logical pages per one physical page.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 for future editing) and only then flatten it and save as png (or whatever) for use "Learning how to make proper selection is the key." gphoto (in X terminal) Powerful photo editor and camera image acquisition program.kpaint (in X terminal) Simple bitmap paint program ( "paintbrush". - type) .xfig (in X terminal) A simple drawing program. Useful for making elementary sketches or diagrams.dia (in X terminal) A tool for drawing diagrams from pre-built components.display my_picture (in X terminal) Display a picture for . viewing only You can also type display & and select file from the menu to view the image, rotate it, change its colour, apply certain effects, etc. display is part of ImageMagick package, together with several other utilities described below.identify - Verbose My_PICTUREGIVE ME A DESCRIPTION OF An Image File My_PICTURE: F ormat, type, class, size in pixels, number of colours, size in bytes, etc.convert -geometry 60x80 my_picture.gif out_small_picture.gifScale a picture to a size 60x80 pixels. See a few line down for an example how to use convert to convert between different graphical file formats.animate -delay 6x5 pic1 pic2 pic3Keep showing two or more pictures in sequence. in the example above, the picture files are named pic1, pic2 and pic3, the delay between pictures is 0.06 second, and the whole Presentation sequence is repeted in 5 Seconds.comBBINE PIC1 PIC2 Combined_pic.miffcombine Two or more images to another image. You Can for Example Put a logo on every image.montage -geometry 800x600 0

0 my_picture montage.miffCreate a tiled image from my_picture so that the total size is 800x600 pixels, with 0x0 border. The output goes to the file montage.miff.zgv my_pictureDisplay a picture for viewing on a vga screen (no X necessary) .giftopnm my_file.giff> my_file.pnmpnmtopng my_file.pnm> my_file.pngConvert the proprietary 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) .xwd -out my_cupture_screen_file.xwd (in X terminal) Capture the contents of X-windows screen into a graphics X-windows "dump" file (* .xwd). You can later convert the xwd file into your favourite format using the convert utility. Unde KDE, you can also use the keyboard shortcuts or to copy the current window or the entire desktop INTO the clipboard.convert my_capture_screen_file.xwd my_capture _screen.jpgConvert the X-windows screen dump file (* .xwd) into the * .jpg file format. The convert utility can convert graphics from / to many different file formats.import -display 192.5.100.10:0 -window root my_file. jpegCapture the contents of the root screen from X-windows runnning on server 192.5.100.10 display 0. The output file is my_file.jpeg (change the file format by giving it an appropriate filename extension). You need to have the permission to write to The screen in Order to Be Able To Capture ITS Content (The Permission To Everybody Can Be Given by Running Xhost

转载请注明原文地址:https://www.9cbs.com/read-33224.html

New Post(0)