unix notes: - del mar collegeacademy.delmar.edu/courses/itsc1358/handouts/unix…  · web viewunix...

26
UNIX/Linux NOTES Page 1 UNIX/Linux Notes Professor: Michael P. Harris v.20120902 UNIX is a multi-user, multi-tasking operating system originally developed at AT&T Bell Laboratories. It provides utilities/programs for editing text, sending email, preparing tables, performing calculations, Internet access, and many other specialized functions that require separate application programs in other operating systems. One of the key identifying features of UNIX/Linux is the standardized directory and file structure – the fiesystem. Typical UNIX/Linux (root) / Directory structure: ┌───┬────┬───┬───┬───┬───────┴───────┬───┬────┬────┬───┬───┬───┐ bin boot etc dev lib home lost+found mnt root sbin sys tmp usr sys default ┌────┬─┴───┐ ┌───┬┴───┐ ┌───┬───┬───┴┬────┐ mike teri shea fd0 hda1 sda bin lib sbin share X (Users home directories) (mounted volumes) (installed apps) The most important versions of UNIX are releases that started at AT&T, the latest being System V Release 4. Other important UNIX versions have come from the University of California at Berkeley; called BSD. Microsoft’s Xenix, (before MSDOS) was an early popular microcomputer implementation of UNIX based on AT&T release System V. Major versions of UNIX include: SunOS, Solaris, SCO UNIX, AIX, HP/UX, and ULTRIX. GNU Linux is currently the leading popular “Open Sourceimplementation of a UNIX clone standard operating system. POSIX is the validation standard , set for UNIX-like operating systems. Starting with Windows 2000; Windows XP, Vista and Windows 7 -all have POSIX compliant kernels. Popular Linux OS distributions include: GNU, Ubuntu, Fedora, Debian, Redhat, Knoppix, Puppy, DSL, Gentu, Cygwin, and TinyCore. Since it started more than 50 years ago, UNIX has grown and changed in a different way from most operating systems. Many early UNIX users were computer and scientific professionals; more than a few of them extended UNIX by adding tools and

Upload: trinhnhi

Post on 26-Mar-2018

218 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 1

UNIX/Linux Notes Professor: Michael P. Harris

v.20120902UNIX is a multi-user, multi-tasking operating system originally developed at AT&T Bell Laboratories. It provides utilities/programs for editing text, sending email, preparing tables, performing calculations, Internet access, and many other specialized functions that require separate application programs in other operating systems. One of the key identifying features of UNIX/Linux is the standardized directory and file structure – the fiesystem.

Typical UNIX/Linux (root) / Directory structure: │ ┌───┬────┬───┬───┬───┬───────┴───────┬───┬────┬────┬───┬───┬───┐ bin boot etc dev lib home lost+found mnt root sbin sys tmp usr sys │ │ │ │ default ┌────┬─┴───┐ ┌───┬┴───┐ ┌───┬───┬───┴┬────┐ mike teri shea fd0 hda1 sda bin lib sbin share X (Users home directories) (mounted volumes) (installed apps)

The most important versions of UNIX are releases that started at AT&T, the latest being System V Release 4. Other important UNIX versions have come from the University of California at Berkeley; called BSD. Microsoft’s Xenix, (before MSDOS) was an early popular microcomputer implementation of UNIX based on AT&T release System V. Major versions of UNIX include: SunOS, Solaris, SCO UNIX, AIX, HP/UX, and ULTRIX.

GNU Linux is currently the leading popular “Open Source” implementation of a UNIX clone standard operating system. POSIX is the validation standard, set for UNIX-like operating systems. Starting with Windows 2000; Windows XP, Vista and Windows 7 -all have POSIX compliant kernels. Popular Linux OS distributions include: GNU, Ubuntu, Fedora, Debian, Redhat, Knoppix, Puppy, DSL, Gentu, Cygwin, and TinyCore.

Since it started more than 50 years ago, UNIX has grown and changed in a different way from most operating systems. Many early UNIX users were computer and scientific professionals; more than a few of them extended UNIX by adding tools and functionality to do what they needed. UNIX was also used to develop a lot of the powerful networking systems that connect the world, such as the Internet. So, whereas most operating systems were typically developed and controlled by one corporation, UNIX has been developed through a collective effort. This has meant more versions than corporate standard operating systems like MSDOS & Windows, but it has also helped to make UNIX and Linux the flexible and incredibly powerful operating systems that they are today.

UNIX and its derivatives were not designed as "user-friendly" operating systems, in fact, UNIX has, in the past, earned its label of "user-hostile."

Page 2: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 2

Most modern versions of UNIX can also work with windowing system GUIs (Graphical User Interfaces) which allow each user to have more than one "terminal" on a single display. The X Window System (called X for short) is the most common UNIX window system. The appearance of X Windows may vary between systems due to different window managers. Some of the most common window managers are: mwm (Motif Window Manager), CDE (Common Desktop Environment) and the new Linux windows shells: Gnome, KDE, LXDE, Unity, fluxbox, flwm, FLTK, gtk2, iceWM, xfce and others.

Page 3: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 3

Getting Started

UNIX/Linux can be overwhelming at first with its barrage of details. To get started though, all you need to do is master just a few details:

o How to Log in and out of your system.o Understand the Shell and how to control the system with control

characters.o Learn the important UNIX/Linux specific directories and files (the

filesystem).o Manage UNIX/Linux files and directories, including listing, creating,

copying, printing and removing files, and moving in and out of directories.

o Work efficiently using UNIX/Linux redirection, pipes, filters, and multi-tasking.

Logging In

Before you can start using UNIX/Linux and its facilities, the Super User (root system administrator), has to set up a user account for you with your login name, password, and home directory. At many sites, there will be a whole network of UNIX/Linux computers so you may also have to know the hostname of the computer that has your account as well. When you login at your terminal you should see a message from the UNIX/Linux OS that looks something like:

login:

Logging in is the process of making yourself known to the UNIX/Linux computer and getting into your account. On remote systems you will need to run a remote login program like telnet, ssh, rxvt, or rlogin. In this case your login session might look similar to the following: (what you type is in bold)

ssh mercury.delmar.edu

Sun Solaris OSmercury.delmar.edu: Solaris UNIX version 10.01.10

login: mpharrisPassword: ********Last login: Sat Sep 1 14:34 CST 2012, from

mercury.delmar.edu

motd: The "crisis" of Today is the "joke" of Tomorrow

REMEMBER !!!

Page 4: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 4

We will be shutting down at 4:30pm for system backups.

Wed Sep 5 12:24:48 CST 2012

[mpharris@mercury] ~ $_

Page 5: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 5

The UNIX/Linux Shell

Once you've logged into a UNIX computer, you're working with a program called the shell. The shell interprets the commands you enter, runs the programs you've ask for, and generally coordinates what happens between you and the UNIX/Linux operating system. There are four shells in common use: the Bourne shell, Korn shell, Bash and C shells. For the novice the differences are slight however some to run some software or execute some program (especially shell scripts) you will need to know which shell you are using (ask your system administrator). The only immediate difference you will see is that the Bourne, Korn, and Bash shells prompt you with $_ while the C shell most often uses %_ as the prompt. Certain keyboard commands (keystrokes) are interpreted by the shell, these are commonly called control characters. The basic control characters are:

Ctrl-C or [DEL] Interrupt character (interrupts or cancel a command)Ctrl-D Returns you to UNIX command level. Used to signal

end of input. ** Also logs you off of most UNIX systems

Ctrl-H or [BACKSPACE] Erase character to left of cursorCtrl-Q Restart output after paused by Ctrl-SCtrl-S Pauses output to the screenCtrl-U Erase the whole input line so you can start over

UNIX/Linux vs. MSDOS

The UNIX/Linux operating system has been around much longer than MSDOS. While MSDOS owes much of its original heritage to a single-user microcomputer operating system named CP/M, MSDOS evolved gaining more and more UNIX/Linux like capability. MSDOS is not case sensitive meaning that commands can be typed in either upper or lower case and MSDOS treats them all as if they were typed in UPPER CASE. UNIX/Linux is case sensitive meaning that there is a difference between a command typed in upper or lower case. The UNIX/Linux standard is that commands are typed in lower case. A brief comparison of MSDOS and UNIX/Linux command equivalents follows:

CD pwdCD DIRNAME cd dirnameCHKDSK fsckCOPY FILE1 FILE2 cp file1 file2COPY FILE1 + FILE2 FILE3 cat file1 file2 >file3COPY FILENAME PRN pr filename | lprDIR ls -halDIR /W ls -CDIR /P ls -hal | more

Page 6: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 6

DEL FILENAME rm filenameMD DIRNAME mkdir dirnameREN FILE1 FILE2 mv file1 file2RD DIRNAME rmdir dirnameTYPE FILENAME cat filename

Page 7: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 7

File Access and Permissions

An important point to always remember is that in UNIX/Linux everything is a file. The textbook definition of UNIX usually goes something like this...

UNIX - a multi-user/multi-tasking interactive operating system developed by AT&T. UNIX has a directory structure that is tree-like with files containing all the information that is part of the system.

Most people familiar with microcomputers and MSDOS are familiar with the tree-like directory structure with directories, sub-directories and pathnames. But in UNIX/Linux the directory structure and file system is the heart of the system. UNIX/Linux is also device independent --therefore no duplication of commands is necessary for different devices such as the screen, printer, or disk drives.

For example, UNIX/Linux always keeps the files in its directory structure in sorted order, therefore to rename a file, is really moving that file within the directory structure. To copy that file to another directory, to the screen, or to a floppy disk drive is the same command because UNIX/Linux commands are device independent, everything is a file, the destination directory, the screen, the auxiliary storage device are all files to UNIX. This concept may take a little getting used to before all that is means sets in.

To log into a UNIX system your terminal must be described to the system. In the directory /dev the system device files (files that contain the hardware interfacing information UNIX/Linux needs) are contained. In addition, your terminal type is stored in /etc/ttytype, your terminal speed in /etc/ttys, and your terminal setup and capabilities data in /etc/termcap. The advantage of this system is obvious, if you change your terminal or enhance its capabilities, your just edit the system files. In addition you can have multiple definitions and settings for multiple different users.

Most UNIX/Linux executable commands (utilities) are kept in the /bin, /sbin, and /usr/bin directories with miscellaneous system data files kept in the /etc directory. UNIX/Linux commands are usually short and terse and most always in lower case. UNIX filenames may include A-Z, a-z, 0-9, . and _. After UNIX/Linux boots from the kernel code stored in the /boot or /sys directory, startup files in the /etc/init.d and /etc/profile.d directories are executed. The /etc/profile global user login configuration file and each users private ~/.profile login configuration file are executed. These are the equivalent to the MSDOS CONFIG.SYS and AUTOEXEC.BAT files. The system default setup information is stored in files in the /etc/default directory.

When users log into a UNIX/Linux system, their access is controlled by password and access information stored in the /etc/passwd and

Page 8: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 8

/etc/group files. Once logged in users are met by the users login message-of-the-day stored in the /etc/motd file and then the global /etc/profile followed by the users personal startup and setup commands are executed from their own private .profile file stored in their /home/username login home directory.

Page 9: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 9

Once logged into a UNIX/Linux system, file access is controlled by the standard UNIX/Linux permissions: r w x −. The permission settings are for Read, Write (change), eXecute, and permission denied (−). The permissions are grouped into a sets of three; rwxrwxrwx where the first three are the permissions for the user/owner of the file, the second three are the permissions for members of the group assigned to the file and the last three permissions are for all others who may wish access to the file. The command chown is used to change the user/owner of the file. The command chgrp will change the group assigned to the file. And the command chmod (for change access mode) will change the file permissions.

As an example, assume the ls command (list directory) gave you the following permission settings for the file /etc/motd... is −rwxr-x--xThe first “–”indicates this is a normal file. The next nine permission settings would indicate that the owner (usually root) has Read, Write, and eXecute permissions to the file. Those who have the assigned group access permissions can Read and eXecute the file, all others may only eXecute the file.

When changing the access mode permissions to your files with the chmod command, you have the options of typing: a, u, g, and o (for All, User/owner, Group, and Others) the syntax is:

chmod -options filename…where options can include:

(1) a, u, g, o (2) +, -, or = and (3) r, w, x in any combination.

For example: chmod g+rx myfile would add Read and eXecute to the group portion of the permission settings.

Alternate Input / Output, Piping, and Redirection

The Unix/Linux commands for redirecting Input and Output are:

> redirect output < redirect input>> redirect output append << redirect input (here)| pipe (output into input) tee split output into two streams

For example: who | sort > wholist

…would execute the who command (generate a list of who is currently logged on to the system) and pipe the output into the input of the sort command (alphabetize) and then the sorted list would be redirected/written to the file wholist.

And with... banner < wholist >> register

Page 10: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 10

…the contents of the file wholist is fed into the command banner (which generates large bannerized letters) and add this output to the end of the file register.

Page 11: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 11

UNIX/Linux Directory GuideTypical UNIX/Linux (root) / Directory structure: │ ┌───┬────┬───┬───┬───┬───────┴───────┬───┬────┬────┬───┬───┬───┐ bin boot etc dev lib home lost+found mnt root sbin sys tmp usr sys │ │ │ │ default ┌────┬─┴───┐ ┌───┬┴───┐ ┌───┬───┬───┴┬────┐ mike teri shea fd0 hda1 sda bin lib sbin share X (Users home directories) (mounted volumes) (installed apps)

/ UNIX/Linux root directory

/bin, /usr/bin UNIX/Linux binaries (commands/utilities)

/boot UNIX/Linux file system boot loader programs

/etc System configuration data files

/etc/default System default setup files

/dev Peripheral device control (driver) files

/home Users personal directories (contains user login directories)

/lib, /usr/lib Libraries for the 'C' compiler

/lost+found Depository for misplaced files

/mnt Directory containing empty directories to mount file systems

/proc System processes control files

/root The Super User (root) login directory

/sbin, /usr/sbin Administration binaries (commands) files

/sys Code for UNIX kernel (operating system)

/tmp Temporary files (may be auto deleted)

/usr/share Shared user files and installed application packages

/usr/share/man Online manuals for commands and files

Page 12: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 12

/var/spool Print spooler master directory

Page 13: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 13

UNIX/Linux File Guide. Name of current directory

.. Name of current directory's parent

~/.profile Set up environment at login (user personal startup file)

/etc/bashrc Bash restart cold (e.g. cold start configuration file)

/etc/dircolors Configuration file for the dircolors utility (command)

/etc/fstab Log/table of mounted filesystems

/etc/group Designate user group 'names'

/etc/init.d/* Directory of system initialization and startup files

/etc/motd Message Of The Day -login message for users

/etc/passwd Defined system users and access information

/etc/printcap Define standard printer setup information and capabilities

/etc/profile User set up environment at login (global startup file)

/profile.d/*.sh Directory of user/application shell script startup files (*.sh)

/etc/shells List of available login shells (ex. sh, bash, ksh, …)

/etc/termcap Define standard terminal setup information and capabilities

Sample UNIX/Linux /home directory with subdirectories: / │ home ┌─────────────┬──────────────┬┴─────────────────┬─────────┐adam betty edward mark │ ┌───┼────┐ ┌──┴─┬───┐ ┌─────┴┬───┬────┐ ├demo1 memo etc letter util fax pgms news bin fax make └demo2 │ │ │ │ │ ├mm1 ├let1 ├fax1 ├jan ├mod1.c

Page 14: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 14

└mm2 ├let2 └fax2 ├feb └mod2.c └let3 └mar

All users have a personal .profile or .bash_profile in /home/username/.profile

Page 15: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 15

Unix/Linux Commands: Prof. Michael P. Harris, CCNA, CCAI(a working command set) ITSC 1358 – Unix/Linux System Admin.

[, [[ Alias for the test boolean expression command. [[ is an enhanced test.(( Enhanced form of the let Integer math expression command.adduser, useradd Used by root to add user to system. Usage: adduser useridalias, unalias Assign name to specified command list. e.g. create a macro commandat Execute a shell script at specified time. Usage: at [-f] file time

atq, atrm atq shows, and atrm removes, pending jobs queued by at.awk, gawk, nawk Search for and process patterns in a file. A shell scripting language.banner Print banner to standard output. Usage: banner [option] charactersbash Bourne Again SHell. This is the default shell in most Linux installations.busybox Multi-call command library –acts like the command name used to call it.bzip, bzip2 Compress files with an algorithm different from gzip. See also: lzma bunzip, bunzip2 Uncompress files compressed with bzip. See also: gzipcc, c++ Invoke the C and C++ program compilers. See also: gcc, g++cal Display a 12-month or a one-month calendar. Usage: cal [month] yearcat Concatenate/combine stdin to stdout. Read or display files.cd Change working Directory. Usage: cd path, cd, cd ~, cd .., cd —cfdisk Similar to fdisk, but menu-driven, create/edit partitions. See: fsckchmod Set permissions (access modes) for files or directories. See also: umask

Page 16: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 16

chgrp Change the group associated with a file. Usage: chgrp [-R] group files chown Change the user/ownership of a file. Usage: chown [-R] userid fileschsh Change default shell. See also: sh, bash, ksh, csh, tcsh, zshclear Clear screen command. (tput clear)cmp Compares two text files for differences. See also: diff, diff3, uniqcomm Compare sorted text files. See also: sort, diff, diff3, uniqcompress Compress (uncompress) files to the older .Z file format. See: gzip, zcatcp Copy one or more files. Usage: cp [-r][-p] source target[directory]crontab Schedule command(s) to run at regularly specified times. See also: atcsh The C shell. See also: bash, ksh, sh, csh, tcsh, bsh, ash, and zshcut Select characters or TABed fields from files/lines of input. See: pastedate Display or set date and time. Not related to time. Usage: date [date]df Display disk free space and disk capacity on physical devices. See also: dudiff Display differences between two files. See also: diff3, uniq diff3 Compare three files and reports on differences. See also: uniqdu Display information on disk usage and file sizes. ex. du / –bh | lessecho Display text/arguments to standard output. ex. echo $PATH, echo ~emacs A very powerful screen oriented text editor. See also: vi, vim, nanoenv, printenv Display, or set a new value to, the environmental setting variables.

Page 17: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 17

eval Scan and evaluate the command line. See also: let, expr, testex An interactive command-based editor. See also: vim, vim, sedexec System call which creates a subshell to execute a binary or a script.exit exit (terminate) a command-line shell. Also to logout of a shell.expand Convert tabs in files to spaces and write to standard output.export Place the value of a variable in the set environment (make it global).expr Evaluate an expression and displays the result. See: let, eval, testfalse Null command that returns an unsuccessful exit status. See also: truefc View, edit, execute commands from the command history. See: historyfdisk Utility used to partition hard drives. See: cfdisk Usage: fdisk device

file Display the classification of a file(s) based on the type of data within.find Find files matching a large variety of search criteria. ex. find . –type dfinger Display information about a specified userid or userids. See also: pinkyfmt Simple text formatting utility. Make lines the same length. See also: prfold Break lines of text files so they are no wider than a given length. See: fmtfree Display used/free system memory along with other useful information.fsck File System Check and Repair. Filesystem diagnostics.ftp File Transfer (Protocol) over the network. See also: tftp, scp, wget

Page 18: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 18

gcc, g++ Invoke the GNU C or C++ compiler. See also: cc, c++grep, fgrep, egrep Find a string or pattern within a file(s). Usage: grep pattern [files]groups Show which groups you are a member of. See also: id, whoamigrub GNU GRand Unified Bootloader. Boot multiple OSs. See also: lilogzip, gunzip Utility used to compress or uncompress files. (.gz, .tar.gz, or .tgz)halt Shut down system as root, without reboot, immediately. See: shutdownhash Remember the location of commands in the search path.head Display the first part (10 lines default) of a file. See also: tailhistory View and manipulate the shell command history list. See also: fchost Look up host names using a domain server. See also: hostname, unamehostname Display/set the hostname (computername). $HOSTNAME /etc/HOSTNAMEid Display your userid and groupid. See also: logname, groups, whoamiinetd Daemon which starts other daemons on demand. See: /etc/inetd.confifconfig Display information on network interfaces that are currently active.info Display system information. This is the GNU hypertext reader. See: maninit Master process, runs at bootup, executes commands in: /etc/inittabjobs Lists current running jobs/programs. See also: ps, pstree, topkill Send a signal to terminate a job or process. ex. kill –9 pidksh Korn SHell. See also: bash, sh, ksh, csh, tcsh, and zshldd List/locate the shared libraries on which a given executable depends.

Page 19: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 19

less Improved more command. Display text files, many options. See: morelet Evaluate a integer numeric expression. See also: (( )), eval, testlilo LInux LOader, install a boot loader on a device boot sector. See: grubln, ln −s Create a link to a file. Create hard links and/or −s symbolic links.locate Find files that that match a pattern; easier syntax than find. (updatedb)login Login to the Unix/Linux operating system. See also: ssh, logoutlogname Consult /etc/utmp for user's login name. See also: who, id, hostnamelogout Execute logout as individual user and bring up the login: prompt. ^Dlpr Send file to be printed, used with pr. See also: lpq, lprm, /var/spool lpq Printer queue, show print jobs that are waiting to be printed. lprm Cancel a print job from a print queue.ls List directory contents. ls –hal, ls –FAC, ls ––color, ls –FRACmake Keep a set of programs current, works by executing the script makefile.makewhatis Create database used by apropose and whatis. /usr/share/man/whatis

man, ––help Display information from online the Unix reference manual. See: whatismc Midnight Commander file manager and visual shell. Also: mcedit, mcviewmkdir Make (create) a directory. See also: cd, rmdir, rm –rd, mvmkfs Make (create) a File System –format a device or partition. See: dd

Page 20: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 20

mkswap Create a Linux swap space on a specified hard disk partition. See: swaponmore List file contents, stopping after each full screen. Q exits. See: lessmount, umount Mount a partition as a directory in the filesystem. See: /etc/fstabmv Move (rename) files and directories. See also: cp, cpio, ddnice Set the runtime priority of a program. Usage: nice program_name

od Octal Dump –display contents of a file in octal/hex. See: hd, hexdumppasswd Change your login password. See: /etc/passwdpaste Join corresponding lines from files. See also: cut, split, joinpathchk Determine the validity and portability of filenames. See also: cygcheckperl Practical Extraction & Report Language. Scripting language. See: pythonping Check if an Internet computer is responding (online). See: traceroutepr Paginate files for printing; used with lpr. See also: fold, fmtps Displays processes status. Usage: ps -a See also: top, jobs, top, kill pstree Display processes in the form of a parent/child tree structure. See: pspwd Print absolute path of the Working (current) Directory. $PWD, $OLDPWDpython Interpreted, interactive, object-oriented scripting language. See: perlread Read a line from standard input into the variable $REPLY. See: echorm Remove files or [-r] directories. Usage: rm [-r][-rd] filepath

rmdir Remove empty directories. See also: rm –r

Page 21: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 21

rmuser Remove user account from the filesystem. See also: userdel, adduserroute Show the routing table entries. Usage: route [-n]rpm Invoke the Redhat Package Manager in command line mode. See: yumrxvt A terminal program, like xterm, with less features and uses less memory.sed Edit a file stream (redirect). Also a tool for processing text files.set, setenv Set or display values of shell variables. See also: env, export, declaresh The standard Bourne SHell. See also: bash, ksh, csh, tcsh, and zshshutdown Reboot/shutdown system as root. Usage: shutdown [-h] [-r] minutes

sleep Create a process that sleeps for specified interval. See also: waitsort Sort and/or merge files. See also: uniq, diff, cut, paste, join, splitsource Run a shell script in the current shell/environment. Alias: “.” (dot)split Split a file into specified number of segments. See also: csplit, cutssh Secure remote login SHell. See also: telnet, rlogin, rsh, xtermstartx Front-end to xinit (xterm), start X-clients/X-server window managers.su Simulate User -login as another user, including root (Super User).sudo Super User DO, allow users root permission to run tasks. /etc/sudoersswapon, swapoff Enable or disable swap disk (file) usage. See also: mkswapsymlinks Provide a list of, and information about, symbolic links. See: ln -s

Page 22: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 22

sync Write memory buffers to physical devices for safe removal. See: rsynctail Display the last part (default 10 lines) of a file. See also: head, tactar Tape ARchive, file compression/archiving utility. tar [–xcvf] file.tar

tcsh Extended version of the C-shell, csh. See also: bash, ksh, sh, and cshtee Copy standard input to standard output and to one or more files. Also “|”telnet Remote login over the network. See also: ssh, rsh, rlogin, xtermtest Evaluate a boolean expression or compares arguments. Alias: [ and [[tftp User interface to TFTP (trivial FTP) protocol. See also: ftp, scp, wgettime Display run times for current shell programs and processes. See: uptimetop Dynamically display process status. See also: ps, pstree, jobs, killtouch Create an empty file or update access and modification times of a file.tr TRanslation utility, replace specified characters in a text file.true A null command that returns a successful exit status. See: falsetty Show information that represents your terminal and terminal pathname.umask Establish the file-creation permissions mask. Usage: umask xyzumount Finish writing to a device and unmount it from the active filesystem.uname Displays information about the UNIX OS system. Usage: uname [-a]

Page 23: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 23

uniq Display lines of a file that are unique. See also: diff, cmp, communzip Uncompress files compressed with zip, compatible with DOS PKzip.updatedb Script used to build/update the database used by locate.uptime Show the system up time, number of users, and average load. See: timeuserdel Remove user account (as root). The user's home directory is not deleted.users Prints list of users on the system. See also: who, groups /etc/passwdvdir Variant of the ls command. Defaults to printing a long listing.vi Standard screen oriented VIsual editor. See: vim, view, nano, mcedit view vi/vim in read-only mode. See also: less, mcviewvim Vi IMproved, vi editor. See also: vi, view, nano, and mceditwait Wait for a background process to terminate. See also: sleepwc Word Count, display number of lines, words and/or characters in a file.wget File transfer utility using HTTP, FTP, and other Internet protocols.whatis Display a one-line summary about a specified command. See also: manwhereis Find utilities/files from standard locations. See: makewhatis, locatewhich Find utilities/commands using the search path. See: locate, whereiswho Display information about currently logged in users. See also: users, idwhoami, who am i Display information about the userid that is currently logged in. See: idxterm Start an X-Window terminal session. See also: rxvtzcat Read to stdout files that have been compressed with gzip or compress.

Page 24: UNIX Notes: - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/Handouts/UNIX…  · Web viewUNIX was also used to develop a lot of the powerful networking systems that connect

UNIX/Linux NOTES Page 24

zip, unzip Zip compress/uncompress utility compatible with DOS PKzip. See: gzip