You are on page 1of 2

cd [dir] ln [options] sourcename [destname]

Change working directory to dir; default is the users home ln [options] sourcenames destdirectory
directory. Create links for files, allowing them to be accessed by different
names.
chgrp newgroup files options:
Change the group of one or more files to newgroup. newgroup is -b backup files before removing originals
either a group ID number of a group name. Only the owner can -i prompt for permission before removing files
change the group. -s create a symbolic link. This lets you see the name
options: of the link when you run ls -l (otherwise there is
-c print information about those files that are affected now way to know the name that a file is linked to).
UNIX Reference Card -R recursively apply changes to subdirectories
ls [options] [names]
chmod [options] mode files List the contents of a directory. If no names are given, the files
Warnings!! Change the access mode (permissions) of one or more files. in the current directory are listed.
Only the owner of a file or a privileged user may change its options:
When a file has been DELETED it can only be restored from a mode.
backup. The original is gone! -a list all files, including hidden files
options: -c list files by status change time
When a file is OVERWRITTEN it has been changed forever! It -c print information about affected files -l long format listing (permissions, owner, size,
can only be restored from a backup. -R recursively apply changes to subdirectories modification time)
mode:
can be numeric mkdir [options] directories
Directory Abbreviations 4 read Create one or more directories.
~ home directory (tilde) 2 write options:
~username another user’s home directory 1 execute -m mode set the access mode for new directories.
. current working directory or an expression of the form who opcode permission. who See chmod for mode formats.
.. parent of current working directory is optional (if missing, default is a) -p create intervening parent directories if they
who don’t exist
u user
Communication g group more [options] [files]
o other Display the content of the named files one screen at a time. See
ssh [options] hostname
a all (default) less for an alternative.
Ssh (Secure Shell) a program for logging into a remote host.
opcode options:
Replaces telnet, rlogin, and rsh
+ add permission see man pages for options ( type: man more )
options:
-l login_name specifies the user to log in on the – remove permission pwd
remote machine = assign permission
permission Print the full pathname of the current working directory.
scp [options] user@host1:file1 user@host2:file2 r read
Secure copy files between hosts on a network; uses ssh for data w write scp [options] user@host1:file1 user@host2:file2
transfer. x execute Secure copy files between hosts on a network; uses ssh for data
options: X set execution permission only if transfer.
-p preserve modification times executable by user options:
-r recursively copy entire directories -p preserve modification times
cp [options] file1 file2 -r recursively copy entire directories
Comparison cp [options] files directory
Copy file1 to file2, or copy one or more files to the same names mv [options] sources target
under directory. Move or rename files and directories. The source and target
diff [options] file1 file2
options: determine the result.
Compare two text files.
-a preserves attributes of original files source target result
options:
-f remove existing files in the destination file name rename file as name
-a treat all files as text files
-i prompt before overwriting destination files file existing overwrite existing file
-b ignore repeating blanks and end-of-line blanks;
-r recursively copy directories file with source file
treat successive blanks as one
-s make symbolic links instead of copying directory name rename directory as
-i ignore case in text comparison
name
-q output only whether files differ
file [options] files directory existing move directory to be a
Classify the named files according to the type of data they directory subdirectory of
File Management contain. existing directory
cat [options] [files] options:
less [options] [filename] -b back up files before moving
Read one or more files and print them on standard output. Use A program for browsing or paging through files or other output.
the > operator to combine several files into a new file; use >> to -f force the move
Can use arrow keys for scrolling forward or backward. -i query user before removing files
append files to an existing file. options:
options: see man pages for options ( type: man less )
-n print the number of the output line to the line’s left
-s squeeze out extra blank lines
rm [options] files Searching System Status
Delete one or more files. Once a file or directory has been
removed it can only be retrieved from a backup! egrep [options] [regexp] [files] Control-C
options: grep [options] [regexp] [files] Stop (interrupt) job running in the foreground
-d remove directories, even if they are not empty Search one or more files for lines that match a regular expression
-f remove files without prompting regexp. To include characters such as +, ?, |, ( ), blank spaces, Control-Z
etc. enclose these expressions in quotes. See man pages for the Suspend job running in the foreground
-i prompt for file removal
-r recursively remove an entire directory and its differences between egrep, fgrep, and grep. date [options] [+format] [date]
contents, including subdirectories. Be very careful options: Print the current date and time. You may specify a display
with this option. -c print only a count of matched lines format.
-i ignore case options:
Miscellaneous -l list filenames but not matched lines see man pages for options ( type: man date )
-n print lines and their line numbers
! Repeat the last command -v print all lines that do not match regexp df [options] [name]
Report the amount of free disk space available on all mounted
!string Repeat the last command beginning with string. find [pathnames] [conditions] file systems or on a given name.
Useful for finding particular files. find descends the directory options:
cal [-jy] [[month] year] tree beginning at each pathname and locates files that meet the
Print a 12-month calendar for the given year or a one-month -k print sizes in kilobytes
specified conditions.
calendar of the given month and year. No arguments, print a options: du [options] [directories]
calendar for the current month. -name pattern find files whose name matches Print disk used by each named directory and its subdirectories.
options: pattern options:
-j display Julian dates -print print the matching files and -k print sizes in kilobytes
-y display entire current year directories using their full pathnames -s print only the grand total for each directory
clear see man pages for options ( type: man find )
Clear the terminal display env [option] [variable=value ...] [command]
Display the current environment or, if an environment variable is
history Storage specified, set it to a new value and display the modified
Display list of most recently executed commands environment.
compress [options] [files] – compress file
kill [option] IDs uncompress [options] [files] – uncompress compressed file option:
Send a signal to terminate one or more process IDs. compress reduces the size of the named files. When possible the -u unset the specified variable
options: resulting compressed file will have the file extension .Z. ps [options]
-l list all signals Compressed files can be restored using uncompress. Report on active processes.
-signal the signal number (from ps -f) or name (from options: options:
kill -l). You can kill just about any process with -d uncompress file, same as uncompress -a list all processes except processes not associated
a signal number of 9. -v prints the percentage reduction with the terminal
-V prints the version of compress -e list all processes
man command
Display information from the online reference manuals. gzip [options] [files] – compress file -l produce long format listing
gunzip [options] [files] – uncompress gzipped file -u list list for usernames in list
jobs [options] job_id GNU compression utility. Renames compressed files
Display status of jobs in the current session. Simply specifying quota [option]
filename.gz. Uncompress with gunzip. Display disk usage and limits
jobs returns the status of all stopped jobs, running background options:
jobs, and all suspended jobs. option:
-d uncompress file, same as gunzip -v report quotas even if they haven’t been
options: -r recursively compress or decompress files within a
-l provide more information about each job listed exceeded
directory
-p display only the process IDs for the process group -v print name and percent size reduction for each file
leaders of the selected jobs Contact Information
tar [options] [tarfile] [other-files]
whereis command Copy files to or restore files from an archive. If any files are Phone: 612-626-0802
Locate a command; display the full pathname for the command. directories, tar acts on the entire subtree.
options: Email: help@msi.umn.edu
which [commands]
List which files would be executed if the named commands had -c create a new archive
-d compare the files stored in tarfile with other-files WWW: http://www.msi.umn.edu
been run.
-r append other-files to the end of an existing archive
-t print the names of files in archive
http://www.msi.umn.edu/user_support
-v verbose, print filenames as they are added or
extracted
-x extract other-files from archive, or extract all files
if other-files not specified

You might also like