The man Command
To obtain information on any Unix command, use the on-line manual pages.Syntax: man commandIf you do not know the name of the actual command you need, execute man with the -k option.
man -k keywordFor example, to find out all the commands related to directories, type
man -k directoryThis command outputs information to your screen about the commands that pertain to directories, along with a brief description of each command's functions. To access man pages for local utilities, add/usr/local/man to your path variable.
Printing a Hardcopy of a man page
To print a hardcopy of a manual page, redirect the output to a file, and then send this file to a printer using one of the printing commands, as in the following example:To generate a file for hardcopy output of the ls command, typeman ls > ls.txt (SGI, Sun, HP Alpha)
You can then send the formatted file to a printer using qpr ls.txt.
Directory Commands
The Unix file system allows users to create several levels of subdirectories for logically grouping files. This section describes the basic utilities for creating these directories and moving around within them.
Creating a Directory (mkdir)
The mkdir command allows you to create directories.- Syntax: mkdir [options] directory
- mkdir memos
- mkdir projects samples
- mkdir /users/jones/memos/old
3.2.2 Removing Directories (rmdir)
To remove a directory, use the rmdir command. Note that you must first delete all files within a directory before deleting the directory itself.- Syntax: rmdir directory
- rmdir old
- rmdir memos/old
- Syntax: rm -ri directory
3.2.3 Moving around Directories (cd)
To move around in your directory structure, use the change-directory command, cd. The cd command specified by itself without any arguments will always return you to your login directory.- Syntax: cd directory
- cd memos
- cd /users/jones/samples
3.2.4 Directory Shortcuts
You can use shortcuts when specifying your directory pathname. Examples here show how to use these shortcuts with the cd command, but they can be used with any of the Unix commands when specifying filenames. Your home directory can be used as a starting point when specifying pathnames by using a tilde (~). The tilde instructs the shell to start the pathname from your home directory.For example, from the directory, /users/jones/memos/old, change to the subdirectory, /users/jones/samples with the command- cd ~/samples
- cd ~username
- cd ../samples
3.2.5 Present Working Directory (pwd)
When moving around the Unix file system, it is helpful to check your present working directory, with the pwd command.- Syntax: pwd
On-line Information
- man mkdir
man rmdir
man cd
man pwd
man rm (see option -ri)
Return to top of page
3.3 File Commands
3.3.1 Listing Directory Files (ls)
To list the files in any directory, use the ls command.- Syntax: ls [options] [filename_spec]
- To list all the Unix hidden files, such as .login or .cshrc in
your home directory, enter- ls -a
- For a long listing that shows file protections, size, and date,
enter- ls -l
- To recursively list all the files in the current directory and
any subdirectories of the current directory, enter- ls -R
- It is sometimes useful to use the ls command in conjunction
with other Unix commands. For instance, if there are too many files
in a directory to fit on one screen, the output can display to the
screen a page at a time.- ls -l | more
- To search for a subset of files, use the ls command with
the Unix search command, grep. To find all files written
on a particular date, enter- ls -l |grep 'Jun 25'
3.3.2 File Protections (chmod)
Following are the protections that can be set on a file with their symbolic or numeric representations.Symbolic Numeric Protection r 4 Read access w 2 Write access x 1 Execute accessWith the chmod command, you can modify protections on a file for three classes of users: the user (u), group (g), or others (o) by entering
- Syntax: chmod ugo filename
- chmod 764 filename
- -rw-r--r-- 1 waukau 5417 Jun 6 05:28 test
- -rwxr-xr-x 1 waukau 5417 Jun 6 05:28 test
- chmod +x filename
- chmod g-w, o-w filename
3.3.3 Default File Protections (umask)
You can set up a default file protection for all new files created by using the umask command in your .login file.- Syntax: umask ugo
- To remove write access for group and others, specify
umask 022 - To remove all access for group and others, specify
umask 077
3.3.4 Copying Files (cp)
Use the cp command to make a copy of a file.- Syntax: cp [options] old_filename new_filename
3.3.5 Renaming Files (mv)
To rename a file, use the mv command.- Syntax: mv [options] old_filename new_filename
3.3.6 Deleting Files (rm)
To delete a file or files, use the rm command.- Syntax: rm [options] filename
- rm -i *.f
3.3.7 File Searches (grep)
At times, it is necessary to search through your files for a particular string of characters. The command to perform searches is grep.- Syntax: grep string file1 [file2 . . .]
- To search all files in the directory for the string, "May," enter
grep May * - To find any occurrence of the string, "May," regardless of letter
case, use the -i option.
grep -i May *
This would find strings such as "may," "maybe," or "MAY," along
with any other occurrence of that string.
- grep -i May * | more
3.3.8 Viewing Files (more, cat, head and tail)
There are a number of commands that can be used for viewing files in the Unix operating system. This section will describe a few of these.The more Command
The more command outputs a file to the screen a page at a time. To view the next page, press the space bar. To see just one new line at a time, press RETURN. The more utility also allows you to perform some basic editing functions such as string searches, moving forward and backward in the file, and entering the vi editor. CTRL-c aborts a more session.- Syntax: more [options] filename
ib Move backward by screens, where i is the number
of screens
if Move forward by screens, where i is the number
of screens
/string Search forward for string. Backward searches are not
possible.
The cat Command
The cat command will also display file contents to a screen.- Syntax: cat filename
- cat > filename
- cat file1 >> file2
The head Command
To view the first ten lines in a file, use the head command.- Syntax: head [-count] filename
- head -20 filename
The tail Command
To view the last ten lines in a file, use the tail command.- Syntax: tail [-count] filename
- tail -20 filename
3.3.9 Pattern Matching
In the previous sections, examples were given for matching exact strings. There are also certain metacharacters available in Unix that allow more flexibility in performing string searches.Matching Any Single Character in a String Expression
You can use a period (.) to match any single character in an expression, and concatenate periods to represent an exact number of characters, as in the following example.To search a file for dollar amounts in the ten-thousand-dollar range, enter- grep 10,... proposal
Matching Any Single Character in a File Name Specification
When specifying file names, use a question mark (?) to match any single character, and concatenate question marks to represent an exact number of characters. For example, entering- ls -l plot?.dat
Matching Any Number of Occurrences of a Character
In an expression or filename specification, an asterisk (*) stands for any string of characters, even a null one. For example, to find all derivatives of the word meteorology in a file, enter- grep 'meteor*' filename
- ls -l *.f
On-line Information
- man ls
man chmod
man umask
man cp
man mv
man rm
man grep
man more
man cat
man head
man tail
Return to top of page
3.4 Process Monitoring
It is important to recognize that in an X Window environment, a single user can generate a minimum of five processes just by logging on to a system, and can expand this number exponentially, depending on the number of windows open and software being executed. Therefore, you need to be conscientious about the number of CPU and memory resources you are using. This section will describe some of the Unix commands that you can use to monitor your processes.
3.4.1 The ps Command
The ps command is a general utility for checking process status. It reports information such as current percentage of the CPU being used by processes, percent of memory, accumulated CPU time, and other statistics. It is not a real-time display, but takes a snapshot of the system.- Syntax: ps [options]
- ps -ef (on SGI, Sun, and HP Alpha)
- ps -aux | more
- ps -aux | grep username
UID | PID | PPID | C | STIME | TTY | TIME | CMD |
root | 157 | 1 | 0 | Mar 18 | ? | 0:03 | /usr/sbin/inetd -s |
root | 260 | 1 | 0 | Mar 18 | ? | 0:02 | /usr/sbin/vold |
smith | 10566 | 10564 | 0 | 07:02:31 | pts/4 | 0:01 | /usr/local/bin/tcsh |
jones | 11741 | 11739 | 1 | 11:12:30 | pts/8 | 0:00 | -csh |
smith | 10644 | 10510 | 0 | 07:09:25 | pts/2 | 0:14 | emacs NEW_CUTILS.c |
brown | 11656 | 11440 | 0 | 10:53:33 | pts/7 | 0:00 | idt -soft ppi-cesar.cgm |
Column | Description |
UID | User ID of process |
PID | Process id number |
PPID | Process ID of parent process |
C | Processor utilization for scheduling (obsolete) |
STIME | Starting time of process |
TTY | Controlling terminal of process, ? when no controlling terminal |
TIME | Cumulative execution time for the process |
CMD | Command name |
The columns and information displayed varies between architectures. Use the man command to check for specifics.
3.4.2 The top Command
The top command is a pseudo-real-time command that is useful for examining current processes on the system and for changing process priorities.- Syntax: top
3.4.3 The who and w Commands
Other commands to determine who is currently on the system are the who and w commands. The w command provides additional information about login and idle times for different processes.- Syntax: who
Syntax: w
3.4.4 Killing Processes
There are a number of ways to kill processes on a workstation. To kill a job that is in the foreground, press CTRL-c.Use the kill command along with the process ID (PID). (PID information can be obtained from the ps command).Syntax: kill -9 pidTo kill a background job, use the jobs command to find its job ID (n) and enter
- kill -9 %n
- Syntax: pkill
3.4.5 Checking the Load on Other Workstations
If a workstation appears to be heavily loaded, you can check the load on other workstations with the ruptim command.- Syntax: ruptim [workstation]
oak number of users: 1 load average: 0.26, 0.16, 0.00 fir number of users: 15 load average: 0.26, 0.06, 0.00 pine number of users: 25 load average: 0.21, 0.03, 0.01 juniper number of users: 15 load average: 0.39, 0.12, 0.01 cypress number of users: 9 load average: 0.22, 0.04, 0.00 balsam number of users: 15 load average: 0.18, 0.15, 0.00 walnut number of users: 3 load average: 2.00, 1.94, 1.56 beech number of users: 4 load average: 1.17, 1.15, 1.00The last three columns are 1-, 5-, and 15-minute averages. Values indicate whether the CPU is underutilized (< 1.0), 100% utilized (1.0), or processes are waiting (> 1.0). If you receive the error message,permission denied when executing this command, you need to modify your .rhosts file. The .rhosts file should include the systems being checked as well as the system you are logged on to.
3.4.6 Changing Process Priority
All Unix processes have a dynamically calculated priority. This priority changes over time as a process accumulates CPU time. To execute a program that will use several minutes of CPU time over a short wall-clock period, change the process priority so that it does not monopolize the machine. To do this, use the nice command when executing your process:- Syntax: nice -number argument
- nice -n 19 a.out
- Syntax: renice -number process_id
On-line Information
- man ps
man top
man who
man w
man kill
man nice
man renice
Return to top of page
3.5 Disk Usage
3.5.1 The df Command
The df command lists the current total disk usage for all file systems accessible by your workstation.- Syntax: df -k
The du Command
To determine your current disk quota usage, use the du command.- Syntax: du [options] directory
- du /users/username
- du -s /users/username
- du -s ~
The quota Command
On the Sun, HP Alpha, and Linux workstations, the quota command displays your current usage. This command does not display relevant information on the SGI systems.- Syntax: quota -v username
On-line Information
- man df
man du
man quota
Command History
The shell keeps a history list of recently executed commands if you instruct it to do so. The following line should be placed in your .login and .cshrc files.
- set history=nn
!line_numberAnother mechanism for recalling a previously executed command is to enter the first few letters of the previous command. For example, if you had previously entered a command to recursively look through your directory structure for all directory files, using
- ls -lR | grep drw
- !ls
Unix Tools
The Unix operating system provides a variety of utilities that allow you to perform functions such as combining multiple commands and redirecting your output.
Pipes
Pipes allow you to connect various combinations of Unix commands together. The pipe symbol is the vertical line, |, on your keyboard.For example, to search a directory listing for a particular string, and output the information to the screen a page at a time, enter- ls -l | grep 'string' | more
- ps -ef | grep username
I/O Redirection
In general, Unix commands send output to "standard out" (stdout), your terminal screen. At times, you may want this information written to a file instead. Unix allows you to either redirect output to a file or to have a Unix command read input from a file. The symbol > outputs information to a file, and < reads input from a file.For example, to perform a search on a directory listing and write that output to a file called "source.txt," enter- ls -l |grep '*.f' > source.txt
- mail user@host < input.txt
The sort Command
The sort utility sorts the lines in a file. By default, it sorts the file in ASCII order, with numbers preceding alphabetic characters.- Syntax: sort filename
- who | sort
File Differences (diff)
It is sometimes useful to check the differences between two files. The diff command performs this function.- Syntax: diff [options] file1 file2
Counting Lines, Words, and Characters (wc)
It is often useful to know the number of lines, words, and characters in a file. The wc utility accomplishes this task. By default, it prints out all three of these fields.- Syntax: wc [options] filename
- ls -l | wc -l
On-line Information
- man sort
man diff
man wc
Miscellaneous Utilities
There are several general-purpose utilities developed either within MMM or obtained from other sources. This section briefly describes some of these commands.
The phone Command
The phone utility accesses the on-line NCAR phone directory. It performs a search on an ASCII file and takes a string as its argument.- Syntax: phone string
- phone jones
- phone mmm | more
NCAR Central E-mail Database
To obtain e-mail information for individuals at NCAR that are not in the MMM Division, you can also access the NCAR central e-mail database with the following procedure.- Enter telnet directory
- At the login prompt, enter directory
- A menu will appear. Choose the appropriate option for searching for
an individual name.
The ispell Command
The ispell utility checks a file for misspelled words. To use this command, enter- Syntax: ispell filename
- Syntax: ispell -t filename
The mmminfo Command
As there are a large number of systems of varying architectures within the division, we have developed a utility for checking to find out what architecture a particular machine is as well as other pertinent information such as location and IP address. To find out information about a particular system enter the mmminfo command.- mmminfo string
The assist Command
Assist can also be accessed through our website.The assist utility will allow users to report problems or view problems that have been reported.
- assist options
To log a problem, use the -e option, where the editor is
either "vi" or "emacs". It will ask you specific questions and
place you in an editing session to type in information. After you
have submitted a problem report, you should receive mail stating
that your report has been received and informing you of a
reference ID for future reference.
-s Displays a listing of short-term entries in the assist database.
Short-term entries are those that will be addressed within a short
time frame (a day to a couple of weeks).
-l Displays a listing of all requests in the assist database.
-r request-id
List a complete description of specified request.
-u username
List brief descriptions of all requests submitted by the specified
user.
-w Show who is on-duty.
This person is responsible for monitoring
the assist database for that day, and can also
be contacted directly for immediate problems.
Following is a very brief introduction to some useful Unix commands, including examples of how to use each command. For more extensive information about any of these commands, use the
man
command as described below. Sources for more information appear at the end of this document.
On this page:
cal
cat
cd
chmod
cp
date
df
du
find
jobs
kill
less
and more
lpr
and lp
ls
man
mkdir
mv
ps
pwd
rm
rmdir
set
vi
w
and who
cal
This command will print a calendar for a specified month and/or year.
To show this month's calendar, enter:
cal
To show a twelve-month calendar for 2008, enter:
cal 2008
To show a calendar for just the month of June 1970, enter:
cal 6 1970cat
This command outputs the contents of a text file. You can use it to read brief files or to concatenate files together.
To append
cat file1 >> file2 file1
onto the end of file2
, enter:
To view the contents of a file named
cat myfilemyfile
, enter:
Because
cat
displays text without pausing, its output may quickly scroll off your screen. Use the less
command (described below) or an editor for reading longer text files.cd
This command changes your current directory location. By default, your Unix login session begins in your home directory.
To switch to a subdirectory (of the current directory) named
cd myfilesmyfiles
, enter:
To switch to a directory named
cd /home/dvader/empire_docs /home/dvader/empire_docs
, enter:
To move to the parent directory of the current directory, enter:
cd ..
To move to the root directory, enter:
cd /
To return to your home directory, enter:
cdchmod
This command changes the permission information associated with a file. Every file (including directories, which Unix treats as files) on a Unix system is stored with records indicating who has permission to read, write, or execute the file, abbreviated as r, w, and x. These permissions are broken down for three categories of user: first, the owner of the file; second, a group with which both the user and the file may be associated; and third, all other users. These categories are abbreviated as u for owner (or user), g for group, and o for other.
To allow yourself to execute a file that you own named
chmod u+x myfile myfile
, enter:
To allow anyone who has access to the directory in which
chmod o+rx myfile myfile
is stored to read or execute myfile
, enter:
You can view the permission settings of a file using the
ls
command, described below.
Note: Be careful with the
chmod
command. If you tamper with the directory permissions of your home directory, for example, you could lock yourself out or allow others unrestricted access to your account and its contents.
For more, see In Unix, how do I change the permissions for a file?
cp
This command copies a file, preserving the original and creating an identical copy. If you already have a file with the new name,
cp -i oldfile newfile cp
will overwrite and destroy the duplicate. For this reason, it's safest to always add -i
after the cp
command, to force the system to ask for your approval before it destroys any files. The general syntax for cp
is:
To copy a file named
cp -i /home/dvader/notes/meeting1 . meeting1
in the directory /home/dvader/notes
to your current directory, enter:
The
.
(period) indicates the current directory as destination, and the -i
ensures that if there is another file named meeting1
in the current directory, you will not overwrite it by accident.
To copy a file named
cp -i oldfile ~/mystuff/newfile oldfile
in the current directory to the new name newfile
in the mystuff
subdirectory of your home directory, enter:
The
~
character (tilde) is interpreted as the path of your home directory.
Note: You must have permission to read a file in order to copy it.
date
The
date
command displays the current day, date, time, and year.
To see this information, enter:
date df
This command reports file system disk usage (i.e., the amount of space taken up on mounted file systems). For each mounted file system,
df
reports the file system device, the number of blocks used, the number of blocks available, and the directory where the file system is mounted.
To find out how much disk space is used on each file system, enter the following command:
df
If the
df -kdf
command is not configured to show blocks in kilobytes by default, you can issue the following command:du
This command reports disk usage (i.e., the amount of space taken up by a group of files). The
du
command descends all subdirectories from the directory in which you enter the command, reporting the size of their contents, and finally reporting a total size for all the files it finds.
To find out how much disk space your files take up, switch to your home directory with the
du cd
command, and enter:
The numbers reported are the sizes of the files; on different systems, these sizes will be in units of either 512 byte blocks or kilobytes. To learn which is the case, use the
man
command, described below. On most systems, du -k
will give sizes in kilobytes.find
The
find
command lists all of the files within a directory and its subdirectories that match a set of conditions. This command is most commonly used to find all of the files that have a certain name.
To find all of the files named
find . -name myfile.txt -print myfile.txt
in your current directory and all of its subdirectories, enter:
To look in your current directory and its subdirectories for all of the files that end in the extension
find . -name "*.txt" -print .txt
, enter:
In these examples, the
find /home/user/myusername/ -name myfile.txt -print .
(period) represents your current directory. It can be replaced by the full pathname of another directory to search. For instance, to search for files named myfile.txt
in the directory /home/user/myusername
and its subdirectories, enter:
On some systems, omitting the final
/
(slash) after the directory name can cause find
to fail to return any results.
As a shortcut for searching in your home directory, enter:
find "$HOME/" -name myfile.txt -print
For more, see In Unix, what is the find command, and how do I use it to search through directories for files?
jobs
This command reports any programs that you suspended and still have running or waiting in the background (if you had pressed
jobs Ctrl-z
to suspend an editing session, for example). For a list of suspended jobs, enter:
Each job will be listed with a number; to resume a job, enter
%2 %
(percent sign) followed by the number of the job. To restart job number two, for example, enter:
This command is only available in the
csh
, bash
, tcsh
, and ksh
shells.kill
Use this command as a last resort to destroy any jobs or programs that you suspended and are unable to restart. Use the jobs command to see a list of suspended jobs. To kill suspended job number three, for example, enter:
kill %3
Now check the
kill -9 %3jobs
command again. If the job has not been cancelled, harsher measures may be necessary. Enter:less and more
Both
less
and more
display the contents of a file one screen at a time, waiting for you to press the Spacebar between screens. This lets you read text without it scrolling quickly off your screen. The less
utility is generally more flexible and powerful than more
, but more
is available on all Unix systems while less
may not be.
To read the contents of a file named
less textfile textfile
in the current directory, enter:
The
ls -la | less less
utility is often used for reading the output of other commands. For example, to read the output of the ls
command one screen at a time, enter:
In both examples, you could substitute
more
for less
with similar results. To exit either less
or more
, press q
. To exit less
after viewing the file, press q
.
Note: Do not use
less
or more
with executables (binary files), such as output files produced by compilers. Doing so will display garbage and may lock up your terminal.lpr and lp
These commands print a file on a printer connected to the computer network. The
lpr
command is used on BSD systems, and the lp
command is used in System V. Both commands may be used on the UITS systems.
To print a file named
lpr -Plp1 myfilemyfile
on a printer named lp1
with lpr
, enter:
To print the same file to the same printer with
lp -dlp1 myfilelp
, enter:
Note: Do not print to a printer whose name or location is unfamiliar to you.
ls
This command will list the files stored in a directory. To see a brief, multi-column list of the files in the current directory, enter:
ls
To also see "dot" files (configuration files that begin with a period, such as
ls -a .login
), enter:
To see the file permissions, owners, and sizes of all files, enter:
ls -la
If the listing is long and scrolls off your screen before you can read it, combine
ls -la | less ls
with the less
utility, for example:
For more, see In Unix, how do I list the files in a directory?
man
This command displays the manual page for a particular command. If you are unsure how to use a command or want to find out all its options, you might want to try using
man
to view the manual page.
For example, to learn more about the
man ls ls
command, enter:
To learn more about
man man man
, enter:
If you are not sure of the exact command name, you can use
man -k keyword man
with the -k
option to help you find the command you need. To see one line summaries of each reference page that contains the keyword you specify, enter:
Replace
keyword
in the above example with the keyword which you want to reference. Also see In Unix, what is the man command, and how do I use it to read manual pages?mkdir
This command will make a new subdirectory.
To create a subdirectory named
mkdir mystuff mystuff
in the current directory, enter:
To create a subdirectory named
mkdir /tmp/morestuff morestuff
in the existing directory named /tmp
, enter:
Note: To make a subdirectory in a particular directory, you must have permission to write to that directory.
mv
This command will move a file. You can use
mv
not only to change the directory location of a file, but also to rename files. Unlike the cp
command,mv
will not preserve the original file.
Note: As with the
cp
command, you should always use -i
to make sure you do not overwrite an existing file.
To rename a file named
mv -i oldname newname oldname
in the current directory to the new name newname
, enter:
To move a file named
mv -i newhw/hw1 oldhwhw1
from a subdirectory named newhw
to another subdirectory named oldhw
(both subdirectories of the current directory), enter:
If, in this last operation, you also wanted to give the file a new name, such as
mv -i newhw/hw1 oldhw/firsthw firsthw
, you would enter:ps
The
ps -alxwwps
command displays information about programs (i.e., processes) that are currently running. Entered without arguments, it lists basic information about interactive processes you own. However, it also has many options for determining what processes to display, as well as the amount of information about each. Like lp
and lpr
, the options available differ between BSD and System V implementations. For example, to view detailed information about all running processes, in a BSD system, you would use ps
with the following arguments:
To display similar information in System V, use the arguments:
ps -elf
For more information about
ps
refer to the ps
man
page on your system. Also see In Unix, what do the output fields of the ps command mean?pwd
This command reports the current directory path. Enter the command by itself:
pwdrm
This command will remove (destroy) a file. You should enter this command with the
rm -i junk -i
option, so that you'll be asked to confirm each file deletion. To remove a file named junk
, enter:
Note: Using
rm
will remove a file permanently, so be sure you really want to delete a file before you use rm
.
To remove a non-empty subdirectory,
rm -rf oldstuffrm
accepts the -r
option. On most systems this will prompt you to confirm the removal of each file. This behavior can be prevented by adding the -f
option. To remove an entire subdirectory named oldstuff
and all of its contents, enter:
Note: Using this command will cause
ls -R oldstuff | lessrm
to descend into each subdirectory within the specified subdirectory and remove all files without prompting you. Use this command with caution, as it is very easy to accidently delete important files. As a precaution, use the ls
command to list the files within the subdirectory you wish to remove. To browse through a subdirectory named oldstuff
, enter:rmdir
This command will remove a subdirectory. To remove a subdirectory named
rmdir oldstuff oldstuff
, enter:
Note: The directory you specify for removal must be empty. To clean it out, switch to the directory and use the
ls
and rm
commands to inspect and delete files.set
This command displays or changes various settings and options associated with your Unix session.
To see the status of all settings, enter the command without options:
set
If the output scrolls off your screen, combine
set | lessset
with less
:
The syntax used for changing settings is different for the various kinds of Unix shells; see the
man
entries for set
and the references listed at the end of this document for more information.vi
This command starts the vi text editor. To edit a file named
vi myfile myfile
in the current directory, enter:
The vi editor works fairly differently from other text editors. If you have not used it before, you should probably look at a tutorial, such as How do I use the vi text editor? Another helpful document for getting started with vi is A quick reference list of vi editor commands.
The very least you need to know to start using vi is that in order to enter text, you need to switch the program from command mode to insert mode by pressing
i
. To navigate around the document with the cursor keys, you must switch back to command mode by pressing Esc
. To execute any of the following commands, you must switch from command mode to ex mode by pressing :
(the colon key): Enter w
to save; wq
to save and quit; q!
to quit without saving.w and who
The
w
and who
commands are similar programs that list all users logged into the computer. If you use w
, you also get a list of what they are doing. If you use who
, you also get the IP numbers or computer names of the terminals they are using.
No comments:
Post a Comment