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

Basic Unix

This document provides an overview of basic Unix commands including ls, cd, cp, mv, logout, passwd, cat, more, mkdir, and rm. It explains that files and directories in Unix are uniquely defined by their pathname and uses the example of ~/ada_files/test.a to demonstrate specifying the full pathname of a file located within subdirectories of a user's home directory.

Uploaded by

Brandon Morales
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
199 views

Basic Unix

This document provides an overview of basic Unix commands including ls, cd, cp, mv, logout, passwd, cat, more, mkdir, and rm. It explains that files and directories in Unix are uniquely defined by their pathname and uses the example of ~/ada_files/test.a to demonstrate specifying the full pathname of a file located within subdirectories of a user's home directory.

Uploaded by

Brandon Morales
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Basic Unix Commands

We will be working on the Unix operating system. Here are some basic
commands (and hints) to help you get started.

When you login to your account you are located in your home directory. You can
always specify your home directory by the symbol ~. All files and directories
within Unix are uniquely defined by their path. Imagine the following structure
of files and directories:
~

ada_files misc

test.a

Suppose we are interested in using an Ada program that is stored in a file test.a
located in directory ada_files. The full pathname which uniquely describes test.a
from the home directory is: ~/ada_files/test.a. If we are already located in ~, we
could specify the file as: ada_files/test.a. If we are located in ada_files, we need
only specify test.a.

For the commands listed below, the <dir> and <file> arguments are expected to
be pathnames describing directories or files, respectively.

What Command Description


list contents of ls <dir> List the contents of the specified directory; if none is
a directory specified, list the contents of the current directory.
change cd <dir> Move to the specified directory; if none is specified, go
directory to the home directory.
copy cp <file1> <file2> Copy the contents of file1 into file2. (Note: the contents
of file2 are overwritten.)
rename mv <file1> <file2> Rename file1 as file2.
logout logout Exit your account.
change passwd Allows you to change your password. This should be
password done the first time you login.
display file on cat <file> Display the contents of the specified file on the screen.
screen
display file on more <file> Display the contents of the specified file on the screen
screen one page at a time.
create a mkdir <dir> Create a new directory called name. A path may be
directory specified for the location of the directory; if not, name is
created within the current directory.
remove a file rm <file> Remove the file specified.
Dr. Tracy Bradley Maples
Dr. Tracy Bradley Maples

You might also like